From 3ded90aa1ee5ee4c94c69f8714cd8dbd6997128e Mon Sep 17 00:00:00 2001 From: songyichun1 Date: Thu, 23 Jul 2026 16:29:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9A2A=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E4=BB=8E=E5=A1=AB=E5=86=99id=E4=B8=BA=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E9=80=89=E6=8B=A9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/create/CustomCreate.css | 128 ++++++ frontend/src/create/CustomCreate.tsx | 212 ++++++++- frontend/src/create/a2aSpaces.ts | 68 +++ frontend/src/create/veadkCatalog.ts | 4 +- frontend/tests/deploymentEnv.test.mjs | 2 +- frontend/tests/markdownPromptEditor.test.mjs | 9 +- tests/cli/test_frontend_skill_spaces.py | 133 ++++++ .../test_generated_agent_backend_codegen.py | 20 + .../test_generated_agent_component_matrix.py | 37 ++ veadk/cli/cli_frontend.py | 189 +++++++- veadk/cli/generated_agent_codegen.py | 60 ++- veadk/cli/generated_agent_security.py | 7 +- ...tor-C7VckftE.js => CodeEditor-C8L3YPfR.js} | 2 +- ...hm.js => MarkdownPromptEditor-CwT7JlSU.js} | 2 +- veadk/webui/assets/index-60iUSTQP.css | 10 - veadk/webui/assets/index-BXS3Zyyl.css | 10 + .../{index-u-pg5XfV.js => index-gtSqVSNF.js} | 418 +++++++++--------- veadk/webui/index.html | 4 +- 18 files changed, 1057 insertions(+), 258 deletions(-) create mode 100644 frontend/src/create/a2aSpaces.ts rename veadk/webui/assets/{CodeEditor-C7VckftE.js => CodeEditor-C8L3YPfR.js} (99%) rename veadk/webui/assets/{MarkdownPromptEditor--dxbgBhm.js => MarkdownPromptEditor-CwT7JlSU.js} (99%) delete mode 100644 veadk/webui/assets/index-60iUSTQP.css create mode 100644 veadk/webui/assets/index-BXS3Zyyl.css rename veadk/webui/assets/{index-u-pg5XfV.js => index-gtSqVSNF.js} (50%) diff --git a/frontend/src/create/CustomCreate.css b/frontend/src/create/CustomCreate.css index 3cba395e..94b9eb60 100644 --- a/frontend/src/create/CustomCreate.css +++ b/frontend/src/create/CustomCreate.css @@ -970,6 +970,134 @@ margin: 0; line-height: 1.6; } +.cw-a2a-space-picker { + display: flex; + flex-direction: column; + gap: 8px; +} +.cw-a2a-space-row { + display: flex; + align-items: center; + gap: 8px; +} +.cw-a2a-space-select-wrap { + position: relative; + flex: 1; + min-width: 0; +} +.cw-a2a-space-trigger { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + height: 34px; + min-height: 34px; + gap: 8px; + padding: 0 8px 0 10px; + border: 0; + border-radius: 6px; + background-color: hsl(var(--muted) / 0.38); + color: hsl(var(--foreground)); + cursor: pointer; + font: inherit; + font-size: 12px; + font-weight: 500; + line-height: 1.35; + letter-spacing: 0; +} +.cw-a2a-space-trigger[aria-expanded="true"] { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background-color: hsl(var(--background)); + filter: drop-shadow(0 2px 2px hsl(var(--foreground) / 0.2)); +} +.cw-a2a-space-trigger:disabled { + cursor: not-allowed; + opacity: 0.5; +} +.cw-a2a-space-trigger.is-error { + box-shadow: 0 0 0 1px hsl(var(--destructive) / 0.55); +} +.cw-a2a-space-trigger > span { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.cw-a2a-space-trigger-icon { + width: 14px; + height: 14px; + flex-shrink: 0; + color: hsl(var(--muted-foreground)); + transition: transform 0.14s ease; +} +.cw-a2a-space-trigger[aria-expanded="true"] .cw-a2a-space-trigger-icon { + transform: rotate(90deg); +} +.cw-a2a-space-menu { + position: absolute; + z-index: 30; + top: 100%; + left: 0; + width: 100%; + max-height: 238px; + overflow-y: auto; + padding: 0; + border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; + background: hsl(var(--background)); + color: hsl(var(--foreground)); + filter: drop-shadow(0 2px 2px hsl(var(--foreground) / 0.2)); + font-size: 12px; +} +.cw-a2a-space-option { + display: flex; + align-items: center; + width: 100%; + min-height: 32px; + padding: 8px; + border: 0; + background: transparent; + color: hsl(var(--foreground)); + cursor: default; + font: inherit; + font-size: 12px; + font-weight: 500; + line-height: 1.35; + text-align: left; +} +.cw-a2a-space-option:hover, +.cw-a2a-space-option:focus-visible { + outline: none; + background: hsl(var(--muted) / 0.55); +} +.cw-a2a-space-option.is-selected { + background: hsl(var(--muted) / 0.55); + color: hsl(var(--foreground)); +} +.cw-a2a-space-option:last-child { + border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; +} +.cw-a2a-space-refresh { + flex-shrink: 0; + width: 34px; + height: 34px; + border: 1px solid hsl(var(--border)); + border-radius: 8px; + background: hsl(var(--muted) / 0.38); + color: hsl(var(--foreground)); +} +.cw-a2a-space-status { + display: inline-flex; + align-items: center; + gap: 6px; +} +.cw-a2a-space-error { + align-items: flex-start; + padding: 9px 11px; + font-size: 12.5px; +} .cw-error-text { font-size: 12px; color: hsl(var(--destructive)); diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index 18036681..24669a51 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -70,6 +70,10 @@ import type { SkillSource } from "./skills/types"; import { SkillHubPicker } from "./SkillHubPicker"; import { LocalPicker } from "./LocalPicker"; import { SkillSpacePicker } from "./SkillSpacePicker"; +import { + listA2aSpaces, + type A2aSpaceRef, +} from "./a2aSpaces"; import { ProjectPreview, type DeploymentTaskUpdate, @@ -246,6 +250,10 @@ const A2A_REGISTRY_ENV_TO_FIELD = { } as const; type A2aRegistryEnvKey = keyof typeof A2A_REGISTRY_ENV_TO_FIELD; +const A2A_REGISTRY_SPACE_ENV_KEY = "REGISTRY_SPACE_ID"; +const A2A_REGISTRY_RUNTIME_ENV = A2A_REGISTRY_ENV.filter( + (item) => item.key !== A2A_REGISTRY_SPACE_ENV_KEY, +); function a2aRegistryEnvValues( registry: AgentDraft["a2aRegistry"] | undefined, @@ -405,6 +413,189 @@ function RuntimeEnvFields({ ); } +function a2aSpaceDisplayName(space: A2aSpaceRef): string { + return space.name.trim() || "未命名智能体中心"; +} + +function A2aSpaceSelect({ + value, + region, + invalid, + onChange, +}: { + value: string; + region: string; + invalid: boolean; + onChange: (spaceId: string) => void; +}) { + const normalizedRegion = region.trim() || A2A_REGISTRY_DEFAULTS.region; + const [spaces, setSpaces] = useState([]); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + const [reloadKey, setReloadKey] = useState(0); + const [open, setOpen] = useState(false); + const pickerRef = useRef(null); + + useEffect(() => { + let cancelled = false; + setLoading(true); + setError(null); + listA2aSpaces({ region: normalizedRegion }) + .then((items) => { + if (!cancelled) setSpaces(items); + }) + .catch((err) => { + if (!cancelled) { + setSpaces([]); + setError(err instanceof Error ? err.message : "加载失败"); + } + }) + .finally(() => { + if (!cancelled) setLoading(false); + }); + return () => { + cancelled = true; + }; + }, [normalizedRegion, reloadKey]); + + const selectedKnown = + !value || spaces.some((space) => space.id === value.trim()); + const selectedSpace = spaces.find((space) => space.id === value.trim()); + const selectedLabel = selectedSpace + ? a2aSpaceDisplayName(selectedSpace) + : value && !selectedKnown + ? "已选择的智能体中心" + : "请选择智能体中心"; + const disabled = loading && spaces.length === 0; + + useEffect(() => { + if (!open) return; + const handlePointerDown = (event: PointerEvent) => { + const target = event.target; + if ( + target instanceof Node && + pickerRef.current && + !pickerRef.current.contains(target) + ) { + setOpen(false); + } + }; + const handleKeyDown = (event: KeyboardEvent) => { + if (event.key === "Escape") setOpen(false); + }; + window.addEventListener("pointerdown", handlePointerDown); + window.addEventListener("keydown", handleKeyDown); + return () => { + window.removeEventListener("pointerdown", handlePointerDown); + window.removeEventListener("keydown", handleKeyDown); + }; + }, [open]); + + const selectSpace = (spaceId: string) => { + onChange(spaceId); + setOpen(false); + }; + + return ( +
+
+
+ + {open && ( +
+ + {value && !selectedKnown && ( + + )} + {spaces.map((space) => { + const optionLabel = a2aSpaceDisplayName(space); + const selected = space.id === value; + return ( + + ); + })} +
+ )} +
+ +
+ {error ? ( +
+ + {error} +
+ ) : loading ? ( + + + 正在加载 AgentKit 智能体中心… + + ) : spaces.length === 0 ? ( + 此账号下暂无 AgentKit 智能体中心。 + ) : ( + + 已加载 {spaces.length} 个智能体中心,列表仅展示中心名称。 + + )} +
+ ); +} + /* ---------------------------------------------------------------- * * MCP tool editor: edits draft.mcpTools. Each row picks a transport * (http / stdio) and shows the matching fields. http -> url + optional @@ -907,7 +1098,7 @@ function nodeProblem( if (isRoot) return "远程 Agent 只能作为子 Agent"; return n.a2aRegistry?.registrySpaceId.trim() ? null - : "缺少 AgentKit 智能体中心 ID"; + : "缺少 AgentKit 智能体中心"; } const nameProblem = agentNameProblem(n.name); if (nameProblem) return nameProblem; @@ -2291,14 +2482,29 @@ export function CustomCreate({
AgentKit 智能体中心 + *

远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。

+ + patchA2aRegistryEnv( + A2A_REGISTRY_SPACE_ENV_KEY, + spaceId, + ) + } + /> {showErrors && a2aRegistrySpaceMissing && ( - AgentKit 智能体中心 ID 为必填项 + 请选择 AgentKit 智能体中心 )} diff --git a/frontend/src/create/a2aSpaces.ts b/frontend/src/create/a2aSpaces.ts new file mode 100644 index 00000000..eda9eb32 --- /dev/null +++ b/frontend/src/create/a2aSpaces.ts @@ -0,0 +1,68 @@ +// AgentKit A2A Space client. The browser calls the local /web/a2a-spaces +// route; the server signs ListA2aSpaces with its Volcengine credential chain. + +import { DEFAULT_REQUEST_TIMEOUT_MS, requestSignal } from "../adk/timeout"; + +export interface A2aSpaceTag { + key: string; + value: string; +} + +export interface A2aSpaceRef { + id: string; + name: string; + intentEnabled: boolean; + projectName: string; + tags: A2aSpaceTag[]; + isDefault: boolean; + region: string; +} + +export interface A2aSpacePage { + items: A2aSpaceRef[]; + totalCount: number; + page: number; + pageSize: number; +} + +export interface ListA2aSpacesOptions { + region?: string; + pageSize?: number; + project?: string; +} + +async function jfetch(url: string): Promise { + const res = await fetch(url, { + headers: { accept: "application/json" }, + signal: requestSignal(undefined, DEFAULT_REQUEST_TIMEOUT_MS), + }); + if (res.status === 409) { + throw new Error("服务端未配置 Volcengine AK/SK,无法访问 AgentKit 智能体中心"); + } + if (res.status === 401) { + throw new Error("请先登录以访问 AgentKit 智能体中心"); + } + if (!res.ok) { + let detail = ""; + try { + const j = (await res.json()) as { detail?: string }; + detail = j.detail || ""; + } catch { + /* ignore */ + } + throw new Error(`请求失败 (${res.status})${detail ? ": " + detail : ""}`); + } + return res.json() as Promise; +} + +export async function listA2aSpaces( + options: ListA2aSpacesOptions = {}, +): Promise { + const params = new URLSearchParams({ + region: options.region || "cn-beijing", + page_size: String(options.pageSize ?? 100), + project: options.project || "default", + }); + const data = await jfetch(`/web/a2a-spaces?${params.toString()}`); + return data.items || []; +} diff --git a/frontend/src/create/veadkCatalog.ts b/frontend/src/create/veadkCatalog.ts index 58a3eaf6..7ddeb1cb 100644 --- a/frontend/src/create/veadkCatalog.ts +++ b/frontend/src/create/veadkCatalog.ts @@ -93,8 +93,8 @@ export const A2A_REGISTRY_ENV: EnvVar[] = [ { key: "REGISTRY_SPACE_ID", required: true, - placeholder: "请输入智能体中心 ID,如 as-yer579143kbrkemozdn6", - comment: "AgentKit 智能体中心 ID", + placeholder: "请选择智能体中心", + comment: "AgentKit 智能体中心", }, { key: "REGISTRY_TOP_K", diff --git a/frontend/tests/deploymentEnv.test.mjs b/frontend/tests/deploymentEnv.test.mjs index 759572eb..95892cd3 100644 --- a/frontend/tests/deploymentEnv.test.mjs +++ b/frontend/tests/deploymentEnv.test.mjs @@ -208,7 +208,7 @@ test("materializes A2A registry defaults for deployment env", () => { assert.equal( A2A_REGISTRY_ENV.find((item) => item.key === "REGISTRY_SPACE_ID") ?.placeholder, - "请输入智能体中心 ID,如 as-yer579143kbrkemozdn6", + "请选择智能体中心", ); assert.deepEqual( runtimeEnvVars(A2A_REGISTRY_ENV, { diff --git a/frontend/tests/markdownPromptEditor.test.mjs b/frontend/tests/markdownPromptEditor.test.mjs index 9cf99b4e..2ab76152 100644 --- a/frontend/tests/markdownPromptEditor.test.mjs +++ b/frontend/tests/markdownPromptEditor.test.mjs @@ -329,7 +329,14 @@ test("remote Agent configures only the AgentKit center", () => { assert.match(createSource, /loop: "循环型智能体"/); assert.match(createSource, /a2a: "远程智能体"/); assert.match(createSource, //); - assert.match(createSource, /AgentKit 智能体中心 ID 为必填项/); + assert.match(createSource, / None: asyncio.get_running_loop() +def test_list_a2a_spaces_paginates_and_maps_names( + monkeypatch: pytest.MonkeyPatch, tmp_path: Path +) -> None: + app = _create_frontend_app(monkeypatch, tmp_path) + calls: list[dict[str, Any]] = [] + + class _FakeResponse: + def __init__(self, payload: dict[str, Any]) -> None: + self.status_code = 200 + self._payload = payload + + def json(self) -> dict[str, Any]: + return self._payload + + class _FakeAsyncClient: + def __init__(self, **kwargs: Any) -> None: + del kwargs + + async def __aenter__(self) -> "_FakeAsyncClient": + return self + + async def __aexit__(self, *args: Any) -> None: + del args + + async def post(self, url: str, **kwargs: Any) -> _FakeResponse: + body = json.loads(kwargs["content"].decode("utf-8")) + calls.append( + { + "url": url, + "params": kwargs["params"], + "headers": kwargs["headers"], + "body": body, + } + ) + page = body["PageNumber"] + items = [ + { + "Id": "as-1", + "Name": "默认智能体中心", + "IntentEnabled": True, + "ProjectName": "default", + "Tags": [{"Key": "env", "Value": "prod"}], + "IsDefault": True, + }, + { + "Id": "as-2", + "Name": "客服智能体中心", + "IntentEnabled": False, + "ProjectName": "default", + "Tags": [], + "IsDefault": False, + }, + ] + if page == 2: + items = [ + { + "Id": "as-3", + "Name": "销售智能体中心", + "IntentEnabled": True, + "ProjectName": "default", + "Tags": [], + "IsDefault": False, + } + ] + return _FakeResponse({"Result": {"TotalCount": 3, "Items": items}}) + + monkeypatch.setattr("httpx.AsyncClient", _FakeAsyncClient) + + with TestClient(app) as client: + response = client.get( + "/web/a2a-spaces", + params={"region": "cn-beijing", "page_size": 2, "project": "default"}, + ) + + assert response.status_code == 200 + assert response.json() == { + "items": [ + { + "id": "as-1", + "name": "默认智能体中心", + "intentEnabled": True, + "projectName": "default", + "tags": [{"key": "env", "value": "prod"}], + "isDefault": True, + "region": "cn-beijing", + }, + { + "id": "as-2", + "name": "客服智能体中心", + "intentEnabled": False, + "projectName": "default", + "tags": [], + "isDefault": False, + "region": "cn-beijing", + }, + { + "id": "as-3", + "name": "销售智能体中心", + "intentEnabled": True, + "projectName": "default", + "tags": [], + "isDefault": False, + "region": "cn-beijing", + }, + ], + "totalCount": 3, + "page": 1, + "pageSize": 2, + } + assert [call["body"]["PageNumber"] for call in calls] == [1, 2] + assert all(call["body"]["PageSize"] == 2 for call in calls) + assert all(call["body"]["ProjectName"] == "default" for call in calls) + assert calls[0]["params"]["Action"] == "ListA2aSpaces" + assert calls[0]["params"]["Version"] == "2025-10-30" + assert calls[0]["url"] == "https://agentkit.cn-beijing.volcengineapi.com" + assert "Authorization" in calls[0]["headers"] + assert "X-Content-Sha256" in calls[0]["headers"] + + +def test_a2a_space_routes_keep_missing_credentials_status( + monkeypatch: pytest.MonkeyPatch, tmp_path: Path +) -> None: + app = _create_frontend_app(monkeypatch, tmp_path) + monkeypatch.delenv("VOLCENGINE_ACCESS_KEY") + monkeypatch.delenv("VOLCENGINE_SECRET_KEY") + + with TestClient(app) as client: + response = client.get("/web/a2a-spaces", params={"region": "cn-beijing"}) + + assert response.status_code == 409 + + def test_list_skill_spaces_maps_metadata_and_pagination( monkeypatch: pytest.MonkeyPatch, tmp_path: Path ) -> None: diff --git a/tests/cli/test_generated_agent_backend_codegen.py b/tests/cli/test_generated_agent_backend_codegen.py index 51d7cf8b..1f0a0739 100644 --- a/tests/cli/test_generated_agent_backend_codegen.py +++ b/tests/cli/test_generated_agent_backend_codegen.py @@ -115,6 +115,26 @@ def test_security_rejects_enabled_a2a_registry_without_space_id() -> None: validate_project_policy(draft) +def test_security_allows_registry_backed_remote_agent_without_url() -> None: + draft = AgentDraft( + name="demo", + instruction="You are helpful.", + agentType="sequential", + subAgents=[ + AgentDraft( + agentType="a2a", + a2aRegistry={ + "enabled": True, + "registrySpaceId": "space-test", + }, + ) + ], + ) + + validate_project_policy(draft) + validate_debug_policy(draft) + + def test_url_policy_rejects_private_literal_ip() -> None: with pytest.raises(DebugPolicyError): validate_url_not_private("http://127.0.0.1:8000", field_name="url") diff --git a/tests/cli/test_generated_agent_component_matrix.py b/tests/cli/test_generated_agent_component_matrix.py index 26d1bf68..7745e11b 100644 --- a/tests/cli/test_generated_agent_component_matrix.py +++ b/tests/cli/test_generated_agent_component_matrix.py @@ -211,6 +211,43 @@ def test_every_tracing_exporter_generates_code_and_env( _assert_python_files_compile(project) +def test_a2a_registry_child_attaches_tools_to_llm_parent() -> None: + project = generate_project_from_draft( + AgentDraft( + name="root-agent", + instruction="Use available tools to answer user requests.", + subAgents=[ + AgentDraft( + name="Reliability Review Remote Agent", + description="ignored remote description", + instruction="ignored remote instruction", + agentType="a2a", + a2aRegistry=A2ARegistryConfig( + enabled=True, + registrySpaceId="space-test", + ), + ) + ], + ) + ) + files = _files(project) + agent_py = files["agents/root_agent/agent.py"] + + assert "a2a_registry_config_agent_sub_1 = registry_config_from_env()" in agent_py + assert "tools=[*a2a_registry_tools_agent_sub_1]" in agent_py + assert ( + 'setattr(agent, "_veadk_a2a_registry_config", ' + "a2a_registry_config_agent_sub_1)" in agent_py + ) + assert "agent_sub_1 = Agent(" not in agent_py + assert "sub_agents=[agent_sub_1]" not in agent_py + assert "Reliability Review Remote Agent" not in agent_py + assert "ignored remote description" not in agent_py + assert "ignored remote instruction" not in agent_py + assert "REGISTRY_SPACE_ID=space-test" in files[".env.example"] + _assert_python_files_compile(project) + + def test_a2a_registry_center_generates_tools_and_env() -> None: project = generate_project_from_draft( AgentDraft( diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index 13d296fb..48a407a1 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -32,6 +32,7 @@ from collections.abc import Iterable from pathlib import Path from typing import Any +from urllib.parse import urlparse import click @@ -3189,13 +3190,193 @@ async def _web_runtime_config(): ) or os.path.exists("/var/run/secrets/iam/credential") return {"credentials": has_creds} - # ---- SkillSpace proxy (AgentKit account-scoped skills) ---------------- + # ---- AgentKit account-scoped resources (A2A Spaces / Skills) ---------- # These routes sign requests with the SERVER's Volcengine credentials (same # chain /web/deploy-agentkit uses) and sit under /web/* so the OAuth2 # middleware gates them by SSO session when SSO is enabled. The browser - # never sees AK/SK. v1 only returns SKILL.md (SkillMd) content, not the - # full TOS zip; that keeps the surface small and mirrors how the public - # Skill Hub picker only needs markdown for basic skills. + # never sees AK/SK. + + def _agentkit_openapi_endpoint(region: str) -> str: + host = os.getenv("AGENTKIT_OPENAPI_HOST", "").strip() + endpoint = os.getenv("AGENTKIT_OPENAPI_ENDPOINT", "").strip() + if endpoint: + return endpoint.rstrip("/") + if host: + return "https://" + host.removeprefix("https://").removeprefix( + "http://" + ).rstrip("/") + return f"https://agentkit.{region}.volcengineapi.com" + + def _agentkit_openapi_headers( + *, + region: str, + action: str, + body: str, + endpoint: str, + ) -> dict[str, str]: + from veadk.a2a.registry_client import _volc_sign_v4 + + ak, sk, token = _resolve_ve_credentials() + parsed = urlparse(endpoint) + host = parsed.netloc + content_type = "application/json; charset=UTF-8" + headers_to_sign = { + "Host": host, + "Content-Type": content_type, + } + signed_headers = _volc_sign_v4( + access_key=ak, + secret_key=sk, + service="agentkit", + region=region, + method="POST", + path=parsed.path or "/", + query={"Action": action, "Version": "2025-10-30"}, + headers=headers_to_sign, + body=body, + ) + headers = { + "Content-Type": content_type, + "Host": host, + **signed_headers, + } + if token: + headers["X-Security-Token"] = token + return headers + + async def _agentkit_openapi_post( + *, + region: str, + action: str, + payload: dict[str, Any], + ) -> dict[str, Any]: + endpoint = _agentkit_openapi_endpoint(region) + body = json.dumps(payload, ensure_ascii=False) + headers = _agentkit_openapi_headers( + region=region, + action=action, + body=body, + endpoint=endpoint, + ) + try: + async with httpx.AsyncClient(timeout=30.0) as client: + response = await client.post( + endpoint, + params={"Action": action, "Version": "2025-10-30"}, + headers=headers, + content=body.encode("utf-8"), + ) + except HTTPException: + raise + except httpx.HTTPError as exc: + raise RuntimeError(f"AgentKit OpenAPI request failed: {exc}") from exc + + if response.status_code >= 400: + request_id = "" + try: + metadata = response.json().get("ResponseMetadata") or {} + request_id = metadata.get("RequestId") or "" + except ValueError: + pass + suffix = f" request_id={request_id}" if request_id else "" + raise RuntimeError( + f"AgentKit OpenAPI returned HTTP {response.status_code}{suffix}" + ) + try: + data = response.json() + except ValueError as exc: + raise RuntimeError("AgentKit OpenAPI returned non-JSON response") from exc + error = data.get("ResponseMetadata", {}).get("Error") or data.get("Error") + if error: + code = error.get("Code") if isinstance(error, dict) else str(error) + raise RuntimeError(f"AgentKit OpenAPI returned error: {code}") + return data + + @app.get("/web/a2a-spaces") + async def _web_list_a2a_spaces( + region: str = "cn-beijing", + page_size: int = Query(default=100, ge=1, le=100), + project: str | None = None, + ): + """List all AgentKit A2A Spaces visible to server credentials.""" + try: + _resolve_ve_credentials() + except HTTPException: + raise HTTPException( + status_code=409, + detail="Server Volcengine credentials not configured " + "(set VOLCENGINE_ACCESS_KEY/SECRET_KEY).", + ) + + all_items: list[dict[str, Any]] = [] + total_count = 0 + page = 1 + project_name = (project or "").strip() or None + + try: + while True: + payload: dict[str, Any] = { + "PageNumber": page, + "PageSize": page_size, + } + if project_name: + payload["ProjectName"] = project_name + data = await _agentkit_openapi_post( + region=region, + action="ListA2aSpaces", + payload=payload, + ) + result = data.get("Result") or {} + total_count = int(result.get("TotalCount") or 0) + items = result.get("Items") or [] + item_count = len(items) + for space in items: + if not isinstance(space, dict): + continue + all_items.append( + { + "id": space.get("Id") or "", + "name": space.get("Name") or "", + "intentEnabled": bool(space.get("IntentEnabled")), + "projectName": space.get("ProjectName") or "", + "tags": [ + { + "key": tag.get("Key") or "", + "value": tag.get("Value") or "", + } + for tag in space.get("Tags") or [] + if isinstance(tag, dict) + ], + "isDefault": bool(space.get("IsDefault")), + "region": region, + } + ) + if ( + item_count == 0 + or (total_count > 0 and len(all_items) >= total_count) + or (total_count <= 0 and item_count < page_size) + ): + break + page += 1 + except HTTPException: + raise + except Exception as e: + logger.error(f"ListA2aSpaces error for {region}: {e}", exc_info=True) + raise HTTPException( + status_code=502, + detail="暂时无法加载 AgentKit 智能体中心,请稍后重试。", + ) + + return { + "items": all_items, + "totalCount": total_count or len(all_items), + "page": 1, + "pageSize": page_size, + } + + # SkillSpace routes return SKILL.md (SkillMd) content, not the full TOS zip; + # that keeps the surface small and mirrors how the public Skill Hub picker + # only needs markdown for basic skills. def _skills_client(region: str): """Build an AgentkitSkillsClient using server-side creds, or raise diff --git a/veadk/cli/generated_agent_codegen.py b/veadk/cli/generated_agent_codegen.py index 31a233e9..0adb4848 100644 --- a/veadk/cli/generated_agent_codegen.py +++ b/veadk/cli/generated_agent_codegen.py @@ -348,6 +348,31 @@ def _build_a2a(acc: _Acc, draft: AgentDraft, var_name: str) -> str: return var_name +def _is_registry_backed_a2a(draft: AgentDraft) -> bool: + return draft.agentType == "a2a" and draft.a2aRegistry.enabled + + +def _append_a2a_registry_tools(acc: _Acc, var_name: str) -> tuple[str, str]: + _add_import(acc, "from veadk.a2a.registry_client import registry_config_from_env") + _add_import( + acc, + "from veadk.tools.builtin_tools.a2a_registry import build_a2a_registry_tools", + ) + registry_var = _unique_ident( + acc, + f"a2a_registry_config_{var_name}", + "a2a_registry_config", + ) + tools_var = _unique_ident( + acc, + f"a2a_registry_tools_{var_name}", + "a2a_registry_tools", + ) + acc.pre_lines.append(f"{registry_var} = registry_config_from_env()") + acc.pre_lines.append(f"{tools_var} = build_a2a_registry_tools({registry_var})") + return registry_var, tools_var + + def _build_agent(acc: _Acc, draft: AgentDraft, var_name: str) -> str: if draft.agentType == "a2a": if draft.a2aRegistry.enabled: @@ -420,28 +445,19 @@ def _build_agent(acc: _Acc, draft: AgentDraft, var_name: str) -> str: tool_exprs.append(v) registry_var = "" + registry_source_var = "" if draft.a2aRegistry.enabled: - _add_import( - acc, "from veadk.a2a.registry_client import registry_config_from_env" + registry_source_var = var_name + else: + for idx, sub in enumerate(draft.subAgents): + if _is_registry_backed_a2a(sub): + registry_source_var = f"{var_name}_sub_{idx + 1}" + break + if registry_source_var: + registry_var, registry_tools_var = _append_a2a_registry_tools( + acc, registry_source_var ) - _add_import( - acc, - "from veadk.tools.builtin_tools.a2a_registry import " - "build_a2a_registry_tools", - ) - registry_var = _unique_ident( - acc, - f"a2a_registry_config_{var_name}", - "a2a_registry_config", - ) - tools_var = _unique_ident( - acc, - f"a2a_registry_tools_{var_name}", - "a2a_registry_tools", - ) - acc.pre_lines.append(f"{registry_var} = registry_config_from_env()") - acc.pre_lines.append(f"{tools_var} = build_a2a_registry_tools({registry_var})") - tool_exprs.append(f"*{tools_var}") + tool_exprs.append(f"*{registry_tools_var}") _add_env(acc, A2A_REGISTRY_ENV) for name in draft.tools: @@ -551,6 +567,8 @@ def _build_agent(acc: _Acc, draft: AgentDraft, var_name: str) -> str: sub_vars: list[str] = [] for idx, sub in enumerate(draft.subAgents): + if _is_registry_backed_a2a(sub): + continue child_var = f"{var_name}_sub_{idx + 1}" _build_agent(acc, sub, child_var) sub_vars.append(child_var) @@ -559,7 +577,7 @@ def _build_agent(acc: _Acc, draft: AgentDraft, var_name: str) -> str: joined_kwargs = ",\n ".join(kwargs) acc.pre_lines.append(f"{var_name} = Agent(\n {joined_kwargs},\n)") - if draft.a2aRegistry.enabled: + if registry_var: acc.pre_lines.append( f'setattr({var_name}, "_veadk_a2a_registry_config", {registry_var})' ) diff --git a/veadk/cli/generated_agent_security.py b/veadk/cli/generated_agent_security.py index acfed652..a6a9b5c7 100644 --- a/veadk/cli/generated_agent_security.py +++ b/veadk/cli/generated_agent_security.py @@ -93,7 +93,8 @@ def _validate_node( ) -> int: if depth > MAX_DEPTH: raise DebugPolicyError(f"Agent tree is too deep (>{MAX_DEPTH})") - if not draft.name.strip(): + registry_backed_remote = draft.agentType == "a2a" and draft.a2aRegistry.enabled + if not registry_backed_remote and not draft.name.strip(): raise DebugPolicyError("Agent name is required") _check_len("name", draft.name, MAX_NAME_LEN) _check_len("description", draft.description, MAX_DESCRIPTION_LEN) @@ -102,9 +103,9 @@ def _validate_node( if draft.agentType == "loop" and not (1 <= draft.maxIterations <= MAX_ITERATIONS): raise DebugPolicyError(f"maxIterations must be between 1 and {MAX_ITERATIONS}") if draft.agentType == "a2a": - if not draft.a2aUrl.strip(): + if not registry_backed_remote and not draft.a2aUrl.strip(): raise DebugPolicyError("A2A URL is required") - if not allow_local_runtime_resources: + if not registry_backed_remote and not allow_local_runtime_resources: validate_url_not_private(draft.a2aUrl, field_name="a2aUrl") if draft.a2aRegistry.enabled and not draft.a2aRegistry.registrySpaceId.strip(): raise DebugPolicyError("A2A registry space id is required") diff --git a/veadk/webui/assets/CodeEditor-C7VckftE.js b/veadk/webui/assets/CodeEditor-C8L3YPfR.js similarity index 99% rename from veadk/webui/assets/CodeEditor-C7VckftE.js rename to veadk/webui/assets/CodeEditor-C8L3YPfR.js index 8d4785b1..6332d5c0 100644 --- a/veadk/webui/assets/CodeEditor-C7VckftE.js +++ b/veadk/webui/assets/CodeEditor-C8L3YPfR.js @@ -1,4 +1,4 @@ -import{A as xe,t as sf}from"./index-u-pg5XfV.js";const of=1024;let Zm=0,Le=class{constructor(e,t){this.from=e,this.to=t}};class M{constructor(e={}){this.id=Zm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}M.closedBy=new M({deserialize:i=>i.split(" ")});M.openedBy=new M({deserialize:i=>i.split(" ")});M.group=new M({deserialize:i=>i.split(" ")});M.isolate=new M({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});M.contextHash=new M({perNode:!0});M.lookAhead=new M({perNode:!0});M.mounted=new M({perNode:!0});class Ri{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[M.mounted.id]}}const Am=Object.create(null);class Oe{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Am,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Oe(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(M.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(M.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}}Oe.none=new Oe("",Object.create(null),0,8);class Kn{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|I.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:na(Oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new U(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new U(Oe.none,t,n,r)))}static build(e){return zm(e)}}U.empty=new U(Oe.none,[],[],0);class ta{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ta(this.buffer,this.index)}}class It{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Oe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function vn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=h;e+=t){let c=l[e],O=a[e]+o.from,f;if(!(!(s&I.EnterBracketed&&c instanceof U&&(f=Ri.get(c))&&!f.overlay&&f.bracketed&&n>=O&&n<=O+c.length)&&!lf(r,n,O,O+c.length))){if(c instanceof It){if(s&I.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-O,r);if(u>-1)return new dt(new qm(o,c,e,O),null,u)}else if(s&I.IncludeAnonymous||!c.type.isAnonymous||ia(c)){let u;if(!(s&I.IgnoreMounts)&&(u=Ri.get(c))&&!u.overlay)return new Pe(u.tree,O,e,o);let d=new Pe(c,O,e,o);return s&I.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,r,s)}}}if(s&I.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&I.IgnoreOverlays)&&(r=Ri.get(this._tree))&&r.overlay){let s=e-this.from,o=n&I.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new Pe(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ch(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Go(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class qm{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class dt extends af{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new dt(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&I.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new dt(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new dt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new dt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hf(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let l=new Pe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(vn(l,e,t,!1))}}return r?hf(r):n}class Ur{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~I.EnterBracketed,e instanceof Pe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Pe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&I.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&I.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&I.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&I.IncludeAnonymous||l instanceof It||!l.type.isAnonymous||ia(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Go(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function ia(i){return i.children.some(e=>e instanceof It||!e.type.isAnonymous||ia(e))}function zm(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=of,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new ta(t,t.length):t,a=n.types,h=0,c=0;function O(x,k,$,q,_,B){let{id:z,start:A,end:V,size:E}=l,G=c,oe=h;if(E<0)if(l.next(),E==-1){let me=s[z];$.push(me),q.push(A-x);return}else if(E==-3){h=z;return}else if(E==-4){c=z;return}else throw new RangeError(`Unrecognized record size: ${E}`);let fe=a[z],we,ie,pe=A-x;if(V-A<=r&&(ie=g(l.pos-k,_))){let me=new Uint16Array(ie.size-ie.skip),ve=l.pos-ie.size,Me=me.length;for(;l.pos>ve;)Me=Q(ie.start,me,Me);we=new It(me,V-ie.start,n),pe=ie.start-x}else{let me=l.pos-E;l.next();let ve=[],Me=[],H=z>=o?z:-1,Fe=0,ni=V;for(;l.pos>me;)H>=0&&l.id==H&&l.size>=0?(l.end<=ni-r&&(d(ve,Me,A,Fe,l.end,ni,H,G,oe),Fe=ve.length,ni=l.end),l.next()):B>2500?f(A,me,ve,Me):O(A,me,ve,Me,H,B+1);if(H>=0&&Fe>0&&Fe-1&&Fe>0){let ki=u(fe,oe);we=na(fe,ve,Me,0,ve.length,0,V-A,ki,ki)}else we=m(fe,ve,Me,V-A,G-V,oe)}$.push(we),q.push(pe)}function f(x,k,$,q){let _=[],B=0,z=-1;for(;l.pos>k;){let{id:A,start:V,end:E,size:G}=l;if(G>4)l.next();else{if(z>-1&&V=0;E-=3)A[G++]=_[E],A[G++]=_[E+1]-V,A[G++]=_[E+2]-V,A[G++]=G;$.push(new It(A,_[2]-V,n)),q.push(V-x)}}function u(x,k){return($,q,_)=>{let B=0,z=$.length-1,A,V;if(z>=0&&(A=$[z])instanceof U){if(!z&&A.type==x&&A.length==_)return A;(V=A.prop(M.lookAhead))&&(B=q[z]+A.length+V)}return m(x,$,q,_,B,k)}}function d(x,k,$,q,_,B,z,A,V){let E=[],G=[];for(;x.length>q;)E.push(x.pop()),G.push(k.pop()+$-_);x.push(m(n.types[z],E,G,B-_,A-B,V)),k.push(_-$)}function m(x,k,$,q,_,B,z){if(B){let A=[M.contextHash,B];z=z?[A].concat(z):[A]}if(_>25){let A=[M.lookAhead,_];z=z?[A].concat(z):[A]}return new U(x,k,$,q,z)}function g(x,k){let $=l.fork(),q=0,_=0,B=0,z=$.end-r,A={size:0,start:0,skip:0};e:for(let V=$.pos-x;$.pos>V;){let E=$.size;if($.id==k&&E>=0){A.size=q,A.start=_,A.skip=B,B+=4,q+=4,$.next();continue}let G=$.pos-E;if(E<0||G=o?4:0,fe=$.start;for($.next();$.pos>G;){if($.size<0)if($.size==-3||$.size==-4)oe+=4;else break e;else $.id>=o&&(oe+=4);$.next()}_=fe,q+=E,B+=oe}return(k<0||q==x)&&(A.size=q,A.start=_,A.skip=B),A.size>4?A:void 0}function Q(x,k,$){let{id:q,start:_,end:B,size:z}=l;if(l.next(),z>=0&&q4){let V=l.pos-(z-4);for(;l.pos>V;)$=Q(x,k,$)}k[--$]=A,k[--$]=B-x,k[--$]=_-x,k[--$]=q}else z==-3?h=q:z==-4&&(c=q);return $}let S=[],y=[];for(;l.pos>0;)O(i.start||0,i.bufferStart||0,S,y,-1,0);let w=(e=i.length)!==null&&e!==void 0?e:S.length?y[0]+S[0].length:0;return new U(a[i.topID],S.reverse(),y.reverse(),w)}const Oh=new WeakMap;function Wr(i,e){if(!i.isAnonymous||e instanceof It||e.type!=i)return 1;let t=Oh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof U)){t=1;break}t+=Wr(i,n)}Oh.set(e,t)}return t}function na(i,e,t,n,r,s,o,l,a){let h=0;for(let d=n;d=c)break;k+=$}if(y==w+1){if(k>c){let $=d[w];u($.children,$.positions,0,$.children.length,m[w]+S);continue}O.push(d[w])}else{let $=m[y-1]+d[y-1].length-x;O.push(na(i,d,m,w,y,x,$,null,a))}f.push(x+S-s)}}return u(e,t,n,r,0),(l||a)(O,f,o)}class ra{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof dt?this.setBuffer(e.context.buffer,e.index,t):e instanceof Pe&&this.map.set(e.tree,t)}get(e){return e instanceof dt?this.getBuffer(e.context.buffer,e.index):e instanceof Pe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xt{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new Xt(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=n)for(;o&&o.from=f.from||O<=f.to||h){let u=Math.max(f.from,a)-h,d=Math.min(f.to,O)-h;f=u>=d?null:new Xt(u,d,f.tree,f.offset+h,l>0,!!c)}if(f&&r.push(f),o.to>O)break;o=snew Le(r.from,r.to)):[new Le(0,0)]:[new Le(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}}class _m{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function cf(i){return(e,t,n,r)=>new jm(e,i,t,n,r)}class fh{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function uh(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class Em{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Io=new M({perNode:!0});class jm{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new U(n.type,n.children,n.positions,n.length,n.propValues.concat([[Io,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[M.mounted.id]=new Ri(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let O=c.from+h.pos,f=c.to+h.pos;O>=r.from&&f<=r.to&&!t.ranges.some(u=>u.fromO)&&t.ranges.push({from:O,to:f})}}l=!1}else if(n&&(o=Vm(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Le(O.from-r.from,O.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new Le(r.from,r.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=mh(this.ranges,t.ranges);h.length&&(uh(h),this.inner.splice(t.index,0,new fh(t.parser,t.parser.startParse(this.input,gh(t.mounts,h),h),t.ranges.map(c=>new Le(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function Vm(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function dh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,I.IgnoreOverlays|I.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}let Lm=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Io))!==null&&t!==void 0?t:n.to,this.inner=new ph(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Io))!==null&&e!==void 0?e:t.to,this.inner=new ph(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(M.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function mh(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new Le(l,a.to))):a.to>l?t[s--]=new Le(l,a.to):t.splice(s--,1))}}return n}function Dm(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==i.length?1e9:o?i[r].to:i[r].from,O=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,t),u=Math.min(c,O,n);fnew Le(f.from+n,f.to+n)),O=Dm(e,c,a,h);for(let f=0,u=a;;f++){let d=f==O.length,m=d?h:O[f].from;if(m>u&&t.push(new Xt(u,m,r.tree,-o,s.from>=u||s.openStart,s.to<=m||s.openEnd)),d)break;u=O[f].to}}else t.push(new Xt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var Qh={};class Nr{constructor(e,t,n,r,s,o,l,a,h,c=0,O){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new Nr(e,[],t,n,n,0,[],0,r?new Sh(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==n)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Nr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Bm(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}}class Sh{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Bm{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Fr{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fr(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fr(this.stack,this.pos,this.index)}}function un(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Mr{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const bh=new Mr;class Gm{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=bh,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=bh,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class Zi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Of(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Zi.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class Hr{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?un(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(Of(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Hr.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class ae{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Of(i,e,t,n,r,s){let o=0,l=1<0){let d=i[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||Im(d,e.token.value,r,s))){e.acceptToken(d);break}}let c=e.next,O=0,f=i[o+2];if(e.next<0&&f>O&&i[h+f*3-3]==65535){o=i[h+f*3-1];continue e}for(;O>1,d=h+u+(u<<1),m=i[d],g=i[d+1]||65536;if(c=g)O=u+1;else{o=i[d+2],e.advance();continue e}}break}}function yh(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function Im(i,e,t,n){let r=yh(t,n,e);return r<0||yh(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}let Um=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?xh(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xh(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof U){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};class Nm{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Mr)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let f=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!c.extend&&(n=O,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new Mr,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Mr,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Um(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&Km(r);if(o)return ze&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw ze&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return ze&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let f=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(f>-1&&O.length&&(!h||(O.prop(M.contextHash)||0)==c))return e.useNode(O,f),ze&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof U)||O.children.length==0||O.positions[0]>0)break;let u=O.children[0];if(u instanceof U&&O.positions[0]==0)O=u;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),ze&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hr?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return kh(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),ze&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let O=l.split(),f=c;for(let u=0;u<10&&O.forceReduce()&&(ze&&console.log(f+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,n));u++)ze&&(f=this.stackID(O)+" -> ");for(let u of l.recoverByInsert(a))ze&&console.log(c+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),ze&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),kh(l,n)):(!r||r.scorei;class Ts{constructor(e){this.start=e.start,this.shift=e.shift||Us,this.reduce=e.reduce||Us,this.reuse=e.reuse||Us,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Rt extends sa{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[h++]);else{let O=l[h+-c];for(let f=-c;f>0;f--)s(l[h++],a,O);h++}}}this.nodeSet=new Kn(t.map((l,a)=>Oe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=of;let o=un(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Zi(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Fm(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vt(this.data,s+2);else break;r=t(vt(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(Rt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Ph(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}let Jm=0,ct=class Uo{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Jm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Uo&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Uo(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Kr(e);return n=>n.modified.indexOf(t)>-1?n:Kr.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},eg=0;class Kr{constructor(e){this.name=e,this.instances=[],this.id=eg++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&tg(t,l.modified));if(n)return n;let r=[],s=new ct(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=ig(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Kr.get(l,a));return s}}function tg(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function ig(i){let e=[[]];for(let t=0;tn.length-t.length)}function zt(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let O=0;;){if(l=="..."&&O>0&&O+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),O+=f[0].length,O==r.length)break;let u=r[O++];if(O==r.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+r);l=r.slice(O)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+r);let c=new Tn(n,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return ff.add(e)}const ff=new M({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Tn(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}});class Tn{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function ng(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function rg(i,e,t,n=0,r=i.length){let s=new sg(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}class sg{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(u=>!u.scope||u.scope(o)));let h=r,c=og(e)||Tn.empty,O=ng(s,c.tags);if(O&&(h&&(h+=" "),h+=O,c.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,l),h),c.opaque)return;let f=e.tree&&e.tree.prop(M.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),d=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,Q=l;;g++){let S=g=y||!e.nextSibling())););if(!S||y>n)break;Q=S.to+l,Q>t&&(this.highlightRange(u.cursor(),Math.max(t,S.from+l),Math.min(n,Q),"",d),this.startSpan(Math.min(n,Q),h))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function og(i){let e=i.type.prop(ff);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const T=ct.define,cr=T(),Vt=T(),$h=T(Vt),wh=T(Vt),Yt=T(),Or=T(Yt),Ns=T(Yt),ht=T(),oi=T(ht),ot=T(),lt=T(),No=T(),sn=T(No),fr=T(),p={comment:cr,lineComment:T(cr),blockComment:T(cr),docComment:T(cr),name:Vt,variableName:T(Vt),typeName:$h,tagName:T($h),propertyName:wh,attributeName:T(wh),className:T(Vt),labelName:T(Vt),namespace:T(Vt),macroName:T(Vt),literal:Yt,string:Or,docString:T(Or),character:T(Or),attributeValue:T(Or),number:Ns,integer:T(Ns),float:T(Ns),bool:T(Yt),regexp:T(Yt),escape:T(Yt),color:T(Yt),url:T(Yt),keyword:ot,self:T(ot),null:T(ot),atom:T(ot),unit:T(ot),modifier:T(ot),operatorKeyword:T(ot),controlKeyword:T(ot),definitionKeyword:T(ot),moduleKeyword:T(ot),operator:lt,derefOperator:T(lt),arithmeticOperator:T(lt),logicOperator:T(lt),bitwiseOperator:T(lt),compareOperator:T(lt),updateOperator:T(lt),definitionOperator:T(lt),typeOperator:T(lt),controlOperator:T(lt),punctuation:No,separator:T(No),bracket:sn,angleBracket:T(sn),squareBracket:T(sn),paren:T(sn),brace:T(sn),content:ht,heading:oi,heading1:T(oi),heading2:T(oi),heading3:T(oi),heading4:T(oi),heading5:T(oi),heading6:T(oi),contentSeparator:T(ht),list:T(ht),quote:T(ht),emphasis:T(ht),strong:T(ht),link:T(ht),monospace:T(ht),strikethrough:T(ht),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:fr,documentMeta:T(fr),annotation:T(fr),processingInstruction:T(fr),definition:ct.defineModifier("definition"),constant:ct.defineModifier("constant"),function:ct.defineModifier("function"),standard:ct.defineModifier("standard"),local:ct.defineModifier("local"),special:ct.defineModifier("special")};for(let i in p){let e=p[i];e instanceof ct&&(e.name=i)}uf([{tag:p.link,class:"tok-link"},{tag:p.heading,class:"tok-heading"},{tag:p.emphasis,class:"tok-emphasis"},{tag:p.strong,class:"tok-strong"},{tag:p.keyword,class:"tok-keyword"},{tag:p.atom,class:"tok-atom"},{tag:p.bool,class:"tok-bool"},{tag:p.url,class:"tok-url"},{tag:p.labelName,class:"tok-labelName"},{tag:p.inserted,class:"tok-inserted"},{tag:p.deleted,class:"tok-deleted"},{tag:p.literal,class:"tok-literal"},{tag:p.string,class:"tok-string"},{tag:p.number,class:"tok-number"},{tag:[p.regexp,p.escape,p.special(p.string)],class:"tok-string2"},{tag:p.variableName,class:"tok-variableName"},{tag:p.local(p.variableName),class:"tok-variableName tok-local"},{tag:p.definition(p.variableName),class:"tok-variableName tok-definition"},{tag:p.special(p.variableName),class:"tok-variableName2"},{tag:p.definition(p.propertyName),class:"tok-propertyName tok-definition"},{tag:p.typeName,class:"tok-typeName"},{tag:p.namespace,class:"tok-namespace"},{tag:p.className,class:"tok-className"},{tag:p.macroName,class:"tok-macroName"},{tag:p.propertyName,class:"tok-propertyName"},{tag:p.operator,class:"tok-operator"},{tag:p.comment,class:"tok-comment"},{tag:p.meta,class:"tok-meta"},{tag:p.invalid,class:"tok-invalid"},{tag:p.punctuation,class:"tok-punctuation"}]);const lg=316,ag=317,vh=1,hg=2,cg=3,Og=4,fg=318,ug=320,dg=321,pg=5,mg=6,gg=0,Fo=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],df=125,Qg=59,Ho=47,Sg=42,bg=43,yg=45,xg=60,kg=44,Pg=63,$g=46,wg=91,vg=new Ts({start:!1,shift(i,e){return e==pg||e==mg||e==ug?i:e==dg},strict:!1}),Tg=new ae((i,e)=>{let{next:t}=i;(t==df||t==-1||e.context)&&i.acceptToken(fg)},{contextual:!0,fallback:!0}),Xg=new ae((i,e)=>{let{next:t}=i,n;Fo.indexOf(t)>-1||t==Ho&&((n=i.peek(1))==Ho||n==Sg)||t!=df&&t!=Qg&&t!=-1&&!e.context&&i.acceptToken(lg)},{contextual:!0}),Cg=new ae((i,e)=>{i.next==wg&&!e.context&&i.acceptToken(ag)},{contextual:!0}),Rg=new ae((i,e)=>{let{next:t}=i;if(t==bg||t==yg){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(vh);i.acceptToken(n?vh:hg)}}else t==Pg&&i.peek(1)==$g&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(cg))},{contextual:!0});function Fs(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const Zg=new ae((i,e)=>{if(i.next!=xg||!e.dialectEnabled(gg)||(i.advance(),i.next==Ho))return;let t=0;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(Fs(i.next,!0)){for(i.advance(),t++;Fs(i.next,!1);)i.advance(),t++;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==kg)return;for(let n=0;;n++){if(n==7){if(!Fs(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Og,-t)}),Ag=zt({"get set async static":p.modifier,"for while do if else switch try catch finally return throw break continue default case defer":p.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":p.operatorKeyword,"let var const using function class extends":p.definitionKeyword,"import export from":p.moduleKeyword,"with debugger new":p.keyword,TemplateString:p.special(p.string),super:p.atom,BooleanLiteral:p.bool,this:p.self,null:p.null,Star:p.modifier,VariableName:p.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":p.function(p.variableName),VariableDefinition:p.definition(p.variableName),Label:p.labelName,PropertyName:p.propertyName,PrivatePropertyName:p.special(p.propertyName),"CallExpression/MemberExpression/PropertyName":p.function(p.propertyName),"FunctionDeclaration/VariableDefinition":p.function(p.definition(p.variableName)),"ClassDeclaration/VariableDefinition":p.definition(p.className),"NewExpression/VariableName":p.className,PropertyDefinition:p.definition(p.propertyName),PrivatePropertyDefinition:p.definition(p.special(p.propertyName)),UpdateOp:p.updateOperator,"LineComment Hashbang":p.lineComment,BlockComment:p.blockComment,Number:p.number,String:p.string,Escape:p.escape,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,RegExp:p.regexp,Equals:p.definitionOperator,Arrow:p.function(p.punctuation),": Spread":p.punctuation,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace,"InterpolationStart InterpolationEnd":p.special(p.brace),".":p.derefOperator,", ;":p.separator,"@":p.meta,TypeName:p.typeName,TypeDefinition:p.definition(p.typeName),"type enum interface implements namespace module declare":p.definitionKeyword,"abstract global Privacy readonly override":p.modifier,"is keyof unique infer asserts":p.operatorKeyword,JSXAttributeValue:p.attributeValue,JSXText:p.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":p.angleBracket,"JSXIdentifier JSXNameSpacedName":p.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":p.attributeName,"JSXBuiltin/JSXIdentifier":p.standard(p.tagName)}),qg={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Wg={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Mg={__proto__:null,"<":193},zg=Rt.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:vg,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Ag],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Xg,Cg,Rg,Zg,2,3,4,5,6,7,8,9,10,11,12,13,14,Tg,new Hr("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Hr("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:i=>qg[i]||-1},{term:343,get:i=>Wg[i]||-1},{term:95,get:i=>Mg[i]||-1}],tokenPrec:15201});let Ko=[],pf=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=pf[n])e=n+1;else return!0;if(e==t)return!1}}function Th(i){return i>=127462&&i<=127487}const Xh=8205;function Eg(i,e,t=!0,n=!0){return(t?mf:jg)(i,e,n)}function mf(i,e,t){if(e==i.length)return e;e&&gf(i.charCodeAt(e))&&Qf(i.charCodeAt(e-1))&&e--;let n=Hs(i,e);for(e+=Ch(n);e=0&&Th(Hs(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function jg(i,e,t){for(;e>1;){let n=mf(i,e-2,t);if(n=56320&&i<57344}function Qf(i){return i>=55296&&i<56320}function Ch(i){return i<65536?1:2}class D{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Vi(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ot.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vi(this,e,t);let n=[];return this.decompose(e,t,n,0),Ot.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new gn(this),s=new gn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new gn(this,e)}iterRange(e,t=this.length){return new Sf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?D.empty:e.length<=32?new le(e):Ot.from(le.split(e,[]))}}class le extends D{constructor(e,t=Vg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new Yg(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new le(Rh(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=zr(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new le(l,o.length+s.length));else{let a=l.length>>1;n.push(new le(l.slice(0,a)),new le(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof le))return super.replace(e,t,n);[e,t]=Vi(this,e,t);let r=zr(this.text,zr(n.text,Rh(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new le(r,s):Ot.from(le.split(r,[]),s)}sliceString(e,t=this.length,n=` +import{A as xe,t as sf}from"./index-gtSqVSNF.js";const of=1024;let Zm=0,Le=class{constructor(e,t){this.from=e,this.to=t}};class M{constructor(e={}){this.id=Zm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}M.closedBy=new M({deserialize:i=>i.split(" ")});M.openedBy=new M({deserialize:i=>i.split(" ")});M.group=new M({deserialize:i=>i.split(" ")});M.isolate=new M({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});M.contextHash=new M({perNode:!0});M.lookAhead=new M({perNode:!0});M.mounted=new M({perNode:!0});class Ri{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[M.mounted.id]}}const Am=Object.create(null);class Oe{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Am,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Oe(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(M.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(M.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}}Oe.none=new Oe("",Object.create(null),0,8);class Kn{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|I.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:na(Oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new U(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new U(Oe.none,t,n,r)))}static build(e){return zm(e)}}U.empty=new U(Oe.none,[],[],0);class ta{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ta(this.buffer,this.index)}}class It{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Oe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function vn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=h;e+=t){let c=l[e],O=a[e]+o.from,f;if(!(!(s&I.EnterBracketed&&c instanceof U&&(f=Ri.get(c))&&!f.overlay&&f.bracketed&&n>=O&&n<=O+c.length)&&!lf(r,n,O,O+c.length))){if(c instanceof It){if(s&I.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-O,r);if(u>-1)return new dt(new qm(o,c,e,O),null,u)}else if(s&I.IncludeAnonymous||!c.type.isAnonymous||ia(c)){let u;if(!(s&I.IgnoreMounts)&&(u=Ri.get(c))&&!u.overlay)return new Pe(u.tree,O,e,o);let d=new Pe(c,O,e,o);return s&I.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,r,s)}}}if(s&I.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&I.IgnoreOverlays)&&(r=Ri.get(this._tree))&&r.overlay){let s=e-this.from,o=n&I.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new Pe(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ch(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Go(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class qm{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class dt extends af{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new dt(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&I.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new dt(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new dt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new dt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hf(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let l=new Pe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(vn(l,e,t,!1))}}return r?hf(r):n}class Ur{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~I.EnterBracketed,e instanceof Pe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Pe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&I.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&I.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&I.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&I.IncludeAnonymous||l instanceof It||!l.type.isAnonymous||ia(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Go(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function ia(i){return i.children.some(e=>e instanceof It||!e.type.isAnonymous||ia(e))}function zm(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=of,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new ta(t,t.length):t,a=n.types,h=0,c=0;function O(x,k,$,q,_,B){let{id:z,start:A,end:V,size:E}=l,G=c,oe=h;if(E<0)if(l.next(),E==-1){let me=s[z];$.push(me),q.push(A-x);return}else if(E==-3){h=z;return}else if(E==-4){c=z;return}else throw new RangeError(`Unrecognized record size: ${E}`);let fe=a[z],we,ie,pe=A-x;if(V-A<=r&&(ie=g(l.pos-k,_))){let me=new Uint16Array(ie.size-ie.skip),ve=l.pos-ie.size,Me=me.length;for(;l.pos>ve;)Me=Q(ie.start,me,Me);we=new It(me,V-ie.start,n),pe=ie.start-x}else{let me=l.pos-E;l.next();let ve=[],Me=[],H=z>=o?z:-1,Fe=0,ni=V;for(;l.pos>me;)H>=0&&l.id==H&&l.size>=0?(l.end<=ni-r&&(d(ve,Me,A,Fe,l.end,ni,H,G,oe),Fe=ve.length,ni=l.end),l.next()):B>2500?f(A,me,ve,Me):O(A,me,ve,Me,H,B+1);if(H>=0&&Fe>0&&Fe-1&&Fe>0){let ki=u(fe,oe);we=na(fe,ve,Me,0,ve.length,0,V-A,ki,ki)}else we=m(fe,ve,Me,V-A,G-V,oe)}$.push(we),q.push(pe)}function f(x,k,$,q){let _=[],B=0,z=-1;for(;l.pos>k;){let{id:A,start:V,end:E,size:G}=l;if(G>4)l.next();else{if(z>-1&&V=0;E-=3)A[G++]=_[E],A[G++]=_[E+1]-V,A[G++]=_[E+2]-V,A[G++]=G;$.push(new It(A,_[2]-V,n)),q.push(V-x)}}function u(x,k){return($,q,_)=>{let B=0,z=$.length-1,A,V;if(z>=0&&(A=$[z])instanceof U){if(!z&&A.type==x&&A.length==_)return A;(V=A.prop(M.lookAhead))&&(B=q[z]+A.length+V)}return m(x,$,q,_,B,k)}}function d(x,k,$,q,_,B,z,A,V){let E=[],G=[];for(;x.length>q;)E.push(x.pop()),G.push(k.pop()+$-_);x.push(m(n.types[z],E,G,B-_,A-B,V)),k.push(_-$)}function m(x,k,$,q,_,B,z){if(B){let A=[M.contextHash,B];z=z?[A].concat(z):[A]}if(_>25){let A=[M.lookAhead,_];z=z?[A].concat(z):[A]}return new U(x,k,$,q,z)}function g(x,k){let $=l.fork(),q=0,_=0,B=0,z=$.end-r,A={size:0,start:0,skip:0};e:for(let V=$.pos-x;$.pos>V;){let E=$.size;if($.id==k&&E>=0){A.size=q,A.start=_,A.skip=B,B+=4,q+=4,$.next();continue}let G=$.pos-E;if(E<0||G=o?4:0,fe=$.start;for($.next();$.pos>G;){if($.size<0)if($.size==-3||$.size==-4)oe+=4;else break e;else $.id>=o&&(oe+=4);$.next()}_=fe,q+=E,B+=oe}return(k<0||q==x)&&(A.size=q,A.start=_,A.skip=B),A.size>4?A:void 0}function Q(x,k,$){let{id:q,start:_,end:B,size:z}=l;if(l.next(),z>=0&&q4){let V=l.pos-(z-4);for(;l.pos>V;)$=Q(x,k,$)}k[--$]=A,k[--$]=B-x,k[--$]=_-x,k[--$]=q}else z==-3?h=q:z==-4&&(c=q);return $}let S=[],y=[];for(;l.pos>0;)O(i.start||0,i.bufferStart||0,S,y,-1,0);let w=(e=i.length)!==null&&e!==void 0?e:S.length?y[0]+S[0].length:0;return new U(a[i.topID],S.reverse(),y.reverse(),w)}const Oh=new WeakMap;function Wr(i,e){if(!i.isAnonymous||e instanceof It||e.type!=i)return 1;let t=Oh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof U)){t=1;break}t+=Wr(i,n)}Oh.set(e,t)}return t}function na(i,e,t,n,r,s,o,l,a){let h=0;for(let d=n;d=c)break;k+=$}if(y==w+1){if(k>c){let $=d[w];u($.children,$.positions,0,$.children.length,m[w]+S);continue}O.push(d[w])}else{let $=m[y-1]+d[y-1].length-x;O.push(na(i,d,m,w,y,x,$,null,a))}f.push(x+S-s)}}return u(e,t,n,r,0),(l||a)(O,f,o)}class ra{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof dt?this.setBuffer(e.context.buffer,e.index,t):e instanceof Pe&&this.map.set(e.tree,t)}get(e){return e instanceof dt?this.getBuffer(e.context.buffer,e.index):e instanceof Pe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xt{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new Xt(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=n)for(;o&&o.from=f.from||O<=f.to||h){let u=Math.max(f.from,a)-h,d=Math.min(f.to,O)-h;f=u>=d?null:new Xt(u,d,f.tree,f.offset+h,l>0,!!c)}if(f&&r.push(f),o.to>O)break;o=snew Le(r.from,r.to)):[new Le(0,0)]:[new Le(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}}class _m{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function cf(i){return(e,t,n,r)=>new jm(e,i,t,n,r)}class fh{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function uh(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class Em{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Io=new M({perNode:!0});class jm{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new U(n.type,n.children,n.positions,n.length,n.propValues.concat([[Io,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[M.mounted.id]=new Ri(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let O=c.from+h.pos,f=c.to+h.pos;O>=r.from&&f<=r.to&&!t.ranges.some(u=>u.fromO)&&t.ranges.push({from:O,to:f})}}l=!1}else if(n&&(o=Vm(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Le(O.from-r.from,O.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new Le(r.from,r.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=mh(this.ranges,t.ranges);h.length&&(uh(h),this.inner.splice(t.index,0,new fh(t.parser,t.parser.startParse(this.input,gh(t.mounts,h),h),t.ranges.map(c=>new Le(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function Vm(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function dh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,I.IgnoreOverlays|I.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}let Lm=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Io))!==null&&t!==void 0?t:n.to,this.inner=new ph(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Io))!==null&&e!==void 0?e:t.to,this.inner=new ph(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(M.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function mh(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new Le(l,a.to))):a.to>l?t[s--]=new Le(l,a.to):t.splice(s--,1))}}return n}function Dm(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==i.length?1e9:o?i[r].to:i[r].from,O=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,t),u=Math.min(c,O,n);fnew Le(f.from+n,f.to+n)),O=Dm(e,c,a,h);for(let f=0,u=a;;f++){let d=f==O.length,m=d?h:O[f].from;if(m>u&&t.push(new Xt(u,m,r.tree,-o,s.from>=u||s.openStart,s.to<=m||s.openEnd)),d)break;u=O[f].to}}else t.push(new Xt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var Qh={};class Nr{constructor(e,t,n,r,s,o,l,a,h,c=0,O){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new Nr(e,[],t,n,n,0,[],0,r?new Sh(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==n)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Nr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Bm(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}}class Sh{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Bm{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Fr{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fr(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fr(this.stack,this.pos,this.index)}}function un(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Mr{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const bh=new Mr;class Gm{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=bh,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=bh,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class Zi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Of(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Zi.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class Hr{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?un(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(Of(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Hr.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class ae{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Of(i,e,t,n,r,s){let o=0,l=1<0){let d=i[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||Im(d,e.token.value,r,s))){e.acceptToken(d);break}}let c=e.next,O=0,f=i[o+2];if(e.next<0&&f>O&&i[h+f*3-3]==65535){o=i[h+f*3-1];continue e}for(;O>1,d=h+u+(u<<1),m=i[d],g=i[d+1]||65536;if(c=g)O=u+1;else{o=i[d+2],e.advance();continue e}}break}}function yh(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function Im(i,e,t,n){let r=yh(t,n,e);return r<0||yh(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}let Um=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?xh(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xh(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof U){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};class Nm{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Mr)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let f=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!c.extend&&(n=O,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new Mr,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Mr,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Um(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&Km(r);if(o)return ze&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw ze&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return ze&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let f=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(f>-1&&O.length&&(!h||(O.prop(M.contextHash)||0)==c))return e.useNode(O,f),ze&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof U)||O.children.length==0||O.positions[0]>0)break;let u=O.children[0];if(u instanceof U&&O.positions[0]==0)O=u;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),ze&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hr?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return kh(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),ze&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let O=l.split(),f=c;for(let u=0;u<10&&O.forceReduce()&&(ze&&console.log(f+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,n));u++)ze&&(f=this.stackID(O)+" -> ");for(let u of l.recoverByInsert(a))ze&&console.log(c+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),ze&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),kh(l,n)):(!r||r.scorei;class Ts{constructor(e){this.start=e.start,this.shift=e.shift||Us,this.reduce=e.reduce||Us,this.reuse=e.reuse||Us,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Rt extends sa{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[h++]);else{let O=l[h+-c];for(let f=-c;f>0;f--)s(l[h++],a,O);h++}}}this.nodeSet=new Kn(t.map((l,a)=>Oe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=of;let o=un(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Zi(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Fm(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vt(this.data,s+2);else break;r=t(vt(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(Rt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Ph(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}let Jm=0,ct=class Uo{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Jm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Uo&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Uo(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Kr(e);return n=>n.modified.indexOf(t)>-1?n:Kr.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},eg=0;class Kr{constructor(e){this.name=e,this.instances=[],this.id=eg++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&tg(t,l.modified));if(n)return n;let r=[],s=new ct(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=ig(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Kr.get(l,a));return s}}function tg(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function ig(i){let e=[[]];for(let t=0;tn.length-t.length)}function zt(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let O=0;;){if(l=="..."&&O>0&&O+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),O+=f[0].length,O==r.length)break;let u=r[O++];if(O==r.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+r);l=r.slice(O)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+r);let c=new Tn(n,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return ff.add(e)}const ff=new M({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Tn(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}});class Tn{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function ng(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function rg(i,e,t,n=0,r=i.length){let s=new sg(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}class sg{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(u=>!u.scope||u.scope(o)));let h=r,c=og(e)||Tn.empty,O=ng(s,c.tags);if(O&&(h&&(h+=" "),h+=O,c.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,l),h),c.opaque)return;let f=e.tree&&e.tree.prop(M.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),d=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,Q=l;;g++){let S=g=y||!e.nextSibling())););if(!S||y>n)break;Q=S.to+l,Q>t&&(this.highlightRange(u.cursor(),Math.max(t,S.from+l),Math.min(n,Q),"",d),this.startSpan(Math.min(n,Q),h))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function og(i){let e=i.type.prop(ff);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const T=ct.define,cr=T(),Vt=T(),$h=T(Vt),wh=T(Vt),Yt=T(),Or=T(Yt),Ns=T(Yt),ht=T(),oi=T(ht),ot=T(),lt=T(),No=T(),sn=T(No),fr=T(),p={comment:cr,lineComment:T(cr),blockComment:T(cr),docComment:T(cr),name:Vt,variableName:T(Vt),typeName:$h,tagName:T($h),propertyName:wh,attributeName:T(wh),className:T(Vt),labelName:T(Vt),namespace:T(Vt),macroName:T(Vt),literal:Yt,string:Or,docString:T(Or),character:T(Or),attributeValue:T(Or),number:Ns,integer:T(Ns),float:T(Ns),bool:T(Yt),regexp:T(Yt),escape:T(Yt),color:T(Yt),url:T(Yt),keyword:ot,self:T(ot),null:T(ot),atom:T(ot),unit:T(ot),modifier:T(ot),operatorKeyword:T(ot),controlKeyword:T(ot),definitionKeyword:T(ot),moduleKeyword:T(ot),operator:lt,derefOperator:T(lt),arithmeticOperator:T(lt),logicOperator:T(lt),bitwiseOperator:T(lt),compareOperator:T(lt),updateOperator:T(lt),definitionOperator:T(lt),typeOperator:T(lt),controlOperator:T(lt),punctuation:No,separator:T(No),bracket:sn,angleBracket:T(sn),squareBracket:T(sn),paren:T(sn),brace:T(sn),content:ht,heading:oi,heading1:T(oi),heading2:T(oi),heading3:T(oi),heading4:T(oi),heading5:T(oi),heading6:T(oi),contentSeparator:T(ht),list:T(ht),quote:T(ht),emphasis:T(ht),strong:T(ht),link:T(ht),monospace:T(ht),strikethrough:T(ht),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:fr,documentMeta:T(fr),annotation:T(fr),processingInstruction:T(fr),definition:ct.defineModifier("definition"),constant:ct.defineModifier("constant"),function:ct.defineModifier("function"),standard:ct.defineModifier("standard"),local:ct.defineModifier("local"),special:ct.defineModifier("special")};for(let i in p){let e=p[i];e instanceof ct&&(e.name=i)}uf([{tag:p.link,class:"tok-link"},{tag:p.heading,class:"tok-heading"},{tag:p.emphasis,class:"tok-emphasis"},{tag:p.strong,class:"tok-strong"},{tag:p.keyword,class:"tok-keyword"},{tag:p.atom,class:"tok-atom"},{tag:p.bool,class:"tok-bool"},{tag:p.url,class:"tok-url"},{tag:p.labelName,class:"tok-labelName"},{tag:p.inserted,class:"tok-inserted"},{tag:p.deleted,class:"tok-deleted"},{tag:p.literal,class:"tok-literal"},{tag:p.string,class:"tok-string"},{tag:p.number,class:"tok-number"},{tag:[p.regexp,p.escape,p.special(p.string)],class:"tok-string2"},{tag:p.variableName,class:"tok-variableName"},{tag:p.local(p.variableName),class:"tok-variableName tok-local"},{tag:p.definition(p.variableName),class:"tok-variableName tok-definition"},{tag:p.special(p.variableName),class:"tok-variableName2"},{tag:p.definition(p.propertyName),class:"tok-propertyName tok-definition"},{tag:p.typeName,class:"tok-typeName"},{tag:p.namespace,class:"tok-namespace"},{tag:p.className,class:"tok-className"},{tag:p.macroName,class:"tok-macroName"},{tag:p.propertyName,class:"tok-propertyName"},{tag:p.operator,class:"tok-operator"},{tag:p.comment,class:"tok-comment"},{tag:p.meta,class:"tok-meta"},{tag:p.invalid,class:"tok-invalid"},{tag:p.punctuation,class:"tok-punctuation"}]);const lg=316,ag=317,vh=1,hg=2,cg=3,Og=4,fg=318,ug=320,dg=321,pg=5,mg=6,gg=0,Fo=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],df=125,Qg=59,Ho=47,Sg=42,bg=43,yg=45,xg=60,kg=44,Pg=63,$g=46,wg=91,vg=new Ts({start:!1,shift(i,e){return e==pg||e==mg||e==ug?i:e==dg},strict:!1}),Tg=new ae((i,e)=>{let{next:t}=i;(t==df||t==-1||e.context)&&i.acceptToken(fg)},{contextual:!0,fallback:!0}),Xg=new ae((i,e)=>{let{next:t}=i,n;Fo.indexOf(t)>-1||t==Ho&&((n=i.peek(1))==Ho||n==Sg)||t!=df&&t!=Qg&&t!=-1&&!e.context&&i.acceptToken(lg)},{contextual:!0}),Cg=new ae((i,e)=>{i.next==wg&&!e.context&&i.acceptToken(ag)},{contextual:!0}),Rg=new ae((i,e)=>{let{next:t}=i;if(t==bg||t==yg){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(vh);i.acceptToken(n?vh:hg)}}else t==Pg&&i.peek(1)==$g&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(cg))},{contextual:!0});function Fs(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const Zg=new ae((i,e)=>{if(i.next!=xg||!e.dialectEnabled(gg)||(i.advance(),i.next==Ho))return;let t=0;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(Fs(i.next,!0)){for(i.advance(),t++;Fs(i.next,!1);)i.advance(),t++;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==kg)return;for(let n=0;;n++){if(n==7){if(!Fs(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Og,-t)}),Ag=zt({"get set async static":p.modifier,"for while do if else switch try catch finally return throw break continue default case defer":p.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":p.operatorKeyword,"let var const using function class extends":p.definitionKeyword,"import export from":p.moduleKeyword,"with debugger new":p.keyword,TemplateString:p.special(p.string),super:p.atom,BooleanLiteral:p.bool,this:p.self,null:p.null,Star:p.modifier,VariableName:p.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":p.function(p.variableName),VariableDefinition:p.definition(p.variableName),Label:p.labelName,PropertyName:p.propertyName,PrivatePropertyName:p.special(p.propertyName),"CallExpression/MemberExpression/PropertyName":p.function(p.propertyName),"FunctionDeclaration/VariableDefinition":p.function(p.definition(p.variableName)),"ClassDeclaration/VariableDefinition":p.definition(p.className),"NewExpression/VariableName":p.className,PropertyDefinition:p.definition(p.propertyName),PrivatePropertyDefinition:p.definition(p.special(p.propertyName)),UpdateOp:p.updateOperator,"LineComment Hashbang":p.lineComment,BlockComment:p.blockComment,Number:p.number,String:p.string,Escape:p.escape,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,RegExp:p.regexp,Equals:p.definitionOperator,Arrow:p.function(p.punctuation),": Spread":p.punctuation,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace,"InterpolationStart InterpolationEnd":p.special(p.brace),".":p.derefOperator,", ;":p.separator,"@":p.meta,TypeName:p.typeName,TypeDefinition:p.definition(p.typeName),"type enum interface implements namespace module declare":p.definitionKeyword,"abstract global Privacy readonly override":p.modifier,"is keyof unique infer asserts":p.operatorKeyword,JSXAttributeValue:p.attributeValue,JSXText:p.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":p.angleBracket,"JSXIdentifier JSXNameSpacedName":p.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":p.attributeName,"JSXBuiltin/JSXIdentifier":p.standard(p.tagName)}),qg={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Wg={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Mg={__proto__:null,"<":193},zg=Rt.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:vg,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Ag],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Xg,Cg,Rg,Zg,2,3,4,5,6,7,8,9,10,11,12,13,14,Tg,new Hr("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Hr("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:i=>qg[i]||-1},{term:343,get:i=>Wg[i]||-1},{term:95,get:i=>Mg[i]||-1}],tokenPrec:15201});let Ko=[],pf=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=pf[n])e=n+1;else return!0;if(e==t)return!1}}function Th(i){return i>=127462&&i<=127487}const Xh=8205;function Eg(i,e,t=!0,n=!0){return(t?mf:jg)(i,e,n)}function mf(i,e,t){if(e==i.length)return e;e&&gf(i.charCodeAt(e))&&Qf(i.charCodeAt(e-1))&&e--;let n=Hs(i,e);for(e+=Ch(n);e=0&&Th(Hs(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function jg(i,e,t){for(;e>1;){let n=mf(i,e-2,t);if(n=56320&&i<57344}function Qf(i){return i>=55296&&i<56320}function Ch(i){return i<65536?1:2}class D{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Vi(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ot.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vi(this,e,t);let n=[];return this.decompose(e,t,n,0),Ot.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new gn(this),s=new gn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new gn(this,e)}iterRange(e,t=this.length){return new Sf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?D.empty:e.length<=32?new le(e):Ot.from(le.split(e,[]))}}class le extends D{constructor(e,t=Vg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new Yg(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new le(Rh(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=zr(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new le(l,o.length+s.length));else{let a=l.length>>1;n.push(new le(l.slice(0,a)),new le(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof le))return super.replace(e,t,n);[e,t]=Vi(this,e,t);let r=zr(this.text,zr(n.text,Rh(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new le(r,s):Ot.from(le.split(r,[]),s)}sliceString(e,t=this.length,n=` `){[e,t]=Vi(this,e,t);let r="";for(let s=0,o=0;s<=t&&oe&&o&&(r+=n),es&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new le(n,r)),n=[],r=-1);return r>-1&&t.push(new le(n,r)),t}}class Ot extends D{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s=o){let h=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?n.push(l):l.decompose(e-o,t-o,n,h)}o=a+1}}replace(e,t,n){if([e,t]=Vi(this,e,t),n.lines=s&&t<=l){let a=o.replace(e-s,t-s,n),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new Ot(c,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){[e,t]=Vi(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ot))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],h=e.children[s];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let u of e)n+=u.lines;if(n<32){let u=[];for(let d of e)d.flatten(u);return new le(u,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function O(u){let d;if(u.lines>s&&u instanceof Ot)for(let m of u.children)O(m);else u.lines>o&&(a>o||!a)?(f(),l.push(u)):u instanceof le&&a&&(d=c[c.length-1])instanceof le&&u.lines+d.lines<=32?(a+=u.lines,h+=u.length+1,c[c.length-1]=new le(d.text.concat(u.text),d.length+1+u.length)):(a+u.lines>r&&f(),a+=u.lines,h+=u.length+1,c.push(u))}function f(){a!=0&&(l.push(c.length==1?c[0]:Ot.from(c,h)),h=-1,a=c.length=0)}for(let u of e)O(u);return f(),l.length==1?l[0]:new Ot(l,t)}}D.empty=new le([""],0);function Vg(i){let e=-1;for(let t of i)e+=t.length+1;return e}function zr(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(a>n&&(l=l.slice(0,n-r)),r0?1:(e instanceof le?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof le?r.text.length:r.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(r instanceof le){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof le?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Sf{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new gn(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class bf{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=function(){return this.iter()},gn.prototype[Symbol.iterator]=Sf.prototype[Symbol.iterator]=bf.prototype[Symbol.iterator]=function(){return this});let Yg=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function Vi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function de(i,e,t=!0,n=!0){return Eg(i,e,t,n)}function Lg(i){return i>=56320&&i<57344}function Dg(i){return i>=55296&&i<56320}function Re(i,e){let t=i.charCodeAt(e);if(!Dg(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Lg(n)?(t-55296<<10)+(n-56320)+65536:t}function oa(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function ft(i){return i<65536?1:2}const Jo=/\r\n?|\n/;var Se=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(Se||(Se={}));class Qt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=l}else{if(n!=Se.Simple&&h>=e&&(n==Se.TrackDel&&re||n==Se.TrackBefore&&re))return null;if(h>e||h==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&l>=e)return rt?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(e)}static create(e){return new Qt(e)}}class ce extends Qt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return el(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return tl(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length0&&Bt(n,t,s.text),s.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;of||O<0||f>t)throw new RangeError(`Invalid change range ${O} to ${f} (in doc of length ${t})`);let d=u?typeof u=="string"?D.of(u.split(n||Jo)):u:D.empty,m=d.length;if(O==f&&m==0)return;Oo&&ke(r,O-o,-1),ke(r,f-O,m),Bt(s,r,d),o=f}}return h(e),a(!l),l}static empty(e){return new ce(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function Bt(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,h,s,c,O),r=h,s=c}}}function tl(i,e,t,n=!1){let r=[],s=n?[]:null,o=new Xn(i),l=new Xn(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ke(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let O=Math.min(c,l.len);h+=O,c-=O,l.forward(O)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>h),s.forward2(a),o.forward(a)}}}}class Xn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?D.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?D.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Lt{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new Lt(n,r,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,n,r){return new Lt(e,t,n,r)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>Lt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;rr.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function xf(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let la=0;class C{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=la++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new C(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:aa),!!e.static,e.enables)}of(e){return new _r([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new _r(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new _r(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function aa(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class _r{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=la++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let O of this.dependencies)O=="doc"?a=!0:O=="selection"?h=!0:((t=e[O.id])!==null&&t!==void 0?t:1)&1||c.push(e[O.id]);return{create(O){return O.values[o]=n(O),1},update(O,f){if(a&&f.docChanged||h&&(f.docChanged||f.selection)||il(O,c)){let u=n(O);if(l?!Zh(u,O.values[o],r):!r(u,O.values[o]))return O.values[o]=u,1}return 0},reconfigure:(O,f)=>{let u,d=f.config.address[s];if(d!=null){let m=es(f,d);if(this.dependencies.every(g=>g instanceof C?f.facet(g)===O.facet(g):g instanceof ye?f.field(g,!1)==O.field(g,!1):!0)||(l?Zh(u=n(O),m,r):r(u=n(O),m)))return O.values[o]=m,0}else u=n(O);return O.values[o]=u,1}}}get extension(){return this}}function Zh(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let h=[];for(let c=0;cn===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ur).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(ur),o=r.facet(ur),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,ur.of({field:this,create:e})]}get extension(){return this}}const ai={lowest:4,low:3,default:2,high:1,highest:0};function on(i){return e=>new kf(e,i)}const _t={highest:on(ai.highest),high:on(ai.high),default:on(ai.default),low:on(ai.low),lowest:on(ai.lowest)};class kf{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class Xs{of(e){return new nl(this,e)}reconfigure(e){return Xs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class nl{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class Jr{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of Gg(e,t,o))f instanceof ye?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],h=[];for(let f of r)l[f.id]=h.length<<1,h.push(u=>f.slot(u));let c=n==null?void 0:n.config.facets;for(let f in s){let u=s[f],d=u[0].facet,m=c&&c[f]||[];if(u.every(g=>g.type==0))if(l[d.id]=a.length<<1|1,aa(m,u))a.push(n.facet(d));else{let g=d.combine(u.map(Q=>Q.value));a.push(n&&d.compare(g,n.facet(d))?n.facet(d):g)}else{for(let g of u)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(Q=>g.dynamicSlot(Q)));l[d.id]=h.length<<1,h.push(g=>Bg(g,d,u))}}let O=h.map(f=>f(l));return new Jr(e,o,O,l,a,s)}}function Gg(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let h=n[a].indexOf(o);h>-1&&n[a].splice(h,1),o instanceof nl&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof nl){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,l)}else if(o instanceof kf)s(o.inner,o.prec);else if(o instanceof ye)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof _r)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,ai.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(i,ai.default),n.reduce((o,l)=>o.concat(l))}function Qn(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function es(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const Pf=C.define(),rl=C.define({combine:i=>i.some(e=>e),static:!0}),$f=C.define({combine:i=>i.length?i[0]:void 0,static:!0}),wf=C.define(),vf=C.define(),Tf=C.define(),Xf=C.define({combine:i=>i.length?i[0]:!1});class bt{constructor(e,t){this.type=e,this.value=t}static define(){return new Ig}}class Ig{of(e){return new bt(this,e)}}class Ug{constructor(e){this.map=e}of(e){return new W(this,e)}}class W{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new W(this.type,t)}is(e){return this.type==e}static define(e={}){return new Ug(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}}W.reconfigure=W.define();W.appendConfig=W.define();class he{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&xf(n,t.newLength),s.some(l=>l.type==he.time)||(this.annotations=s.concat(he.time.of(Date.now())))}static create(e,t,n,r,s,o){return new he(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(he.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}he.time=bt.define();he.userEvent=bt.define();he.addToHistory=bt.define();he.remote=bt.define();function Ng(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof he?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof he?i=s[0]:i=Rf(e,Ai(s),!1)}return i}function Hg(i){let e=i.startState,t=e.facet(Tf),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=Cf(n,sl(e,s,i.changes.newLength),!0))}return n==i?i:he.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const Kg=[];function Ai(i){return i==null?Kg:Array.isArray(i)?i:[i]}var te=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(te||(te={}));const Jg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ol;try{ol=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function e0(i){if(ol)return ol.test(i);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||Jg.test(t)))return!0}return!1}function t0(i){return e=>{if(!/\S/.test(e))return te.Space;if(e0(e))return te.Word;for(let t=0;t-1)return te.Word;return te.Other}}class Y{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(h,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(W.reconfigure)?(t=null,n=l.value):l.is(W.appendConfig)&&(t=null,n=Ai(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=Jr.resolve(n,r,this),s=new Y(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(rl)?e.newSelection:e.newSelection.asSingle();new Y(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Ai(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return Y.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Jr.resolve(e.extensions||[],new Map),n=e.doc instanceof D?e.doc:D.of((e.doc||"").split(t.staticFacet(Y.lineSeparator)||Jo)),r=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return xf(r,n.length),t.staticFacet(rl)||(r=r.asSingle()),new Y(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Y.tabSize)}get lineBreak(){return this.facet(Y.lineSeparator)||` diff --git a/veadk/webui/assets/MarkdownPromptEditor--dxbgBhm.js b/veadk/webui/assets/MarkdownPromptEditor-CwT7JlSU.js similarity index 99% rename from veadk/webui/assets/MarkdownPromptEditor--dxbgBhm.js rename to veadk/webui/assets/MarkdownPromptEditor-CwT7JlSU.js index f3d3310d..e0bd12ac 100644 --- a/veadk/webui/assets/MarkdownPromptEditor--dxbgBhm.js +++ b/veadk/webui/assets/MarkdownPromptEditor-CwT7JlSU.js @@ -1,4 +1,4 @@ -var i2=Object.defineProperty;var s2=(t,e,n)=>e in t?i2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var P=(t,e,n)=>s2(t,typeof e!="symbol"?e+"":e,n);import{i as Dd,j as l2,f as a2,g as Fc,y as c2,G as u2,s as f2,A as C,a as N,e as Fd,c as Hd,V as it,x as mn,E as Ns,C as Za,B as d2,b as Vd,u as rn,w as pl,h as tf,v as xr,F as Un,D as zt,d as fi,k as h2,t as L,z as nr,o as g2,m as p2,n as m2,l as y2,r as x2,p as _2,q as v2,R as qo}from"./index-u-pg5XfV.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++ne in t?i2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var P=(t,e,n)=>s2(t,typeof e!="symbol"?e+"":e,n);import{i as Dd,j as l2,f as a2,g as Fc,y as c2,G as u2,s as f2,A as C,a as N,e as Fd,c as Hd,V as it,x as mn,E as Ns,C as Za,B as d2,b as Vd,u as rn,w as pl,h as tf,v as xr,F as Un,D as zt,d as fi,k as h2,t as L,z as nr,o as g2,m as p2,n as m2,l as y2,r as x2,p as _2,q as v2,R as qo}from"./index-gtSqVSNF.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++nsvg{width:18px;height:18px}.builtin-tool-label{font-size:13.5px;font-weight:400;line-height:1.35}.builtin-tool-head.is-done .builtin-tool-label{color:hsl(var(--muted-foreground))}.builtin-tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.builtin-tool-chevron.is-open{transform:rotate(90deg)}.new-chat-mode{position:relative;align-self:flex-start}.new-chat-mode__trigger{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:2px 7px 2px 5px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer;transition:color .12s ease,background .12s ease}.composer--new-chat .new-chat-mode__trigger{min-height:36px;font-size:15px}.new-chat-mode__trigger:hover,.new-chat-mode__trigger[aria-expanded=true]{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-mode__current{max-width:min(180px,42vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__trigger:focus-visible,.new-chat-mode__option:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:1px}.new-chat-mode__icon,.new-chat-mode__option-icon{display:inline-grid;place-items:center;flex:0 0 auto}.new-chat-mode__icon svg{width:15px;height:15px}.new-chat-mode__option-icon svg{width:18px;height:18px}.new-chat-mode svg{fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}.new-chat-mode__skill-icon path:first-child{fill:currentColor;stroke:none}.new-chat-mode__chevron{width:12px;height:12px;transition:transform .14s ease}.new-chat-mode__trigger[aria-expanded=true] .new-chat-mode__chevron{transform:rotate(180deg)}.new-chat-mode__menu{position:absolute;z-index:42;top:calc(100% + 7px);right:0;width:286px;padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-mode__option{display:grid;grid-template-columns:24px minmax(0,1fr) 18px;align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.new-chat-mode__option.is-active{background:hsl(var(--accent))}.new-chat-mode__option:disabled{cursor:not-allowed;opacity:.48}.new-chat-mode__copy{display:flex;min-width:0;flex-direction:column;gap:2px}.new-chat-mode__copy>span:last-child{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.new-chat-mode__label{display:flex;align-items:center;gap:7px;font-size:13px;line-height:1.3}.new-chat-mode__beta{padding:1px 5px;border:1px solid hsl(var(--border));border-radius:999px;color:hsl(var(--muted-foreground));font-size:9px;font-weight:500;line-height:1.2}.new-chat-mode__check{width:16px;height:16px;color:hsl(var(--primary))}@media (prefers-reduced-motion: reduce){.new-chat-mode__trigger,.new-chat-mode__chevron{transition:none}}.stk{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.stk-head{text-align:center;margin-bottom:26px}.stk-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em}.stk-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.stk-list{display:flex;flex-direction:column;gap:12px;width:100%;max-width:520px}.stk-card{display:flex;align-items:center;gap:14px;width:100%;padding:18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));cursor:pointer;font:inherit;text-align:left;transition:border-color .15s,box-shadow .15s,background .12s}.stk-card:hover{border-color:hsl(var(--ring) / .35);background:hsl(var(--foreground) / .02);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.stk-card-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.stk-card-icon svg{width:21px;height:21px}.stk-card-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.stk-card-title{font-size:15px;font-weight:600}.stk-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.stk-card-arrow{flex-shrink:0;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.stk-card:hover .stk-card-arrow{opacity:1;transform:translate(0)}.stk-card-disabled{opacity:.5;cursor:not-allowed}.stk-card-disabled:hover{border-color:hsl(var(--border));background:hsl(var(--card));box-shadow:none}.stk-card-disabled .stk-card-arrow{display:none}.stk-footer{margin-top:18px;width:100%;max-width:520px;display:flex;justify-content:center}.stk-import{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border:1px dashed hsl(var(--border));border-radius:9px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.stk-import:hover{color:hsl(var(--foreground));border-color:hsl(var(--ring) / .4);background:hsl(var(--foreground) / .03)}.stk-import svg{width:15px;height:15px}.code-browser-trigger{min-height:26px;display:inline-flex;align-items:center;gap:5px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:color .12s ease,background-color .12s ease}.code-browser-trigger svg{width:13px;height:13px}.code-browser-trigger:hover{background:hsl(var(--foreground) / .04);color:hsl(var(--foreground))}.code-browser-trigger:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:1px}.code-browser-backdrop{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:code-browser-fade-in .14s ease-out}.code-browser-dialog{width:min(1040px,92vw);height:min(720px,84vh);min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .16);animation:code-browser-rise-in .18s cubic-bezier(.2,.8,.2,1)}.code-browser-head{flex:0 0 58px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 16px 0 18px;border-bottom:1px solid hsl(var(--border))}.code-browser-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.code-browser-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-title-icon svg,.code-browser-close svg{width:16px;height:16px}.code-browser-title-wrap h2,.code-browser-title-wrap p{margin:0}.code-browser-title-wrap h2{color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.code-browser-title-wrap p{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.code-browser-close{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.code-browser-close:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-workspace{flex:1;min-height:0;display:flex}.code-browser-sidebar{flex:0 0 220px;min-width:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .22)}.code-browser-sidebar-head,.code-browser-path{flex:0 0 38px;min-height:38px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.code-browser-sidebar-head{justify-content:space-between;padding:0 12px;color:hsl(var(--muted-foreground));font-size:11px;font-weight:650}.code-browser-sidebar-head span{font-variant-numeric:tabular-nums;font-weight:500}.code-browser-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.code-browser-file,.code-browser-folder{width:100%;min-height:30px;display:flex;align-items:center;gap:6px;padding-top:4px;padding-right:10px;padding-bottom:4px;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;text-align:left;cursor:pointer}.code-browser-file:hover,.code-browser-folder:hover{background:hsl(var(--foreground) / .045);color:hsl(var(--foreground))}.code-browser-file.is-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.code-browser-file svg,.code-browser-folder svg{width:14px;height:14px;flex:0 0 auto}.code-browser-folder>svg:first-child{width:12px;height:12px;transition:transform .12s ease}.code-browser-folder>svg:first-child.is-open{transform:rotate(90deg)}.code-browser-file span,.code-browser-folder span,.code-browser-path span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-browser-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.code-browser-path{gap:7px;padding:0 13px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px}.code-browser-path svg{width:13px;height:13px;flex:0 0 auto}.code-browser-editor{flex:1;min-height:0;overflow:hidden}.code-browser-editor>div,.code-browser-editor .cm-theme,.code-browser-editor .cm-editor{height:100%}.code-browser-editor .cm-scroller{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12.5px}.code-browser-empty{height:100%;display:grid;place-items:center;padding:20px;color:hsl(var(--muted-foreground));font-size:12px}@keyframes code-browser-fade-in{0%{opacity:0}to{opacity:1}}@keyframes code-browser-rise-in{0%{opacity:0;transform:translateY(8px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 720px){.code-browser-backdrop{padding:12px}.code-browser-dialog{width:100%;height:min(760px,92vh)}.code-browser-sidebar{flex-basis:168px}}@media (prefers-reduced-motion: reduce){.code-browser-backdrop,.code-browser-dialog{animation:none}}.pp-root{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.pp-toolbar{flex:0 0 auto;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:10px 24px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-toolbar-left,.pp-toolbar-actions,.pp-actions{display:flex;align-items:center}.pp-toolbar-left{min-width:0;gap:18px}.pp-toolbar-actions{flex:0 0 auto;gap:8px}.pp-toolbar-back{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer}.pp-toolbar-back:hover{color:hsl(var(--foreground))}.pp-toolbar-title{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-secondary,.pp-deploy{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border-radius:6px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.pp-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.pp-secondary:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--accent))}.pp-deploy{min-width:82px;border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-deploy:hover:not(:disabled){background:hsl(var(--primary) / .9)}.pp-deploy:disabled,.pp-secondary:disabled{opacity:.55;cursor:default}.pp-body{flex:1;min-height:0;min-width:0;display:flex}.pp-files-area{flex:1 1 auto;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.pp-sidebar{flex:0 0 218px;width:218px;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .24)}.pp-sidebar-head,.pp-main-head{flex:0 0 42px;min-height:42px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.pp-sidebar-head{gap:8px;padding:0 9px 0 14px}.pp-project-name{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:650;letter-spacing:.04em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.pp-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.pp-row{width:100%;min-height:29px;display:flex;align-items:center;gap:6px;padding:4px 8px;border:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.pp-row:hover{background:hsl(var(--foreground) / .045)}.pp-file.pp-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.pp-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-folder .pp-label{color:hsl(var(--muted-foreground))}.pp-ic{width:15px;height:15px;flex:0 0 auto}.pp-chevron{color:hsl(var(--muted-foreground));transition:transform .12s ease}.pp-chevron.pp-open{transform:rotate(90deg)}.pp-icon-btn{width:28px;height:28px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-icon-btn:hover:not(:disabled){background:hsl(var(--foreground) / .07);color:hsl(var(--foreground))}.pp-icon-btn:disabled{opacity:.45;cursor:default}.pp-danger:hover:not(:disabled){color:hsl(var(--destructive))}.pp-new-input{width:calc(100% - 16px);height:30px;margin:2px 8px 6px;padding:0 8px;border:1px solid hsl(var(--ring) / .55);border-radius:4px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.pp-empty,.pp-placeholder{width:100%;padding:28px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.pp-main{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.pp-main-head{gap:12px;padding:0 10px 0 14px;background:hsl(var(--background))}.pp-path{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-actions{gap:2px}.pp-content{flex:1;min-height:0;min-width:0;display:flex;overflow:hidden}.pp-codemirror,.pp-codemirror>div,.pp-codemirror .cm-editor{width:100%;height:100%;min-height:0}.pp-codemirror .cm-editor{overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground));font-size:12.5px}.pp-codemirror .cm-scroller{overflow:auto;overscroll-behavior:none;scroll-padding-block:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.58}.pp-codemirror .cm-content{padding:10px 0 0}.pp-codemirror .cm-line{padding:0 14px 0 8px}.pp-codemirror .cm-content>.cm-line:last-child:has(>br:only-child){display:none}.pp-codemirror .cm-gutters{border-right:1px solid hsl(var(--border) / .7);background:hsl(var(--secondary) / .2);color:hsl(var(--muted-foreground) / .65)}.pp-codemirror .cm-activeLine,.pp-codemirror .cm-activeLineGutter{background:hsl(var(--foreground) / .035)}.pp-codemirror .cm-focused{outline:none}.pp-editor-loading{height:100%;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12px}.pp-pre{flex:1;width:100%;height:100%;box-sizing:border-box;margin:0;padding:14px 16px 0;overflow:auto;background:hsl(var(--background));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px;font-style:normal;font-variant-ligatures:none;font-weight:400;line-height:1.58;-moz-tab-size:2;tab-size:2;white-space:pre}.pp-root.is-deploy .pp-body{display:grid;grid-template-columns:minmax(260px,3fr) minmax(520px,7fr)}.pp-root.is-deploy .pp-files-area{display:none}.pp-topology-pane{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-topology-head{flex:0 0 58px;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;border-bottom:1px solid hsl(var(--border))}.pp-topology-title{color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-topology-count{margin-top:2px;color:hsl(var(--muted-foreground));font-size:10.5px}.pp-topology-scroll{flex:1;min-height:0;overflow-y:auto;padding:12px 12px 16px}.pp-topology-tree{padding-bottom:12px}.pp-topology-branch{position:relative}.pp-topology-children{position:relative;display:flex;flex-direction:column;gap:2px;margin-top:2px}.pp-topology-children:before{content:"";position:absolute;top:0;bottom:6px;left:8px;width:1px;background:hsl(var(--border))}.pp-agent-node{position:relative;width:100%;min-height:49px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:7px 9px;border:1px solid transparent;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:default;transition:border-color .12s ease,background-color .12s ease}.pp-agent-node:hover,.pp-agent-node:focus-visible,.pp-agent-node.is-inspected{border-color:hsl(var(--primary) / .16);outline:none;background:hsl(var(--primary) / .04)}.pp-agent-node-icon,.pp-agent-inspector-icon{display:inline-flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground))}.pp-agent-node-icon{width:24px;height:24px;flex:0 0 24px}.pp-agent-node-icon svg,.pp-agent-inspector-icon svg{width:15px;height:15px}.pp-agent-node-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.pp-agent-node-name{overflow:hidden;color:hsl(var(--foreground));font-size:12.5px;font-weight:550;text-overflow:ellipsis;white-space:nowrap}.pp-agent-node-type{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.pp-agent-child-count{flex:0 0 auto;min-width:18px;padding:1px 5px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:9.5px;text-align:center}.pp-agent-inspector{padding:13px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .22)}.pp-agent-inspector-head{display:flex;align-items:center;gap:9px}.pp-agent-inspector-icon{width:28px;height:28px;flex:0 0 28px;border-radius:7px;background:hsl(var(--background))}.pp-agent-inspector-head>div{min-width:0;display:flex;flex-direction:column;gap:1px}.pp-agent-inspector-head strong{overflow:hidden;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-agent-inspector-head span,.pp-agent-inspector p{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-agent-inspector p{margin:10px 0 0;line-height:1.5}.pp-agent-config-grid{display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 12px;margin:12px 0 0;padding-top:11px;border-top:1px solid hsl(var(--border) / .72);font-size:10.5px}.pp-agent-config-grid dt{color:hsl(var(--muted-foreground))}.pp-agent-config-grid dd{min-width:0;margin:0;overflow-wrap:anywhere;color:hsl(var(--foreground));text-align:right}.pp-topology-actions{flex:0 0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px 12px;border-top:1px solid hsl(var(--border))}.pp-topology-actions .pp-secondary{width:100%;padding-inline:8px}.pp-config{min-width:0;width:auto;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.pp-config-head{flex:0 0 58px;height:58px;box-sizing:border-box;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid hsl(var(--border))}.pp-config-title{color:hsl(var(--foreground));font-size:17px;font-weight:650;letter-spacing:-.01em}.pp-env-sub{margin-top:4px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.pp-config-scroll{flex:1;min-height:0;overflow-y:auto}.pp-config-actions{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:6px;padding:10px 14px;border-top:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-config-actions .pp-deploy{min-width:108px}.pp-config-section{padding:16px 18px 18px}.pp-config-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650;letter-spacing:-.01em}.pp-config-select,.pp-channel-fields input,.pp-network-fields input,.pp-env-row input{width:100%;min-width:0;height:34px;box-sizing:border-box;padding:0 10px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;transition:border-color .12s ease,box-shadow .12s ease}.pp-config-select:focus,.pp-channel-fields input:focus,.pp-network-fields input:focus,.pp-env-row input:focus{border-color:hsl(var(--ring) / .55);box-shadow:0 0 0 2px hsl(var(--ring) / .08)}.pp-config-select:disabled,.pp-channel-fields input:disabled,.pp-network-fields input:disabled,.pp-env-row input:disabled{opacity:.55}.pp-channel{width:auto;display:inline-flex;align-items:center;justify-content:flex-start;gap:10px;padding:2px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.pp-channel:disabled{cursor:default}.pp-channel-title{color:hsl(var(--foreground));font-size:13px;font-weight:560}.pp-switch{position:relative;flex:0 0 34px;width:34px;height:19px;border-radius:999px;background:hsl(var(--foreground) / .16);transition:background-color .15s ease}.pp-switch span{position:absolute;top:3px;left:3px;width:13px;height:13px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .18);transition:transform .15s ease}.pp-channel.is-on .pp-switch{background:hsl(var(--primary))}.pp-channel.is-on .pp-switch span{transform:translate(15px)}.pp-channel-fields{display:flex;flex-direction:column;gap:12px;margin-top:14px}.pp-channel-fields label{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-channel-fields label>span{color:hsl(var(--foreground));font-weight:560}.pp-channel-fields small{margin-left:5px;color:hsl(var(--destructive));font-size:10px;font-weight:500}.pp-channel-fields code{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-channel-fields input{grid-column:1 / -1}.pp-network-modes{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;padding:3px;border:1px solid hsl(var(--border) / .8);border-radius:6px;background:hsl(var(--secondary) / .42)}.pp-network-modes button{min-height:29px;padding:0 7px;border:0;border-radius:4px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer}.pp-network-modes button.is-on{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .08)}.pp-network-modes button:disabled{cursor:default}.pp-network-fields{display:flex;flex-direction:column;gap:12px;margin-top:14px}.pp-network-fields label:not(.pp-network-check){display:flex;flex-direction:column;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-network-fields small{font-size:10.5px;font-weight:400}.pp-network-check{display:flex;align-items:center;gap:8px;color:hsl(var(--foreground));font-size:12.5px;cursor:pointer}.pp-network-check input{width:14px;height:14px;margin:0}.pp-env-section{padding-bottom:16px}.pp-env-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.pp-env-head .pp-config-label{display:flex;align-items:center;gap:7px;margin-bottom:0}.pp-env-count{display:inline-flex;align-items:center}.pp-env-table{display:flex;flex-direction:column;margin-top:10px}.pp-env-group{padding:4px 7px 0;border:1px solid hsl(var(--border) / .75);border-radius:6px;background:hsl(var(--secondary) / .16)}.pp-env-group-head{display:flex;align-items:center;justify-content:space-between;padding:5px 1px 3px;color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.pp-env-group-head small{color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:450}.pp-env-group-head-custom{margin-top:12px}.pp-env-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px;align-items:center;gap:7px;padding:7px 0;border-bottom:1px solid hsl(var(--border) / .65)}.pp-env-row input:first-child{font-family:inherit;font-size:13px}.pp-env-row-derived:last-child{border-bottom:0}.pp-env-key-fixed{background:hsl(var(--secondary) / .32)!important;cursor:default}.pp-env-source{color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.pp-env-remove{width:28px;height:28px}.pp-env-add{width:100%;min-height:52px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer}.pp-env-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025);color:hsl(var(--foreground))}.pp-env-add:disabled{opacity:.5}.pp-steps{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none}.pp-step{position:relative;min-height:34px;display:flex;align-items:flex-start;gap:9px}.pp-step:not(:last-child):after{content:"";position:absolute;top:20px;bottom:-2px;left:9px;width:1px;background:hsl(var(--border))}.pp-step-dot{z-index:1;width:19px;height:19px;flex:0 0 19px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10px}.pp-step-body{min-width:0;display:flex;flex-direction:column;padding-top:1px}.pp-step-label{color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560}.pp-step-msg{max-width:300px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-step.is-active .pp-step-dot{border-color:hsl(var(--primary));color:hsl(var(--primary))}.pp-step.is-done .pp-step-dot{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-step.is-failed .pp-step-dot{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.pp-error{margin:14px 18px;padding:10px 11px;border:1px solid hsl(var(--destructive) / .22);border-radius:5px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.pp-deploy-result{margin:14px 18px 18px;padding:14px;border:1px solid hsl(var(--primary) / .2);border-radius:6px;background:hsl(var(--primary) / .035)}.pp-deploy-result-header{margin-bottom:12px;color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-deploy-result-body{display:flex;flex-direction:column;gap:10px}.pp-deploy-result-field{display:flex;flex-direction:column;gap:4px}.pp-deploy-result-field label{color:hsl(var(--muted-foreground));font-size:12.5px}.pp-deploy-result-field code{overflow-wrap:anywhere;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px}.pp-deploy-result-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.pp-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;min-height:0}.pp-confirm-head{flex-basis:60px}.pp-confirm-icon{background:#f59f0a1f;color:#ba6708}.pp-confirm-body{padding:24px 20px}.pp-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.pp-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.pp-confirm-actions button{min-width:76px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.pp-confirm-actions button:hover{background:hsl(var(--secondary))}.pp-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.pp-confirm-actions .is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-confirm-actions .is-primary:hover{background:hsl(var(--primary) / .9)}.pp-deploy-result-btn,.pp-console-link-btn{min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border-radius:5px;font-size:12.5px;font-weight:600;text-decoration:none;cursor:pointer}.pp-deploy-result-btn{border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-console-link-btn{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.spin{animation:pp-spin .85s linear infinite}@keyframes pp-spin{to{transform:rotate(360deg)}}@media (max-width: 1120px){.pp-root.is-deploy .pp-body{grid-template-columns:minmax(235px,3fr) minmax(470px,7fr)}.pp-sidebar{flex-basis:190px;width:190px}}@media (max-width: 860px){.pp-toolbar{align-items:flex-start;flex-direction:column;gap:8px}.pp-toolbar-actions{width:100%}.pp-body{overflow-y:auto;flex-direction:column}.pp-root.is-deploy .pp-body{display:flex}.pp-topology-pane{flex:0 0 auto;min-height:420px;border-right:0;border-bottom:1px solid hsl(var(--border))}.pp-files-area{min-height:520px}.pp-config{width:100%;min-height:520px;border-top:1px solid hsl(var(--border));border-left:0}}.ic-root{display:flex;flex-direction:column;height:100%;min-height:0}.ic-body{flex:1;min-height:0;display:flex}.ic-chat{flex:0 0 380px;width:380px;min-width:0;display:flex;flex-direction:column;min-height:0;border-right:1px solid hsl(var(--border))}.ic-transcript{flex:1;min-height:0;overflow-y:auto;padding:24px 20px 12px}.ic-turn{display:flex;gap:10px;max-width:760px;margin:0 auto 16px}.ic-turn:last-child{margin-bottom:0}.ic-turn--assistant{justify-content:flex-start}.ic-turn--user{justify-content:flex-end}.ic-avatar{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:hsl(var(--secondary));color:#7c48f4}.ic-avatar-icon{width:17px;height:17px}.ic-bubble{max-width:78%;padding:11px 15px;border-radius:16px;font-size:14px;line-height:1.6;word-break:break-word}.ic-turn--user .ic-bubble{white-space:pre-wrap}.ic-turn--assistant .ic-bubble{background:hsl(var(--secondary));color:hsl(var(--foreground));border-top-left-radius:5px}.ic-turn--user .ic-bubble{background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-top-right-radius:5px}.ic-bubble .md>:first-child{margin-top:0}.ic-bubble .md>:last-child{margin-bottom:0}.ic-bubble--typing{display:inline-flex;align-items:center;gap:4px;padding:14px 16px}.ic-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground));animation:ic-bounce 1.2s ease-in-out infinite}.ic-dot:nth-child(2){animation-delay:.16s}.ic-dot:nth-child(3){animation-delay:.32s}@keyframes ic-bounce{0%,60%,to{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.ic-error{flex-shrink:0;display:flex;align-items:center;gap:8px;max-width:760px;width:100%;margin:0 auto;padding:9px 14px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px;line-height:1.45}.ic-error-icon{width:15px;height:15px;flex-shrink:0}.ic-composer{flex-shrink:0;max-width:760px;width:100%;margin:0 auto;padding:8px 20px 18px}.ic-composer-box{display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 12px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background));transition:border-color .15s,box-shadow .15s}.ic-composer-box:focus-within{border-color:hsl(var(--ring) / .4);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.ic-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 2px;max-height:160px;overflow-y:auto}.ic-input::placeholder{color:hsl(var(--muted-foreground))}.ic-input:disabled{opacity:.6}.ic-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.ic-send-icon{width:17px;height:17px}.ic-send:hover:not(:disabled){opacity:.85}.ic-send:active:not(:disabled){transform:scale(.94)}.ic-send:disabled{opacity:.3;cursor:default}.ic-composer-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.ic-composer-hint{flex:1;text-align:center;font-size:11px;color:hsl(var(--muted-foreground))}.ic-ab-toggle{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;cursor:pointer;-webkit-user-select:none;user-select:none}.ic-ab-checkbox{position:absolute;opacity:0;width:0;height:0}.ic-ab-track{position:relative;display:inline-block;width:30px;height:17px;border-radius:999px;background:hsl(var(--muted-foreground) / .35);transition:background .15s}.ic-ab-thumb{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0003;transition:transform .15s}.ic-ab-checkbox:checked+.ic-ab-track{background:hsl(var(--primary))}.ic-ab-checkbox:checked+.ic-ab-track .ic-ab-thumb{transform:translate(13px)}.ic-ab-checkbox:disabled+.ic-ab-track{opacity:.5}.ic-ab-checkbox:focus-visible+.ic-ab-track{box-shadow:0 0 0 3px hsl(var(--ring) / .25)}.ic-ab-label{font-size:12px;font-weight:600;color:hsl(var(--foreground))}.ic-compare{flex:1;min-height:0;display:flex}.ic-compare-divider{flex:0 0 1px;background:hsl(var(--border))}.ic-pane{flex:1 1 0;min-width:0;min-height:0;display:flex;flex-direction:column}.ic-pane-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background))}.ic-pane-title{display:flex;align-items:center;gap:8px;min-width:0}.ic-pane-tag{flex-shrink:0;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;color:#fff}.ic-pane-tag--a{background:#7c48f4}.ic-pane-tag--b{background:#0da2e7}.ic-pane-model{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ic-adopt{flex-shrink:0;padding:6px 12px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font-size:12px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.ic-adopt:hover:not(:disabled){opacity:.85}.ic-adopt:active:not(:disabled){transform:scale(.96)}.ic-adopt:disabled{opacity:.4;cursor:default}.ic-pane-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.ic-pane-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-size:13px;color:hsl(var(--muted-foreground))}.ic-pane-spinner{width:22px;height:22px;color:#7c48f4;animation:ic-spin .9s linear infinite}@keyframes ic-spin{to{transform:rotate(360deg)}}.ic-pane-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.ic-preview{flex:1 1 0;min-width:0;display:flex;flex-direction:column;min-height:0;background:hsl(var(--muted) / .35)}.ic-preview-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px;text-align:center}.ic-preview-empty-icon{position:relative;display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:18px;background:#7c48f414;color:#7c48f4;margin-bottom:4px}.ic-preview-empty-glyph{width:30px;height:30px}.ic-preview-empty-spark{position:absolute;top:9px;right:9px;width:14px;height:14px}.ic-preview-empty-title{font-size:15px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.ic-preview-empty-sub{font-size:13px;line-height:1.55;color:hsl(var(--muted-foreground));max-width:240px}@media (max-width: 920px){.ic-body{flex-direction:column}.ic-preview{width:100%;border-left:none;border-top:1px solid hsl(var(--border));min-height:320px}}.cw-root{--cw-workbench-toolbar-height: 64px;flex:1;min-height:0;display:flex;flex-direction:column;height:100%;color:hsl(var(--foreground))}.cw-editor{flex:1;min-height:0;display:flex;align-items:stretch}.cw-tree{flex-shrink:0;width:248px;overflow-y:auto;padding:16px 14px;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.cw-tree-head{font-size:12px;font-weight:650;letter-spacing:.02em;color:hsl(var(--muted-foreground));padding:0 6px;margin-bottom:10px}.cw-tree-branch{display:flex;flex-direction:column}.cw-tree-node{position:relative;display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:8px;cursor:pointer;font-size:13px;border:1px solid transparent;transition:background .12s ease,border-color .12s ease}.cw-tree-node:hover{background:hsl(var(--accent))}.cw-tree-node.is-selected{background:hsl(var(--primary) / .04);border-color:hsl(var(--primary) / .16)}.cw-tree-node.is-invalid{background:hsl(var(--destructive) / .07);border-color:hsl(var(--destructive) / .5)}.cw-tree-node.is-invalid.is-selected{background:hsl(var(--destructive) / .1);border-color:hsl(var(--destructive) / .6)}.cw-tree-node.is-draggable{cursor:grab}.cw-tree-node.is-draggable:active{cursor:grabbing}.cw-tree-node.is-dragover{background:hsl(var(--primary) / .1);border-color:hsl(var(--primary) / .45)}.cw-tree-icon{width:15px;height:15px;flex-shrink:0;opacity:.8}.cw-tree-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.cw-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.cw-tree-type{font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:hsl(var(--muted-foreground))}.cw-tree-actions{display:flex;align-items:center;gap:1px;flex-shrink:0;opacity:0;pointer-events:none;transition:opacity .12s ease}.cw-tree-node:hover .cw-tree-actions,.cw-tree-node.is-selected .cw-tree-actions{opacity:1;pointer-events:auto}.cw-tree-children{display:flex;flex-direction:column;gap:2px;margin-top:2px;margin-left:8px;padding-left:8px;border-left:1px solid hsl(var(--border))}.cw-detail{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-typebar{position:relative;z-index:5;flex-shrink:0;height:var(--cw-workbench-toolbar-height);background:hsl(var(--panel));border-bottom:1px solid hsl(var(--border));padding:10px 16px}.cw-typebar-inner{height:100%;display:flex;align-items:center;max-width:1080px;margin:0 auto}.cw-detail-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;padding:24px 16px 48px}.cw-detail-inner{max-width:780px;margin:0 auto}.cw-lower{display:flex;gap:8px;align-items:flex-start}.cw-detail .cw-form-col{flex:1;min-width:0;max-width:720px;margin:0}.cw-debug{flex-shrink:0;width:380px;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid hsl(var(--border));background:hsl(var(--panel));transition:width .22s cubic-bezier(.22,1,.36,1),min-width .22s cubic-bezier(.22,1,.36,1),height .22s cubic-bezier(.22,1,.36,1),min-height .22s cubic-bezier(.22,1,.36,1),flex-basis .22s cubic-bezier(.22,1,.36,1),padding .18s ease}.cw-debug:not(.is-collapsed)>*{animation:cw-debug-content-in .18s ease-out both}.cw-debug.is-collapsed .cw-debug-expand{animation:cw-debug-control-in .18s .06s ease-out both}@keyframes cw-debug-content-in{0%{opacity:0;transform:scale(.985)}}@keyframes cw-debug-control-in{0%{opacity:0;transform:scale(.9)}}@media (prefers-reduced-motion: reduce){.cw-debug{transition:none}.cw-debug:not(.is-collapsed)>*,.cw-debug.is-collapsed .cw-debug-expand{animation:none}}.cw-debug-head{flex-shrink:0;height:var(--cw-workbench-toolbar-height);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid hsl(var(--border))}.cw-debug-head-actions{display:flex;align-items:center;gap:6px}.cw-debug-collapse,.cw-debug-expand{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s,background .12s,transform .12s}.cw-debug-collapse{width:24px;height:24px}.cw-debug-collapse:hover,.cw-debug-expand:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.cw-debug-expand:hover{transform:scale(1.06)}.cw-debug.is-collapsed{width:48px;min-width:48px;height:100%;min-height:0;align-items:center;padding-top:14px}.cw-debug-expand{width:34px;height:34px;min-height:34px}.cw-debug-title{display:inline-flex;align-items:center;gap:7px;font-size:17px;font-weight:650;color:hsl(var(--foreground))}.cw-debug-deploy,.cw-debug-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:6px 10px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:opacity .12s,transform .1s}.cw-debug-deploy{gap:4px;font-size:13px}.cw-debug-deploy .cw-i{width:13px;height:13px;transition:transform .18s ease}.cw-debug-deploy:hover:not(:disabled) .cw-i:not(.cw-spin){transform:translate(2px)}@media (prefers-reduced-motion: reduce){.cw-debug-deploy .cw-i{transition:none}.cw-debug-deploy:hover:not(:disabled) .cw-i:not(.cw-spin){transform:none}}.cw-debug-deploy:hover:not(:disabled),.cw-debug-start:hover:not(:disabled){opacity:.86}.cw-debug-deploy:active:not(:disabled),.cw-debug-start:active:not(:disabled){transform:scale(.96)}.cw-debug-deploy:disabled,.cw-debug-start:disabled{opacity:.45;cursor:default}.cw-debug-sub{flex-shrink:0;display:flex;flex-direction:column;gap:3px;padding:10px 16px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.cw-debug-deploy-error{margin:0 16px 12px;padding:8px 10px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px;line-height:1.45}.cw-debug-stage{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.cw-debug-body{flex:1;min-height:0;overflow-y:auto;padding:10px 16px 18px}.cw-debug-empty{min-height:120px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:14px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-start{color:hsl(var(--primary-foreground))}.cw-debug-run-icon{width:17px;height:17px;transition:transform .16s cubic-bezier(.22,1,.36,1)}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:translate(1.5px)}@media (prefers-reduced-motion: reduce){.cw-debug-run-icon{transition:none}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:none}}.cw-debug-progress{display:flex;flex-direction:column;gap:8px}.cw-debug-logline{display:flex;align-items:center;gap:8px;min-height:28px;padding:7px 9px;border-radius:9px;background:hsl(var(--foreground) / .04);color:hsl(var(--muted-foreground));font-size:12.5px}.cw-debug-logline .cw-i{color:hsl(var(--foreground))}.cw-debug-error{display:flex;flex-direction:column;gap:12px;color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-debug-error-detail,.cw-debug-msg-error{width:100%;min-width:0;color:hsl(var(--destructive));text-align:left}.cw-debug-error-detail .deploy-error-message-text,.cw-debug-msg-error .deploy-error-message-text{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px}.cw-debug-chat{min-height:100%;display:flex;flex-direction:column;gap:18px}.cw-debug-chat-empty{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-msg{display:flex;flex-direction:column;gap:6px;max-width:100%}.cw-debug-msg-user{align-items:flex-end}.cw-debug-msg-assistant{align-items:flex-start}.cw-debug-role{display:none}.cw-debug-content{max-width:100%;color:hsl(var(--foreground));font-size:14px;line-height:1.65;word-break:break-word}.cw-debug-msg-user .cw-debug-content{max-width:88%;padding:9px 14px;border-radius:18px;background:hsl(var(--secondary))}.cw-debug-msg-assistant .cw-debug-content{width:100%}.cw-debug-composer{flex-shrink:0;padding:10px 14px 14px;background:hsl(var(--panel))}.cw-debug-composerbox{display:flex;align-items:center;gap:6px;padding:6px 6px 6px 10px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background))}.cw-debug-input{flex:1;min-width:0;max-height:120px;padding:8px 4px;border:none;outline:none;resize:none;overflow-y:auto;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.5}.cw-debug-input::placeholder{color:hsl(var(--muted-foreground))}.cw-debug-send{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:50%;cursor:pointer;transition:opacity .15s,transform .1s,background .12s,color .12s}.cw-debug-send{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-debug-send:hover:not(:disabled){opacity:.85}.cw-debug-send:active:not(:disabled){transform:scale(.94)}.cw-debug-send:disabled{opacity:.3;cursor:default}.cw-debug-overlay{position:absolute;z-index:5;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:22px;background:hsl(var(--panel) / .5);backdrop-filter:blur(9px) saturate(.9);-webkit-backdrop-filter:blur(9px) saturate(.9)}.cw-debug-overlay-content{width:min(100%,290px);display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px;border:1px solid hsl(var(--border) / .72);border-radius:12px;background:hsl(var(--background) / .82);box-shadow:0 10px 30px hsl(var(--foreground) / .08);text-align:center}.cw-debug-overlay-title{color:hsl(var(--foreground));font-size:14px;font-weight:650}.cw-debug-overlay-copy{color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55}.cw-debug-overlay-progress{width:100%;display:flex;flex-direction:column;gap:8px}.cw-debug-overlay-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:2px}.cw-debug-ignore{min-height:30px;padding:6px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background) / .72);color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s,transform .1s}.cw-debug-ignore:hover:not(:disabled){border-color:hsl(var(--foreground) / .2);background:hsl(var(--background))}.cw-debug-ignore:active:not(:disabled){transform:scale(.96)}.cw-debug-ignore:disabled{opacity:.45;cursor:default}.cw-header{flex-shrink:0;display:flex;align-items:flex-start;gap:16px;padding:18px 24px 16px;border-bottom:1px solid hsl(var(--border))}.cw-header-title{flex:1;min-width:0}.cw-header-mode{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:hsl(var(--muted-foreground))}.cw-title{margin:5px 0 2px;font-size:21px;font-weight:650;letter-spacing:-.02em}.cw-subtitle{margin:0;font-size:13px;color:hsl(var(--muted-foreground))}.cw-progress-pill{flex-shrink:0;margin-top:2px;padding:5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}.cw-body{flex:1;min-height:0;overflow-y:auto}.cw-center{display:flex;align-items:flex-start;justify-content:center;gap:32px;max-width:960px;margin:0 auto;padding:32px 24px 80px}.cw-form-col{flex:1 1 auto;min-width:0;max-width:640px;display:flex;flex-direction:column;gap:44px}.cw-section{scroll-margin-top:24px}.cw-sec-head{margin-bottom:18px}.cw-sec-title{display:flex;align-items:center;gap:8px;margin:0 0 4px;font-size:17px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.cw-sec-required{padding:1px 7px;border-radius:999px;background:hsl(var(--foreground) / .08);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600;letter-spacing:.02em}.cw-sec-hint{margin:0;font-size:13px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-rail{position:sticky;top:12px;align-self:flex-start;flex-shrink:0;width:32px;margin-left:auto;padding:0;z-index:4}.cw-steps{position:relative;list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.cw-rail-track{position:absolute;left:15px;top:18px;bottom:18px;width:2px;border-radius:2px;background:hsl(var(--border));z-index:0}.cw-rail-fill{position:absolute;left:0;top:0;width:100%;border-radius:2px;background:hsl(var(--foreground) / .55)}.cw-step{position:relative;display:flex;align-items:center;justify-content:center;width:32px;min-height:36px;padding:0;border:none;border-radius:9px;background:none;text-align:left;cursor:pointer;font:inherit;transition:background .12s}.cw-step:hover{background:hsl(var(--foreground) / .05)}.cw-step.is-active{background:hsl(var(--foreground) / .06)}.cw-step:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-step-marker{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:32px;height:36px}.cw-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--foreground) / .25);transition:background .15s,width .15s,height .15s}.cw-step.is-active .cw-dot{width:10px;height:10px;background:hsl(var(--foreground));box-shadow:0 0 0 3px hsl(var(--panel))}.cw-step-check{width:14px;height:14px;padding:1px;border-radius:50%;background:hsl(var(--panel));color:hsl(var(--foreground) / .68)}.cw-step-tooltip{position:absolute;z-index:5;top:50%;right:calc(100% + 8px);padding:5px 8px;border-radius:6px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 4px 12px hsl(var(--foreground) / .12);font-size:11.5px;font-weight:550;white-space:nowrap;opacity:0;pointer-events:none;transform:translate(4px,-50%);transition:opacity .12s,transform .12s}.cw-step:hover .cw-step-tooltip,.cw-step:focus-visible .cw-step-tooltip{opacity:1;transform:translateY(-50%)}.cw-form{display:flex;flex-direction:column;gap:20px}.cw-section-desc{margin:0;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.cw-field{display:flex;flex-direction:column;gap:7px}.cw-more-options{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;margin-top:-4px;padding:4px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer;transition:color .14s ease}.cw-more-options:hover,.cw-more-options:focus-visible{color:hsl(var(--foreground))}.cw-more-options:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:3px;border-radius:4px}.cw-more-options-chevron{width:14px;height:14px;transition:transform .18s ease}.cw-more-options-chevron.is-open{transform:rotate(90deg)}.cw-more-options-count{margin-left:2px;padding:2px 7px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:10.5px;font-weight:600}.cw-model-advanced{display:flex;flex-direction:column;gap:20px;overflow:hidden}.cw-label{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-req{margin-left:2px;color:hsl(var(--destructive))}.cw-help{font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-remote-center-head{display:flex;flex-direction:column;gap:6px}.cw-remote-center-description{display:block;max-width:560px;margin:0;line-height:1.6}.cw-error-text{font-size:12px;color:hsl(var(--destructive))}.cw-env-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:12px;margin-top:5px}.cw-env-field{display:flex;min-width:0;flex-direction:column;gap:6px}.cw-env-field-head{display:grid;min-width:0;gap:3px;color:hsl(var(--foreground));font-size:12px;font-weight:560}.cw-env-field-label{min-width:0;line-height:1.4;overflow-wrap:anywhere}.cw-env-field-head code{display:block;max-width:100%;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.cw-env-empty{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12px}.cw-input{min-width:0;width:100%;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .12s,box-shadow .12s}.cw-input::placeholder{color:hsl(var(--muted-foreground))}.cw-input:focus{outline:none;border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-input.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-textarea{width:100%;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.6;resize:vertical;transition:border-color .12s,box-shadow .12s}.cw-textarea::placeholder{color:hsl(var(--muted-foreground))}.cw-textarea:focus{outline:none;border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-textarea.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}@keyframes cw-error-shake-a{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}@keyframes cw-error-shake-b{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}.cw-error-shake-0{animation:cw-error-shake-a .28s ease-in-out}.cw-error-shake-1{animation:cw-error-shake-b .28s ease-in-out}@media (prefers-reduced-motion: reduce){.cw-error-shake-0,.cw-error-shake-1{animation:none}}.cw-textarea-sm{min-height:80px;max-height:160px;overflow-y:auto}.cw-textarea-lg{min-height:340px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.cw-markdown-loading,.cw-markdown-editor:not(.mdxeditor-popup-container){min-height:340px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background))}.cw-markdown-loading{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px}.cw-markdown-editor:not(.mdxeditor-popup-container){display:flex;flex-direction:column;max-height:420px;overflow:hidden;color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.cw-markdown-editor:not(.mdxeditor-popup-container):focus-within{border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-markdown-editor:not(.mdxeditor-popup-container).is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-markdown-toolbar{flex-shrink:0;min-height:40px;padding:5px 8px;border:0;border-bottom:1px solid hsl(var(--border));border-radius:0;background:hsl(var(--muted) / .38)}.cw-markdown-toolbar button,.cw-markdown-toolbar [role=combobox]{color:hsl(var(--foreground))}.cw-markdown-content{min-height:298px;max-height:360px;overflow-y:auto;padding:18px 20px 28px;color:hsl(var(--foreground));font-size:14px;line-height:1.7}.cw-markdown-content:focus{outline:none}.cw-markdown-content h1,.cw-markdown-content h2,.cw-markdown-content h3{margin:1.1em 0 .45em;color:hsl(var(--foreground));font-weight:650;line-height:1.3}.cw-markdown-content h1:first-child,.cw-markdown-content h2:first-child,.cw-markdown-content h3:first-child{margin-top:0}.cw-markdown-content h1{font-size:20px}.cw-markdown-content h2{font-size:17px}.cw-markdown-content h3{font-size:15px}.cw-markdown-content p{margin:0 0 .8em}.cw-markdown-content ul,.cw-markdown-content ol{margin:.5em 0 .9em;padding-left:1.5em}.cw-markdown-content blockquote{margin:.8em 0;padding-left:12px;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.cw-markdown-error{display:block;margin-top:6px;color:hsl(var(--destructive));font-size:12px}.cw-tag-editor{display:flex;flex-direction:column;gap:12px}.cw-tag-inputrow{display:flex;gap:8px}.cw-tag-inputrow .cw-input{flex:1}.cw-presets{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.cw-presets-label{font-size:11.5px;color:hsl(var(--muted-foreground));margin-right:2px}.cw-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12.5px;white-space:nowrap}.cw-chip-ghost{border:1px dashed hsl(var(--border));background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;transition:background .12s,color .12s,border-color .12s}.cw-chip-ghost:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-chip-sub{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-pills{display:flex;flex-wrap:wrap;gap:8px}.cw-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 6px 5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:13px}.cw-pill-x{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:none;border-radius:50%;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-pill-x:hover{background:hsl(var(--destructive) / .12);color:hsl(var(--destructive))}.cw-empty-line{margin:0;font-size:12.5px;color:hsl(var(--muted-foreground))}.cw-check-inline{display:flex;align-items:center;gap:8px;margin-top:2px;font-size:13px;color:hsl(var(--foreground));cursor:pointer;-webkit-user-select:none;user-select:none}.cw-check-inline input[type=checkbox]{width:16px;height:16px;margin:0;flex-shrink:0;accent-color:hsl(var(--primary));cursor:pointer}.cw-checklist{display:flex;flex-direction:column;gap:8px}.cw-tools-list-shell{min-width:0;container-type:inline-size}.cw-checklist-tools{--cw-checklist-row-height: 65px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(var(--cw-checklist-row-height),auto);max-height:var(--cw-checklist-max-height);padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-checklist-tools .cw-check{min-height:var(--cw-checklist-row-height)}.cw-checklist-tools .cw-check-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}@container (max-width: 575px){.cw-checklist-tools{grid-template-columns:minmax(0,1fr)}}.cw-check{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-check:hover{background:hsl(var(--foreground) / .05)}.cw-check.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-check-box{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background));color:hsl(var(--background));transition:background .12s,border-color .12s,color .12s}.cw-check.is-on .cw-check-box{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-check-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-check-title{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.cw-check-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-segmented{display:flex;flex-wrap:wrap;gap:8px}.cw-seg{flex:1 1 160px;display:flex;flex-direction:column;gap:2px;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-seg:hover{background:hsl(var(--foreground) / .05)}.cw-seg.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-seg-title{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-seg-desc{font-size:11.5px;line-height:1.45;color:hsl(var(--muted-foreground))}.cw-ctool{display:flex;flex-direction:column;gap:12px}.cw-ctool-inputs{display:flex;flex-wrap:wrap;gap:8px}.cw-ctool-inputs .cw-input{flex:1 1 180px}.cw-ctool-list{display:flex;flex-direction:column;gap:8px}.cw-ctool-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--card))}.cw-ctool-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}.cw-ctool-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ctool-name{font-size:13.5px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--foreground));word-break:break-word}.cw-ctool-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp,.cw-mcp-list{display:flex;flex-direction:column;gap:12px}.cw-mcp-row{display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.cw-mcp-rowhead{display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-mcp-transport{display:inline-flex;gap:6px}.cw-seg-sm{flex:0 0 auto;min-width:72px;flex-direction:row;align-items:center;justify-content:center;text-align:center;padding:6px 16px;border-radius:9px}.cw-seg-sm .cw-seg-title{font-size:12.5px}.cw-mcp-note{margin:0;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp .cw-add-sub{margin-top:0}.cw-subfield{margin:-2px 0 2px;padding:14px 16px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .02)}.cw-toggle-stack{gap:14px}.cw-toggle{display:flex;align-items:center;gap:14px;width:100%;padding:16px 18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));text-align:left;cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s,background .15s}.cw-toggle:hover{border-color:hsl(var(--ring) / .25)}.cw-toggle.is-on{border-color:hsl(var(--primary) / .4);box-shadow:0 1px 2px hsl(var(--foreground) / .04)}.cw-toggle-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));transition:background .15s,color .15s}.cw-toggle.is-on .cw-toggle-icon{background:hsl(var(--primary) / .1);color:hsl(var(--primary))}.cw-toggle-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-toggle-title{font-size:14px;font-weight:600}.cw-toggle-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-switch{flex-shrink:0;display:flex;align-items:center;width:42px;height:24px;padding:2px;border-radius:999px;background:hsl(var(--border));transition:background .18s}.cw-toggle.is-on .cw-switch{background:hsl(var(--primary));justify-content:flex-end}.cw-switch-knob{display:block;width:20px;height:20px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .2)}.cw-sub-list{display:flex;flex-direction:column;gap:14px}.cw-sub{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .03)}.cw-sub-head{display:flex;align-items:center;justify-content:space-between}.cw-sub-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.cw-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-icon-btn:not(:disabled):hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-icon-btn:disabled{opacity:.35;cursor:not-allowed}.cw-icon-danger:not(:disabled):hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.cw-sub-head-actions{display:inline-flex;align-items:center;gap:2px}.cw-sub-list-wrap{display:flex;flex-direction:column}.cw-typeradio{display:flex}.cw-typeradio--row{position:relative;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:var(--cw-agent-type-gap);height:44px;width:100%;max-width:100%;padding:4px;overflow:visible;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-typeradio-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-agent-type-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-type-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-typeradio-item{position:relative;z-index:1;flex:1 1 0;min-width:0;min-height:34px;display:flex;align-items:center;justify-content:center;padding:7px 10px;border:none;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .16s,background .16s}.cw-typeradio-item:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-typeradio-item.is-disabled{color:hsl(var(--muted-foreground) / .45);cursor:not-allowed}.cw-typeradio-item.is-disabled:hover{background:transparent;color:hsl(var(--muted-foreground) / .45)}.cw-typeradio-disabled-hint{position:absolute;top:calc(100% + 17px);right:0;width:max-content;max-width:220px;padding:7px 10px;border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--popover));box-shadow:0 8px 24px hsl(var(--foreground) / .1);color:hsl(var(--popover-foreground));font-size:12px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-2px);transition:opacity .14s ease,transform .14s ease}.cw-typeradio-item.is-disabled:hover .cw-typeradio-disabled-hint,.cw-typeradio-item.is-disabled:focus .cw-typeradio-disabled-hint,.cw-typeradio-item.is-disabled:focus-visible .cw-typeradio-disabled-hint{opacity:1;transform:translateY(0)}.cw-typeradio-item.is-on{background:transparent;color:hsl(var(--foreground))}.cw-typeradio-item:has(.cw-typeradio-input:focus-visible){box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-typeradio-input{position:absolute;opacity:0;width:0;height:0}.cw-typeradio-title{min-width:0;white-space:normal;word-break:keep-all;font-size:clamp(11px,1.1vw,13px);font-weight:600;line-height:1.12;text-align:center}.cw-add-sub{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:14px;padding:12px;width:100%;border:1px dashed hsl(var(--border));border-radius:12px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13.5px;font-weight:500;cursor:pointer;transition:background .12s,color .12s,border-color .12s}.cw-add-sub:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-banner{display:flex;align-items:center;gap:8px;padding:11px 14px;border-radius:var(--radius);background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-review{display:flex;flex-direction:column;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;background:hsl(var(--card))}.cw-review-row{display:flex;gap:18px;padding:13px 16px;border-bottom:1px solid hsl(var(--border))}.cw-review-row:last-child{border-bottom:none}.cw-review-key{flex-shrink:0;width:110px;font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.cw-review-val{flex:1;min-width:0;font-size:13.5px}.cw-review-strong{font-weight:600}.cw-review-muted{color:hsl(var(--muted-foreground))}.cw-review-pre{margin:0;padding:10px 12px;background:hsl(var(--muted));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:200px;overflow-y:auto}.cw-review-chips,.cw-review-subs{display:flex;flex-wrap:wrap;gap:6px}.cw-tag{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:500}.cw-tag-on{background:#22c35d24;color:#1c7d3f}.cw-tag-off{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.cw-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:13.5px;font-weight:550;cursor:pointer;transition:background .13s,opacity .13s,border-color .13s,transform .1s}.cw-btn:active{transform:scale(.98)}.cw-btn-primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-btn-primary:hover:not(:disabled){opacity:.88}.cw-btn-primary:disabled{opacity:.4;cursor:default}.cw-btn-ghost{background:hsl(var(--background));border-color:hsl(var(--border));color:hsl(var(--foreground))}.cw-btn-ghost:hover{background:hsl(var(--accent))}.cw-btn-soft{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));flex-shrink:0}.cw-btn-soft:hover:not(:disabled){background:hsl(var(--accent))}.cw-btn-soft:disabled{opacity:.45;cursor:default}.cw-i{width:16px;height:16px;flex-shrink:0}.cw-i-sm{width:14px;height:14px}.cw-root-preview{height:100%}.cw-preview-body{flex:1;min-height:0;display:flex}.cw-preview-body>*{flex:1;min-height:0}.cw-skillhub{display:flex;flex-direction:column;gap:14px}.cw-skill-searchrow{display:flex;gap:8px}.cw-skill-searchbox{position:relative;flex:1;min-width:0;display:flex;align-items:center}.cw-skill-searchicon{position:absolute;left:11px;color:hsl(var(--muted-foreground));pointer-events:none}.cw-skill-input{padding-left:36px}.cw-skill-selected{display:flex;flex-direction:column;gap:8px}.cw-skill-selected-label{font-size:11.5px;font-weight:600;color:hsl(var(--muted-foreground))}.cw-skill-results{display:flex;flex-direction:column;gap:8px;max-height:472px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-skill-result{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s;min-height:72px;max-height:72px;overflow:hidden}.cw-skill-result:hover{background:hsl(var(--foreground) / .05)}.cw-skill-result.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-skill-result-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--muted-foreground));transition:background .12s,border-color .12s,color .12s}.cw-skill-result.is-on .cw-skill-result-icon{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-skill-result-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-skill-result-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground));word-break:break-word}.cw-skill-result-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-skill-result-repo{font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--muted-foreground));word-break:break-all}.cw-spin{animation:cw-spin .8s linear infinite}@keyframes cw-spin{to{transform:rotate(360deg)}}.cw-skillspane{display:flex;flex-direction:column;gap:10px}.cw-skill-add{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:600;transition:border-color .15s,background .15s,color .15s}.cw-skill-add:hover{border-color:hsl(var(--foreground) / .34);background:transparent;color:hsl(var(--foreground))}.cw-skill-add:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-skill-add-icon{flex-shrink:0;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}.cw-skill-dialog-backdrop{position:fixed;z-index:80;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:20px;background:#15181e47;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.cw-skill-dialog{width:min(680px,calc(100vw - 32px));height:min(640px,calc(100dvh - 40px));min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 72px #10131933}.cw-skill-dialog-head{flex-shrink:0;min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px 0 20px;border-bottom:1px solid hsl(var(--border))}.cw-skill-dialog-head h3{margin:0;font-size:16px;font-weight:650;letter-spacing:-.01em}.cw-skill-dialog-close{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-skill-dialog-close:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-skill-dialog-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px;padding:18px 20px 20px}.cw-skill-sourcetabs{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;height:44px;padding:4px;overflow:hidden;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-skill-tab-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-skill-tab-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-skill-tab-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-skill-pickertab{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:7px 10px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background .16s,color .16s}.cw-skill-pickertab:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-skill-pickertab.is-on{background:transparent;color:hsl(var(--foreground))}.cw-skill-pickertab:focus-visible{outline:none;box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-skill-tabbody{flex:1;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}.cw-selected-skill-list{display:flex;flex-direction:column;gap:7px;max-height:347px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-selected-skill-row{display:flex;align-items:center;gap:10px;min-width:0;min-height:52px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--card))}.cw-selected-skill-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-selected-skill-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-selected-skill-name{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-detail{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-remove{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-selected-skill-remove:hover{background:hsl(var(--destructive) / .09);color:hsl(var(--destructive))}.cw-advanced-section{overflow:hidden}.cw-advanced-disclosure{width:100%;display:flex;align-items:center;gap:10px;padding:0;border:0;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.cw-advanced-disclosure-title{font-size:17px;font-weight:650;letter-spacing:-.01em}.cw-advanced-disclosure-chevron{width:18px;height:18px;color:hsl(var(--muted-foreground));transition:transform .18s ease}.cw-advanced-disclosure-chevron.is-open{transform:rotate(90deg)}.cw-advanced-content{overflow:hidden}.cw-advanced-group{padding-top:20px}.cw-advanced-group+.cw-advanced-group{margin-top:22px}.cw-advanced-group-head{display:flex;align-items:center;margin-bottom:12px;color:hsl(var(--foreground));font-size:15px;font-weight:600}.cw-local-dropzone{display:flex;flex-direction:column;align-items:center;gap:9px;padding:18px 14px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .15s,color .15s}.cw-local-drop-icon{width:20px;height:20px;color:hsl(var(--muted-foreground))}.cw-local-dropzone.is-dragging{border-color:hsl(var(--foreground) / .48);color:hsl(var(--foreground))}.cw-local-drop-hint{margin:0;color:hsl(var(--muted-foreground));font-size:11.5px}.cw-local-dropzone.is-dragging .cw-local-drop-hint,.cw-local-dropzone.is-dragging .cw-local-drop-icon{color:hsl(var(--foreground))}.cw-local-hint{margin:0 0 8px;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-skillspace-header{display:flex;gap:8px;align-items:flex-start;margin-bottom:10px}.cw-skillspace-select{width:100%;flex:1;min-width:0}.cw-skillspace-console-link{flex-shrink:0;padding:9px 12px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-color:hsl(var(--primary))}.cw-skillspace-console-link .cw-i{display:block}.cw-skill-result-version{color:hsl(var(--muted-foreground));font-weight:400;font-size:11px;margin-left:4px}.cw-skill-result-repo .cw-i{vertical-align:-2px;margin-right:2px}@media (max-width: 1280px){.cw-debug{width:280px}.cw-tree{width:208px}}@media (max-width: 1080px){.cw-editor{flex-wrap:wrap;overflow-y:auto}.cw-tree{height:260px}.cw-detail{height:min(720px,calc(100dvh - 120px));min-height:560px}.cw-debug{flex:0 0 100%;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px;border-left:none;border-top:1px solid hsl(var(--border))}.cw-debug.is-collapsed{flex:0 0 48px;width:100%;min-width:0;height:48px;min-height:48px;align-items:flex-end;padding:7px 12px}.cw-debug.is-collapsed .cw-debug-expand{width:34px;min-height:34px}.cw-rail{display:none}.cw-lower{gap:0}.cw-detail .cw-form-col{max-width:100%}}@media (max-width: 860px){.cw-editor{flex-direction:column;flex-wrap:nowrap;overflow-x:hidden;overflow-y:auto}.cw-tree{width:100%;height:auto;max-height:220px;border-right:0;border-bottom:1px solid hsl(var(--border))}.cw-detail{flex:none;width:100%;height:min(720px,calc(100dvh - 120px));min-height:560px}.cw-typebar{padding-inline:12px}.cw-detail-scroll{padding:20px 12px 40px}.cw-debug{flex:none;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px}.cw-debug.is-collapsed{width:100%;height:48px;min-height:48px}.cw-center{gap:0;padding:24px 16px 64px}.cw-form-col{max-width:100%}}@media (max-width: 700px){.cw-typeradio-item{padding-inline:6px}.cw-typeradio-title{font-size:12.5px}}.tpl-root{flex:1;min-height:0;display:flex;flex-direction:column}.tpl-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 18px;padding:6px 10px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,color .12s}.tpl-back:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.tpl-back .icon{width:15px;height:15px}.tpl-scroll{flex:1;min-height:0;overflow-y:auto;padding:24px 28px 40px}.tpl-scroll--detail{padding-left:14px;padding-right:14px}.tpl-head{max-width:720px;margin:8px auto 28px;text-align:center}.tpl-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;max-width:1100px;margin:0 auto}.tpl-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;height:100%;padding:16px 16px 18px;text-align:left;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;transition:background .14s,border-color .14s}.tpl-card:hover{background:hsl(var(--foreground) / .05)}.tpl-card:active{background:hsl(var(--foreground) / .08)}.tpl-card-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;color:hsl(var(--muted-foreground))}.tpl-card-icon .icon{width:20px;height:20px}.tpl-card-name{font-size:14px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground))}.tpl-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.tpl-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.tpl-tags--detail{margin-top:0}.tpl-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border:1px solid hsl(var(--border));border-radius:999px;background:none;color:hsl(var(--muted-foreground));font-size:11.5px;white-space:nowrap}.tpl-tag-icon{width:12px;height:12px;flex-shrink:0}.tpl-detail{max-width:720px;margin:0 auto;display:flex;flex-direction:column;gap:20px}.tpl-detail-head{display:flex;align-items:flex-start;gap:14px}.tpl-detail-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;border:1px solid hsl(var(--border));border-radius:12px;background:none;color:hsl(var(--muted-foreground))}.tpl-detail-icon .icon{width:22px;height:22px}.tpl-detail-headtext{min-width:0}.tpl-detail-name{font-size:20px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-detail-desc{margin-top:4px;font-size:13.5px;line-height:1.6;color:hsl(var(--muted-foreground))}.tpl-field{display:flex;flex-direction:column;gap:8px}.tpl-field-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.tpl-input{width:100%;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .15s}.tpl-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.tpl-instruction{margin:0;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .03);color:hsl(var(--foreground));font-size:13px;line-height:1.7;white-space:pre-wrap}.tpl-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px}.tpl-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.tpl-meta-key{flex-shrink:0;color:hsl(var(--muted-foreground))}.tpl-meta-val{text-align:right;word-break:break-word;color:hsl(var(--foreground))}.tpl-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.tpl-subagents{display:flex;flex-direction:column;gap:10px}.tpl-subagent{padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background))}.tpl-subagent-top{display:flex;align-items:center;gap:8px}.tpl-subagent-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.tpl-subagent-tools{margin-left:auto;font-size:11px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.tpl-subagent-desc{margin-top:5px;font-size:12.5px;line-height:1.55;color:hsl(var(--muted-foreground))}.tpl-create{display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:flex-start;margin-top:4px;padding:11px 20px;border:none;border-radius:12px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.tpl-create:hover{opacity:.88}.tpl-create:active{transform:scale(.98)}.tpl-create .icon{width:17px;height:17px}@media (max-width: 560px){.tpl-meta-grid{grid-template-columns:1fr}.tpl-scroll{padding:20px 16px 32px}}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}.wfb{flex:1;min-height:0;display:flex;flex-direction:column;height:100%}.wfb-create{position:absolute;top:14px;right:14px;z-index:5;display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border:1px solid transparent;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:550;cursor:pointer;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .4);transition:opacity .15s,transform .1s}.wfb-create:hover:not(:disabled){opacity:.88}.wfb-create:active:not(:disabled){transform:scale(.97)}.wfb-create:disabled{opacity:.4;cursor:default}.wfb-grid{flex:1;min-height:0;display:grid;grid-template-columns:248px minmax(0,1fr) 288px}.wfb-section-label{margin:4px 0 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.wfb-field{display:flex;flex-direction:column;gap:5px}.wfb-field-label{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-input{width:100%;border:1px solid hsl(var(--border));border-radius:var(--radius);padding:8px 10px;font:inherit;font-size:13px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.wfb-input::placeholder{color:hsl(var(--muted-foreground) / .7)}.wfb-input:focus{outline:none;border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.wfb-input--error,.wfb-input--error:focus{border-color:hsl(var(--destructive));box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.wfb-field-error,.wfb-field-help{font-size:11px;line-height:1.4}.wfb-field-error{color:hsl(var(--destructive))}.wfb-field-help{color:hsl(var(--muted-foreground))}.wfb-textarea{resize:vertical;min-height:52px;line-height:1.5}.wfb-palette{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-right:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-types{display:flex;flex-direction:column;gap:6px}.wfb-type{display:flex;align-items:center;gap:10px;width:100%;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:border-color .12s,background .12s}.wfb-type:hover{border-color:hsl(var(--ring) / .3)}.wfb-type .icon{color:hsl(var(--muted-foreground))}.wfb-type--active{border-color:hsl(var(--ring) / .55);background:hsl(var(--accent))}.wfb-type--active .icon{color:#7c48f4}.wfb-type-text{display:flex;flex-direction:column;gap:1px;min-width:0}.wfb-type-name{font-size:13px;font-weight:550}.wfb-type-desc{font-size:11px;color:hsl(var(--muted-foreground))}.wfb-palette-item{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));cursor:grab;transition:border-color .12s,background .12s}.wfb-palette-item:hover{border-color:hsl(var(--ring) / .4);background:hsl(var(--accent))}.wfb-palette-item:active{cursor:grabbing}.wfb-grip{color:hsl(var(--muted-foreground) / .7)}.wfb-palette-item-text{font-size:13px;font-weight:500}.wfb-add{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;padding:9px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background .12s}.wfb-add:hover{background:hsl(var(--accent))}.wfb-hint{margin-top:auto;padding-top:10px;font-size:11.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.wfb-canvas{position:relative;min-width:0;height:100%;background:hsl(var(--canvas))}.wfb-canvas .react-flow{background:transparent}.wfb-node{display:flex;align-items:center;gap:10px;width:188px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .2);transition:border-color .12s,box-shadow .12s}.wfb-node--selected{border-color:hsl(var(--ring) / .6);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.wfb-node-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:9px;background:hsl(var(--secondary));color:#7c48f4}.wfb-node-icon--sm{width:24px;height:24px;border-radius:7px}.wfb-node-body{min-width:0;display:flex;flex-direction:column;gap:2px}.wfb-node-name{font-size:13px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-node-desc{font-size:11px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-handle{width:9px!important;height:9px!important;background:hsl(var(--background))!important;border:2px solid hsl(258 89% 62%)!important}.wfb-handle:hover{background:#7c48f4!important}.wfb-canvas .react-flow__controls{border-radius:10px;overflow:hidden;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .25);border:1px solid hsl(var(--border))}.wfb-canvas .react-flow__controls-button{background:hsl(var(--background));border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground))}.wfb-canvas .react-flow__controls-button:hover{background:hsl(var(--accent))}.wfb-canvas .react-flow__controls-button svg{fill:hsl(var(--foreground))}.wfb-canvas .react-flow__edge-path{stroke:hsl(var(--muted-foreground) / .55);stroke-width:1.5}.wfb-canvas .react-flow__edge.selected .react-flow__edge-path,.wfb-canvas .react-flow__edge:hover .react-flow__edge-path{stroke:#7c48f4}.wfb-canvas .react-flow__arrowhead *{fill:hsl(var(--muted-foreground) / .55)}.wfb-minimap{border:1px solid hsl(var(--border));border-radius:10px;overflow:hidden}.wfb-inspector{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-left:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-inspector-head{display:flex;align-items:center;justify-content:space-between}.wfb-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:7px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.wfb-icon-btn:hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.wfb-inspector-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;padding-top:12px;border-top:1px solid hsl(var(--border))}.wfb-meta-key{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-meta-val{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;padding:2px 7px;border-radius:6px;background:hsl(var(--muted));color:hsl(var(--foreground))}.wfb-inspector-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:hsl(var(--muted-foreground));font-size:13px}.wfb-empty-icon{width:32px;height:32px;opacity:.4;margin-bottom:4px}.wfb-inspector-empty p{margin:0}.wfb-empty-sub{font-size:12px;color:hsl(var(--muted-foreground) / .8)}@media (max-width: 900px){.wfb-grid{grid-template-columns:220px minmax(0,1fr)}.wfb-inspector{display:none}}.skill-workspace{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:34px clamp(18px,4vw,54px) 44px;background:hsl(var(--panel))}.skill-workspace__intro{width:min(1180px,100%);margin:0 auto 32px}.skill-workspace__intro h1{margin:0;font-size:22px;font-weight:620;letter-spacing:-.025em}.skill-workspace__poll-error{width:min(1180px,100%);margin:0 auto 14px;padding:9px 11px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px}.skill-workspace__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1;min-height:0;gap:clamp(36px,5vw,72px);width:min(1180px,100%);margin:0 auto}.skill-candidate{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;background:transparent}.skill-candidate:nth-child(2):before{position:absolute;top:0;bottom:0;left:calc(clamp(36px,5vw,72px)/-2);width:1px;background:hsl(var(--border));content:""}.skill-candidate__header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:0 0 12px;border-bottom:1px solid hsl(var(--border))}.skill-candidate__header h2{margin:0;font-family:inherit;font-size:13px;font-weight:500;line-height:1.4;letter-spacing:0}.skill-candidate__selected{padding:3px 7px;border-radius:999px;background:hsl(var(--primary) / .1);color:hsl(var(--primary));font-size:10px}.skill-candidate__view{min-height:0;overflow-y:auto;padding-right:8px;scrollbar-gutter:stable;animation:skill-view-in .18s ease-out}.skill-candidate__status{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:46px;padding:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.4;text-align:left}.skill-candidate--succeeded .skill-candidate__status{color:#2a844f}.skill-candidate--failed .skill-candidate__status{color:hsl(var(--destructive))}.skill-candidate__status-icon{display:inline-grid;place-items:center;width:18px;height:18px}.skill-candidate__status-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__spinner{animation:skill-spin .9s linear infinite}.skill-candidate__spinner circle{opacity:.2}.skill-candidate__duration{margin-left:auto;font-size:10px;color:hsl(var(--muted-foreground))}.skill-conversation{min-height:220px;margin:0 0 16px;padding:8px 0 18px}.skill-conversation .bubble{font-size:13px;line-height:1.65}.skill-conversation .think-head,.skill-conversation .tool-head,.skill-conversation .builtin-tool-head{display:grid;grid-template-columns:20px minmax(0,1fr) 13px;align-items:center;gap:8px;width:100%;min-height:38px;padding:4px 0;text-align:left}.skill-conversation .think-label,.skill-conversation .tool-name,.skill-conversation .builtin-tool-label{min-width:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere;text-align:left}.skill-conversation .think-icon,.skill-conversation .tool-icon,.skill-conversation .builtin-tool-icon{width:20px;height:26px}.skill-conversation .chev,.skill-conversation .tool-chevron,.skill-conversation .builtin-tool-chevron{justify-self:end}.skill-candidate__error{margin:0 0 14px;padding:9px 10px;border-radius:7px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:11px;line-height:1.5}.skill-candidate__view-actions{display:flex;justify-content:flex-start;padding:4px 0 20px}.skill-candidate__preview-nav{display:flex;align-items:center;min-height:46px}.skill-candidate__back{display:inline-flex;align-items:center;gap:6px;padding:5px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer}.skill-candidate__back:hover{color:hsl(var(--foreground))}.skill-candidate__back svg,.skill-action--preview svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__result{padding:0 0 20px}.skill-candidate__summary{display:grid;grid-template-columns:1fr .55fr .7fr;gap:8px;margin-bottom:13px}.skill-candidate__summary>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:9px 10px;border-radius:8px;background:hsl(var(--muted) / .55)}.skill-candidate__summary span{color:hsl(var(--muted-foreground));font-size:9px;text-transform:uppercase;letter-spacing:.05em}.skill-candidate__summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:560}.skill-candidate__summary .is-valid{color:#2a844f}.skill-candidate__summary .is-invalid{color:hsl(var(--destructive))}.skill-candidate__description{margin:0 0 13px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.skill-validation{margin-bottom:12px;font-size:11px;color:hsl(var(--muted-foreground))}.skill-validation summary{margin-bottom:6px;cursor:pointer;color:hsl(var(--foreground))}.skill-files{overflow:hidden;margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:9px}.skill-files__tabs{display:flex;gap:2px;overflow-x:auto;padding:5px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--muted) / .34)}.skill-files__tabs button{flex:0 0 auto;max-width:180px;overflow:hidden;text-overflow:ellipsis;padding:4px 7px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:10px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer}.skill-files__tabs button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 3px hsl(var(--foreground) / .08)}.skill-files__content{margin:0;overflow-x:auto;padding:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:10.5px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-word}.skill-files__truncated{margin:0;padding:8px 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:10px}.skill-files__unavailable{padding:20px 12px;color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.skill-candidate__actions{display:flex;flex-wrap:wrap;gap:7px}.skill-action{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px;text-decoration:none;cursor:pointer}.skill-action:hover:not(:disabled){background:hsl(var(--accent))}.skill-action:disabled{cursor:default;opacity:.42}.skill-action--select{border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-action--select[aria-pressed=true]{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.skill-action--preview{gap:7px;border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-publish-form{display:flex;flex-direction:column;gap:9px;margin-top:12px;padding:11px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--muted) / .28)}.skill-publish-form label{display:flex;flex-direction:column;gap:4px;color:hsl(var(--muted-foreground));font-size:10px}.skill-publish-form input{min-width:0;height:31px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px}.skill-publish-form input:focus{border-color:hsl(var(--primary) / .55)}.skill-publish-form__optional{display:grid;grid-template-columns:1fr 1fr;gap:8px}@keyframes skill-spin{to{transform:rotate(360deg)}}@keyframes skill-view-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 780px){.skill-workspace{overflow-y:auto;padding:24px 12px 32px}.skill-workspace__grid{flex:none;grid-template-columns:1fr;gap:32px}.skill-candidate{display:block}.skill-candidate__view{overflow:visible;padding-right:0}.skill-candidate:nth-child(2){padding-top:32px;border-top:1px solid hsl(var(--border))}.skill-candidate:nth-child(2):before{display:none}.skill-workspace__intro h1{font-size:20px}.skill-publish-form__optional{grid-template-columns:1fr}.skill-action{min-height:44px}}@media (prefers-reduced-motion: reduce){.skill-candidate__view,.skill-candidate__spinner{animation:none}}.sandbox-entry{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid hsl(268 58% 58% / .34);background:#f4eefb;color:#5b318c;font:inherit;font-weight:600;cursor:pointer;transition:background-color .14s ease-out,border-color .14s ease-out}.sandbox-entry svg{width:15px;height:15px;flex:0 0 auto}.sandbox-entry:hover:not(:disabled){border-color:#803ecc85;background:#ece2f9}.sandbox-entry:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-entry:disabled{cursor:default;opacity:.72}.sandbox-entry--composer{min-height:30px;padding:0 13px;border-radius:999px;font-size:12px}.sandbox-entry--header{min-height:32px;padding:0 10px;border-radius:7px;font-size:12px}.sandbox-entry.is-active{border-style:dashed}.sandbox-new-chat-entry{display:flex;justify-content:center;min-height:30px}.composer-slot{width:100%;min-width:0}.sandbox-composer-wrap{position:relative;z-index:2}.sandbox-session-warning{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;width:calc(100% - 32px);max-width:736px;min-height:24px;margin:0 auto 6px;color:#c7840f;font-size:12px}.sandbox-session-warning-dot{display:none}.sandbox-session-warning-copy{grid-column:2;white-space:nowrap;text-align:center}.sandbox-session-warning button{grid-column:3;justify-self:end;padding:3px 5px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-weight:580;cursor:pointer}.sandbox-session-warning button:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.sandbox-composer-wrap .composer-box{display:grid;grid-template-columns:1fr auto;grid-template-rows:minmax(44px,auto) 36px;align-items:center;gap:2px 8px;min-height:104px;padding:10px 8px 8px;border-radius:24px}.sandbox-composer-wrap .comp-input{grid-row:1;grid-column:1 / -1;align-self:stretch;width:100%;min-height:44px;padding:8px 10px 4px}.sandbox-composer-wrap .composer-menu-wrap{grid-row:2;grid-column:1;justify-self:start}.sandbox-composer-wrap .comp-send{grid-row:2;grid-column:2}.main.is-sandbox-session{position:relative;isolation:isolate;background:linear-gradient(to bottom,#f4edfd,#f8f3fc,#fbf8fc 48%,hsl(var(--panel)) 76%)}.main.is-sandbox-session:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;background:radial-gradient(ellipse 78% 40% at 18% 0%,hsl(244 82% 84% / .24),transparent 70%),radial-gradient(ellipse 70% 36% at 52% 0%,hsl(284 70% 86% / .2),transparent 72%),radial-gradient(ellipse 64% 38% at 88% 2%,hsl(324 66% 88% / .16),transparent 72%),linear-gradient(to bottom,hsl(var(--panel) / 0),hsl(var(--panel) / .18) 42%,hsl(var(--panel)) 76%);filter:blur(24px);opacity:1;animation:sandbox-smoke-enter .42s ease-out both}.main.is-sandbox-session>*{position:relative;z-index:1}.sandbox-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .24);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.sandbox-dialog{width:min(440px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 20px 56px hsl(var(--foreground) / .2);animation:sandbox-dialog-enter .18s ease-out both}.sandbox-dialog-visual{position:relative;display:grid;height:112px;place-items:center;overflow:hidden;border-bottom:1px solid hsl(var(--border));background:radial-gradient(circle at 35% 70%,hsl(256 68% 78% / .34),transparent 40%),radial-gradient(circle at 68% 30%,hsl(276 66% 72% / .28),transparent 42%),#f9f8fc}.sandbox-dialog-orbit{position:absolute;width:104px;height:44px;border:1px solid hsl(268 52% 54% / .22);border-radius:50%;transform:rotate(-12deg)}.sandbox-dialog-icon{display:grid;width:46px;height:46px;place-items:center;border:1px solid hsl(268 58% 58% / .3);border-radius:14px;background:hsl(var(--panel) / .9);color:#68389f;box-shadow:0 8px 24px #6c38a824}.sandbox-dialog-icon svg{width:23px;height:23px}.sandbox-spinner{width:21px;height:21px;border:2px solid hsl(268 48% 42% / .2);border-top-color:currentColor;border-radius:50%;animation:sandbox-spin .8s linear infinite}.sandbox-dialog-copy{padding:22px 24px 20px;text-align:center}.sandbox-dialog-copy h2{margin:0 0 8px;color:hsl(var(--foreground));font-size:17px;font-weight:650}.sandbox-dialog-copy p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.65}.sandbox-dialog-copy .sandbox-dialog-error{color:hsl(var(--destructive))}.sandbox-dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.sandbox-dialog-actions button{min-width:80px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.sandbox-dialog-actions button:hover{background:hsl(var(--secondary))}.sandbox-dialog-actions button:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-dialog-actions .is-primary{border-color:#68389f;background:#68389f;color:hsl(var(--primary-foreground))}.sandbox-dialog-actions .is-primary:hover{background:#5b318c}@keyframes sandbox-spin{to{transform:rotate(360deg)}}@keyframes sandbox-dialog-enter{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sandbox-smoke-enter{0%{opacity:0}to{opacity:1}}@media (max-width: 700px){.sandbox-entry--header span{display:none}.sandbox-entry--header{width:32px;padding:0}.sandbox-session-warning{grid-template-columns:1fr auto;width:calc(100% - 16px)}.sandbox-session-warning-copy{grid-column:1;white-space:normal;text-align:left}.sandbox-session-warning button{grid-column:2}}@media (prefers-reduced-motion: reduce){.sandbox-entry,.sandbox-dialog,.main.is-sandbox-session:before{animation:none;transition:none}}.PhotoView-Portal{direction:ltr;height:100%;left:0;overflow:hidden;position:fixed;top:0;touch-action:none;width:100%;z-index:2000}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes PhotoView__delayIn{0%,50%{opacity:0}to{opacity:1}}.PhotoView__Spinner{animation:PhotoView__delayIn .4s linear both}.PhotoView__Spinner svg{animation:PhotoView__rotate .6s linear infinite}.PhotoView__Photo{cursor:grab;max-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.PhotoView__Photo:active{cursor:grabbing}.PhotoView__icon{display:inline-block;left:0;position:absolute;top:0;transform:translate(-50%,-50%)}.PhotoView__PhotoBox,.PhotoView__PhotoWrap{bottom:0;direction:ltr;left:0;position:absolute;right:0;top:0;touch-action:none;width:100%}.PhotoView__PhotoWrap{overflow:hidden;z-index:10}.PhotoView__PhotoBox{transform-origin:left top}@keyframes PhotoView__fade{0%{opacity:0}to{opacity:1}}.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,.PhotoView-Slider__clean .PhotoView-Slider__Overlay,.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover{opacity:0}.PhotoView-Slider__Backdrop{background:#000;height:100%;left:0;position:absolute;top:0;transition-property:background-color;width:100%;z-index:-1}.PhotoView-Slider__fadeIn{animation:PhotoView__fade linear both;opacity:0}.PhotoView-Slider__fadeOut{animation:PhotoView__fade linear reverse both;opacity:0}.PhotoView-Slider__BannerWrap{align-items:center;background-color:#00000080;color:#fff;display:flex;height:44px;justify-content:space-between;left:0;position:absolute;top:0;transition:opacity .2s ease-out;width:100%;z-index:20}.PhotoView-Slider__BannerWrap:hover{opacity:1}.PhotoView-Slider__Counter{font-size:14px;opacity:.75;padding:0 10px}.PhotoView-Slider__BannerRight{align-items:center;display:flex;height:100%}.PhotoView-Slider__toolbarIcon{fill:#fff;box-sizing:border-box;cursor:pointer;opacity:.75;padding:10px;transition:opacity .2s linear}.PhotoView-Slider__toolbarIcon:hover{opacity:1}.PhotoView-Slider__ArrowLeft,.PhotoView-Slider__ArrowRight{align-items:center;bottom:0;cursor:pointer;display:flex;height:100px;justify-content:center;margin:auto;opacity:.75;position:absolute;top:0;transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;z-index:20}.PhotoView-Slider__ArrowLeft:hover,.PhotoView-Slider__ArrowRight:hover{opacity:1}.PhotoView-Slider__ArrowLeft svg,.PhotoView-Slider__ArrowRight svg{fill:#fff;background:#0000004d;box-sizing:content-box;height:24px;padding:10px;width:24px}.PhotoView-Slider__ArrowLeft{left:0}.PhotoView-Slider__ArrowRight{right:0}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--destructive: 0 72% 51%;--border: 240 5.9% 90%;--ring: 240 5.9% 10%;--radius: .5rem;--canvas: 240 5% 97.3%;--panel: 0 0% 100%;color-scheme:light;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0;overflow:hidden;overscroll-behavior:none}#root{position:fixed;top:0;right:0;bottom:0;left:0}body{background:hsl(var(--canvas));color:hsl(var(--foreground));-webkit-font-smoothing:antialiased}.icon{width:16px;height:16px;flex-shrink:0}.spin{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}*{scrollbar-width:thin;scrollbar-color:hsl(var(--foreground) / .18) transparent}*::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:hsl(var(--foreground) / .18);border-radius:999px;border:2px solid transparent;background-clip:content-box}*::-webkit-scrollbar-thumb:hover{background:hsl(var(--foreground) / .32);background-clip:content-box}*::-webkit-scrollbar-corner{background:transparent}.layout{display:flex;height:100vh;height:100dvh;min-height:0;overflow:hidden}.main-shell{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.sidebar{width:236px;height:100%;min-height:0;flex-shrink:0;display:flex;flex-direction:column;background:transparent;position:relative;transition:width .22s cubic-bezier(.22,1,.36,1)}.sidebar.is-collapsed{width:56px}@media (max-width: 860px){.sidebar{width:204px}}.sidebar-top{display:flex;flex-direction:column;gap:2px;padding:0 10px 8px}.sidebar-brand-row{height:54px;min-height:54px;display:flex;align-items:center;gap:6px;padding:0 0 0 10px}.brand{flex:1;min-width:0;display:flex;align-items:center;gap:9px;font-weight:600;font-size:15px;letter-spacing:-.01em}.brand-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand-logo,.brand-title,.login-brand-logo,.login-brand,.login-title{cursor:text}.sidebar-collapse-toggle{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.sidebar-collapse-toggle:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.sidebar-collapse-toggle .icon{width:17px;height:17px}.sidebar.is-collapsed .sidebar-brand-row{justify-content:center;padding-inline:0}.sidebar.is-collapsed .brand{display:none}.brand-logo,.login-brand-logo{display:block;width:20px;min-width:20px;max-width:20px;height:20px;min-height:20px;max-height:20px;flex:0 0 20px;object-fit:contain}.new-chat{display:flex;align-items:center;gap:10px;padding:10px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;cursor:pointer;transition:background .12s}.new-chat .icon{width:18px;height:18px}.new-chat:hover{background:hsl(var(--foreground) / .05)}.sidebar.is-collapsed .new-chat,.sidebar.is-collapsed .agent-row{align-self:center;width:36px;height:36px;min-height:36px;gap:0;padding:9px;overflow:hidden;white-space:nowrap}.sidebar.is-collapsed .agent-row-name,.sidebar.is-collapsed .agent-row-region,.sidebar.is-collapsed .agent-row-chev,.sidebar.is-collapsed .sidebar-nav-label,.sidebar.is-collapsed .sidebar-history{display:none}.agent-row{display:flex;align-items:center;gap:9px;margin:2px 0 6px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,border-color .12s}.agent-row:hover{background:hsl(var(--foreground) / .04);border-color:hsl(var(--foreground) / .2)}.agent-row--empty{border-color:#e2b3ac;background:#fcf6f5;color:#905047}.agent-row--empty .agent-row-lead{color:#bc6052}.agent-row--empty .agent-row-chev{color:#ac7e77}.agent-row--empty:hover{border-color:#d6998f;background:#faf1ef}.agent-row-lead{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0;transform:translateY(3px)}.agent-row--connected .agent-row-lead{color:#328f54}.agent-row-name{flex:1;min-width:0;text-align:left;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agent-row-region{flex-shrink:0;padding:1px 6px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10px;font-weight:550;line-height:1.5}.agent-row-chev{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .15s;flex-shrink:0;transform:translateY(1px)}.agent-row-chev.open{transform:translateY(1px) rotate(90deg)}.agentsel{--agentsel-available-width: calc(100vw - 250px) ;container-type:inline-size;position:absolute;left:100%;top:8px;z-index:32;display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;align-content:stretch;gap:8px;width:min(320px,var(--agentsel-available-width));background:transparent;border:0;margin-left:6px;overflow:visible;animation:agentsel-in .16s ease-out}.agentsel.has-detail{width:min(688px,var(--agentsel-available-width))}.sidebar.is-collapsed .agentsel{--agentsel-available-width: calc(100vw - 70px) }.agentsel-main{width:320px;height:100%;max-height:100%;min-width:min(240px,100%);flex:1 1 320px;display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 40px hsl(var(--foreground) / .14)}.agentsel-detail{width:360px;height:100%;max-height:100%;min-width:min(280px,100%);flex:1 1 360px;display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 40px hsl(var(--foreground) / .14)}.agentsel-preview{animation:agentsel-preview-in .16s cubic-bezier(.22,1,.36,1)}@container (max-width: 527px){.agentsel.has-detail>.agentsel-main,.agentsel.has-detail>.agentsel-detail{height:calc((100% - 8px)/2);max-height:calc((100% - 8px)/2)}}.agentsel-preview-head{padding:7px 14px}.agentsel-detail-tabs{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;height:36px;padding:3px;overflow:hidden;border:1px solid hsl(var(--border) / .58);border-radius:9px;background:hsl(var(--secondary) / .58)}.agentsel-detail-tabs-slider{position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc(50% - 3px);border:1px solid hsl(var(--border) / .72);border-radius:6px;background:hsl(var(--background));transform:translate(0);transition:transform .24s cubic-bezier(.22,1,.36,1)}.agentsel-detail-tabs.is-runtime .agentsel-detail-tabs-slider{transform:translate(100%)}.agentsel-detail-tabs button{position:relative;z-index:1;min-width:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;font-weight:550;text-align:center;cursor:pointer;transition:color .16s}.agentsel-detail-tabs button:hover,.agentsel-detail-tabs button[aria-selected=true]{color:hsl(var(--foreground))}.agentsel-detail-tabs button:focus-visible{outline:2px solid hsl(var(--ring) / .24);outline-offset:-2px}.agentsel-tab-panel{display:flex;flex:1;min-height:0;min-width:0;flex-direction:column}.agentsel-tab-panel[hidden]{display:none}.agentsel-detail-body{flex:1;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:12px 14px}.agentsel-panel-state{display:flex;align-items:center;justify-content:center;gap:7px;min-height:120px;color:hsl(var(--muted-foreground));font-size:12.5px}.agentsel-panel-state .icon{width:15px;height:15px}.agentsel-panel-empty{display:flex;flex-direction:column;gap:6px;padding:24px 8px;text-align:center;color:hsl(var(--muted-foreground));font-size:12.5px;overflow-wrap:anywhere}.agentsel-panel-empty small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground) / .75);font-size:11px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:3}.agentsel-identity,.agentsel-runtime-identity{display:flex;align-items:flex-start;gap:10px;min-width:0}.agentsel-identity{padding-bottom:12px}.agentsel-identity-icon,.agentsel-runtime-identity>.icon{width:18px;height:18px;margin-top:1px;flex-shrink:0;color:hsl(var(--muted-foreground))}.agentsel-identity-copy,.agentsel-runtime-identity>div{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}.agentsel-identity-copy strong,.agentsel-runtime-identity strong{overflow:hidden;color:hsl(var(--foreground));font-size:13.5px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.agentsel-identity-copy span,.agentsel-runtime-identity span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.agentsel-runtime-identity{margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid hsl(var(--border))}.agentsel-info-section{min-width:0;padding:11px 0;border-top:1px solid hsl(var(--border))}.agentsel-info-section h3{display:flex;align-items:center;gap:6px;margin:0 0 8px;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:600}.agentsel-info-section h3 .icon{width:13px;height:13px}.agentsel-description{max-height:104px;margin:0;overflow-y:auto;white-space:pre-wrap;overflow-wrap:anywhere;color:hsl(var(--foreground));font-size:12.5px;line-height:1.65}.agentsel-chips{display:flex;flex-wrap:wrap;gap:5px;min-width:0}.agentsel-chip{display:block;max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--canvas) / .7);color:hsl(var(--foreground));font-size:11.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.agentsel-info-list{display:flex;min-width:0;flex-direction:column;gap:6px}.agentsel-info-list-item{display:flex;min-width:0;flex-direction:column;gap:2px;padding:7px 8px;border-radius:6px;background:hsl(var(--canvas) / .72)}.agentsel-info-list-item>strong,.agentsel-component-head>strong{overflow:hidden;font-size:12px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.agentsel-info-list-item>span{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:3}.agentsel-component-head{display:flex;align-items:center;gap:8px;min-width:0}.agentsel-component-head>strong{flex:1;min-width:0}.agentsel-component-head>span{flex-shrink:0;padding:1px 5px;border-radius:4px;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));font-size:10px}.agentsel-kv{margin:0;display:flex;flex-direction:column;gap:8px}.agentsel-kv-row{display:grid;grid-template-columns:52px 1fr;gap:8px;font-size:12.5px}.agentsel-kv-row dt{color:hsl(var(--muted-foreground))}.agentsel-kv-row dd{min-width:0;margin:0;color:hsl(var(--foreground));overflow-wrap:anywhere}.agentsel-envs{margin-top:14px}.agentsel-envs-head{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));margin-bottom:6px}.agentsel-env{display:flex;flex-direction:column;gap:1px;margin-bottom:6px}.agentsel-env-k{overflow-wrap:anywhere;font-family:inherit;font-size:11px;color:hsl(var(--muted-foreground))}.agentsel-env-v{overflow-wrap:anywhere;font-family:inherit;font-size:11.5px;color:hsl(var(--foreground))}.agentsel-head-actions{display:flex;align-items:center;gap:2px}.agentsel-pager{display:flex;align-items:center;justify-content:center;gap:14px;flex:0 0 36px;padding:6px 10px 0}.agentsel-pager button{display:flex;border:none;background:none;padding:2px;cursor:pointer;color:hsl(var(--muted-foreground))}.agentsel-pager button:hover:not(:disabled){color:hsl(var(--foreground))}.agentsel-pager button:disabled{opacity:.3;cursor:default}.agentsel-pager button .icon{width:18px;height:18px}.agentsel-pager-label{font-size:13px;color:hsl(var(--muted-foreground));min-width:40px;text-align:center}@keyframes agentsel-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes agentsel-preview-in{0%{opacity:0;transform:translate(-6px)}to{opacity:1;transform:translate(0)}}.agentsel-head{display:flex;align-items:center;justify-content:space-between;height:52px;flex-shrink:0;box-sizing:border-box;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.agentsel-title{display:flex;min-width:0;align-items:center;gap:8px;overflow:hidden;font-weight:600;font-size:14px;text-overflow:ellipsis;white-space:nowrap}.agentsel-title .icon{width:17px;height:17px}.agentsel-refresh{display:flex;border:none;background:none;cursor:pointer;color:hsl(var(--muted-foreground));padding:4px;border-radius:6px}.agentsel-refresh:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.agentsel-refresh .icon{width:16px;height:16px}.agentsel-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:10px}.agentsel-body--cloud{display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}.agentsel-tools{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}.agentsel-search{display:flex;align-items:center;gap:8px;border:1px solid hsl(var(--border));border-radius:8px;padding:7px 10px}.agentsel-search .icon{width:15px;height:15px;color:hsl(var(--muted-foreground))}.agentsel-search input{flex:1;border:none;outline:none;background:none;font:inherit;font-size:13px;color:hsl(var(--foreground))}.agentsel-regions{display:grid;grid-template-columns:repeat(2,1fr);gap:2px;padding:2px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--canvas) / .55)}.agentsel-regions button{height:27px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;outline:none;cursor:pointer}.agentsel-regions button:hover{color:hsl(var(--foreground))}.agentsel-regions button:focus-visible{box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.agentsel-regions button.active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.agentsel-mine{display:flex;align-items:center;gap:7px;font-size:12.5px;color:hsl(var(--muted-foreground));cursor:pointer}.agentsel-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.agentsel-listwrap{position:relative;min-height:220px}.agentsel-body--cloud .agentsel-listwrap{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:auto}.agentsel-loading{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);border-radius:8px}.agentsel-loading .icon{width:16px;height:16px}.agentsel-item{width:100%;display:flex;align-items:center;gap:9px;min-height:46px;padding:4px 0;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13.5px;text-align:left}.agentsel-main button.agentsel-item{min-height:0;padding:9px 10px;cursor:pointer}.agentsel-item:hover{background:hsl(var(--foreground) / .05);box-shadow:none;transform:none}.agentsel-runtime-item:hover{background:none}.agentsel-item.active{background:hsl(var(--foreground) / .08);font-weight:600}.agentsel-item.is-previewed{background:hsl(var(--foreground) / .055)}.agentsel-runtime-item.active,.agentsel-runtime-item.is-previewed{background:none}.agentsel-item .icon{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-item-main{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}.agentsel-item-name{min-width:0;overflow:hidden;font-size:13px;font-weight:550;text-overflow:ellipsis;white-space:nowrap}.agentsel-item-meta{display:flex;align-items:center;gap:4px;min-width:0}.agentsel-item-actions{display:flex;align-items:center;gap:1px;flex-shrink:0}.agentsel-connect,.agentsel-info{border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.agentsel-connect{min-width:38px;height:28px;padding:0 5px;font-size:11.5px;font-weight:550}.agentsel-info{display:grid;width:28px;height:28px;padding:0;place-items:center}.agentsel-connect:hover:not(:disabled),.agentsel-info:hover{background:hsl(var(--foreground) / .07);color:hsl(var(--foreground));box-shadow:none}.agentsel-info.active{background:transparent;color:hsl(var(--foreground));box-shadow:none}.agentsel-connect:disabled{opacity:.55;cursor:default}.agentsel-info .icon{width:15px;height:15px}.agentsel-rt{display:flex;flex-direction:column}.agentsel-rt-row{width:100%;display:flex;align-items:center;gap:7px;padding:9px 8px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13.5px;cursor:pointer;text-align:left}.agentsel-rt-row:hover{background:hsl(var(--foreground) / .05)}.agentsel-rt-row .icon{width:15px;height:15px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-rt-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agentsel-badge{flex-shrink:0;font-size:10px;font-weight:600;padding:1px 6px;border-radius:999px;background:#007bff1f;color:#0b68cb}.agentsel-status{flex-shrink:0;font-size:10px;padding:1px 6px;border-radius:999px}.agentsel-status.is-ok{background:#21c45d24;color:#238b49}.agentsel-status.is-warn{background:#f59f0a29;color:#b86614}.agentsel-status.is-bad{background:#dc282824;color:#ca2b2b}.agentsel-status.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.agentsel-apps{display:flex;flex-direction:column;gap:2px;padding:2px 0 6px 20px}.agentsel-app{width:100%;display:flex;align-items:center;gap:8px;padding:7px 10px;border:none;border-radius:7px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;text-align:left}.agentsel-app:hover{background:hsl(var(--foreground) / .05)}.agentsel-app.active{background:hsl(var(--foreground) / .08);font-weight:600}.agentsel-app .icon{width:14px;height:14px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-apps-note{display:flex;align-items:center;gap:7px;padding:7px 10px;font-size:12.5px;color:hsl(var(--muted-foreground))}.agentsel-apps-note .icon{width:14px;height:14px}.agentsel-apps-note--muted{font-style:italic}.agentsel-empty{padding:24px 10px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.agentsel-error{min-width:0;max-width:100%;margin:4px 0 10px;padding:8px 10px;overflow:hidden;overflow-wrap:anywhere;border-radius:8px;background:#dc282814;color:#bd2828;font-size:12.5px;white-space:pre-wrap}.agentsel-more{width:100%;margin-top:8px;padding:9px;border:1px dashed hsl(var(--border));border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer}.agentsel-more:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}@media (max-width: 860px){.agentsel{--agentsel-available-width: calc(100vw - 218px) }}.sidebar-history{flex:1;min-height:0;display:flex;flex-direction:column}.history-head{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 6px 20px;font-size:12px;font-weight:500;color:hsl(var(--muted-foreground))}.history-refresh{background:none;border:none;cursor:pointer;padding:2px;color:hsl(var(--muted-foreground));display:flex}.history-refresh:hover{color:hsl(var(--foreground))}.history-new-chat{width:24px;height:24px;margin:-4px 0;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s}.history-new-chat .icon{width:15px;height:15px}.history-new-chat:hover{background:transparent;color:hsl(var(--foreground))}.history-list{flex:1;overflow-y:auto;padding:4px 10px 12px;display:flex;flex-direction:column;gap:2px}.history-empty{padding:16px 8px;font-size:13px;color:hsl(var(--muted-foreground));text-align:center}.history-item{position:relative;display:flex;align-items:center;border-radius:8px;transition:background .12s}.history-item:hover{background:hsl(var(--foreground) / .05)}.history-item.active{background:hsl(var(--foreground) / .08)}.history-item-btn{flex:1;min-width:0;display:flex;align-items:center;gap:7px;text-align:left;padding:9px 10px;border:none;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;cursor:pointer}.history-title{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-streaming{flex-shrink:0;width:7px;height:7px;margin-right:4px;border-radius:50%;background:#22c55e;box-shadow:0 0 #22c55e80;animation:history-pulse 1.4s ease-in-out infinite}@keyframes history-pulse{0%,to{box-shadow:0 0 #22c55e80}50%{box-shadow:0 0 0 4px #22c55e00}}.history-more{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:28px;height:28px;margin-right:4px;border:none;border-radius:6px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;opacity:0;transition:opacity .12s,background .12s}.history-item:hover .history-more{opacity:1}.history-more:hover{background:hsl(var(--border));color:hsl(var(--foreground))}.menu-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:30}.history-menu{position:absolute;top:100%;right:4px;z-index:31;min-width:120px;margin-top:2px;padding:4px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:8px;box-shadow:0 6px 20px hsl(var(--foreground) / .12)}.menu-item{display:flex;align-items:center;gap:8px;width:100%;padding:7px 10px;border:none;border-radius:6px;background:none;font:inherit;font-size:13px;cursor:pointer;color:hsl(var(--foreground))}.menu-item:hover{background:hsl(var(--accent))}.menu-item--danger{color:hsl(var(--destructive))}.menu-item .icon{width:15px;height:15px}.main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;margin:0 10px 10px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:12px;overflow:hidden}.error{margin:10px auto 0;max-width:768px;width:calc(100% - 32px);padding:10px 12px;border-radius:var(--radius);background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px}.transcript{flex:1;overflow-y:auto;padding:28px 16px 8px}.welcome{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 16px 6vh;gap:22px}.welcome-title{margin:0;font-size:26px;font-weight:600;letter-spacing:-.02em}.welcome .composer{padding:0}.turn{max-width:768px;margin:0 auto 22px;display:flex;flex-direction:column;gap:8px}.turn:last-child{margin-bottom:0}.turn--user{align-items:flex-end}.turn--assistant{align-items:flex-start}.bubble{line-height:1.65;font-size:14px}.turn--user .bubble{max-width:85%;padding:10px 16px;border-radius:18px;background:hsl(var(--secondary))}.turn--assistant .bubble{max-width:100%}.md{font-size:14px;line-height:1.65}.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}.md p{margin:0 0 .7em}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{margin:1.1em 0 .5em;font-weight:650;line-height:1.3;letter-spacing:-.01em}.md h1{font-size:1.4em}.md h2{font-size:1.25em}.md h3{font-size:1.1em}.md h4,.md h5,.md h6{font-size:1em}.md ul,.md ol{margin:0 0 .7em;padding-left:1.4em}.md li{margin:.15em 0}.md li>ul,.md li>ol{margin:.15em 0}.md a{color:hsl(var(--primary));text-decoration:underline;text-underline-offset:2px}.md a:hover{opacity:.8}.md blockquote{margin:0 0 .7em;padding:.1em .9em;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.md hr{border:none;border-top:1px solid hsl(var(--border));margin:1em 0}.md strong{font-weight:650}.md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.875em;background:hsl(var(--muted));padding:.12em .35em;border-radius:5px}.md pre{margin:0 0 .7em;padding:12px 14px;background:hsl(var(--muted));border-radius:8px;overflow-x:auto;line-height:1.55}.md pre code{background:none;padding:0;border-radius:0;font-size:12.5px}.md table{width:100%;margin:0 0 .7em;border-collapse:collapse;font-size:.95em;border-radius:12px;overflow:hidden;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border))}.md table thead th,.md table th{background:hsl(var(--muted));font-weight:650;border:1px solid hsl(var(--border));padding:12px 16px;text-align:left;font-size:.98em}.md table tbody td,.md table td{border:1px solid hsl(var(--border));padding:12px 16px;text-align:left;vertical-align:top;line-height:1.65}.md table tbody tr:nth-child(2n){background:hsl(var(--muted) / .25)}.md table tbody tr:hover{background:hsl(var(--accent))}.md table caption{caption-side:top;text-align:left;padding:0 0 8px;font-weight:600;color:hsl(var(--muted-foreground));font-size:.9em}.md table colgroup,.md table col{display:table-column}.md table thead,.md table tbody,.md table tfoot{display:table-row-group}.md table tr{display:table-row}.md strong,.md b{font-weight:650}.md em,.md i{font-style:italic}.md del,.md s{text-decoration:line-through}.md ins,.md u{text-decoration:underline}.md mark{background:#fff3c2b3;padding:.1em .3em;border-radius:4px}.md sub{vertical-align:sub;font-size:.8em}.md sup{vertical-align:super;font-size:.8em}.md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.md pre{overflow-x:auto}@media (max-width: 640px){.md table{font-size:.85em}.md table thead th,.md table th,.md table tbody td,.md table td{padding:8px 10px}}.md p{line-height:1.7}.md br{display:block;content:"";margin:.4em 0}.md hr{border:none;border-top:1px solid hsl(var(--border));margin:1.5em 0}.md blockquote{border-left:3px solid hsl(var(--primary) / .4);padding:.6em 1em;margin:.8em 0;background:hsl(var(--muted) / .3);border-radius:0 8px 8px 0}.md ul,.md ol{padding-left:1.6em;margin:.6em 0}.md li{margin:.3em 0;line-height:1.6}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{margin-top:1.2em;margin-bottom:.5em;line-height:1.3}.md h1{font-size:1.6em;font-weight:700}.md h2{font-size:1.4em;font-weight:650}.md h3{font-size:1.2em;font-weight:600}.md h4{font-size:1.1em;font-weight:600}.md h5,.md h6{font-size:1em;font-weight:600}.md .image-preview-trigger{position:relative;display:block;width:fit-content;max-width:40%;margin:0 0 .7em;padding:0;overflow:hidden;border:0;border-radius:10px;background:hsl(var(--muted));box-shadow:0 0 0 1px hsl(var(--border));cursor:zoom-in;line-height:0}.md .image-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .image-preview-trigger img{display:block;width:auto;max-width:100%;height:auto;border-radius:inherit;transition:filter .18s ease,transform .18s ease}.md .image-preview-trigger:hover img{filter:brightness(.92);transform:scale(1.01)}.image-preview-hint{position:absolute;right:8px;bottom:8px;display:grid;width:28px;height:28px;place-items:center;border:1px solid hsl(0 0% 100% / .2);border-radius:8px;background:#131316ad;color:#fff;opacity:0;transform:translateY(3px);transition:opacity .16s ease,transform .16s ease}.image-preview-hint svg{width:14px;height:14px}.image-preview-trigger:hover .image-preview-hint,.image-preview-trigger:focus-visible .image-preview-hint{opacity:1;transform:translateY(0)}.md .video-container{margin:0 0 .7em;display:grid;gap:6px}.md .video-caption{font-size:.9em;color:hsl(var(--muted-foreground))}.md .video-link-text{color:inherit;text-decoration:none;transition:color .15s ease}.md .video-link-text:hover{color:hsl(var(--foreground));text-decoration:underline}.md .video-preview-trigger{position:relative;display:block;width:fit-content;max-width:80%;padding:0;overflow:hidden;border:0;border-radius:12px;background:hsl(var(--muted));box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border));cursor:pointer;line-height:0;transition:box-shadow .18s ease,transform .18s ease}.md .video-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .video-preview-trigger:hover{box-shadow:0 4px 16px hsl(var(--foreground) / .15),0 0 0 1px hsl(var(--border));transform:translateY(-1px)}.md .video-preview-trigger .video-thumbnail{display:block;width:auto;max-width:100%;height:auto;border-radius:inherit;transition:filter .18s ease,transform .18s ease}.md .video-preview-trigger:hover .video-thumbnail{filter:brightness(.9);transform:scale(1.01)}.video-preview-hint{position:absolute;right:10px;bottom:10px;display:grid;width:32px;height:32px;place-items:center;border:1px solid hsl(0 0% 100% / .2);border-radius:10px;background:#131316b3;color:#fff;opacity:0;transform:translateY(4px);transition:opacity .16s ease,transform .16s ease;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.video-preview-hint svg{width:16px;height:16px}.video-preview-trigger:hover .video-preview-hint,.video-preview-trigger:focus-visible .video-preview-hint{opacity:1;transform:translateY(0)}.md .video-inline{max-width:100%;border-radius:12px;margin:0 0 .7em;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border))}.video-viewer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:grid;place-items:center;padding:28px;background:#131316c7;-webkit-backdrop-filter:blur(16px) saturate(.85);backdrop-filter:blur(16px) saturate(.85)}.video-viewer{display:flex;flex-direction:column;width:min(1080px,94vw);max-height:min(880px,90vh);overflow:hidden;border:1px solid hsl(var(--foreground) / .15);border-radius:18px;background:hsl(var(--background));box-shadow:0 32px 100px #07070885}.video-viewer-header{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:10px 16px;background:hsl(var(--muted) / .3);border-bottom:1px solid hsl(var(--border))}.video-viewer-title{font-weight:500;color:hsl(var(--foreground));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:70%}.video-viewer-nav{display:flex;gap:6px}.video-viewer-download,.video-viewer-close{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.video-viewer-download:hover,.video-viewer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.video-viewer-download svg,.video-viewer-close svg{width:17px;height:17px}.video-viewer-body{flex:1;min-height:0;display:grid;place-items:center;padding:20px;overflow:hidden;background:#161618}.video-viewer-body .video-fullscreen{max-width:100%;max-height:calc(90vh - 96px);border-radius:12px;background:#000;box-shadow:0 4px 20px #0006}@media (max-width: 640px){.md .video-preview-trigger{max-width:100%}.video-viewer-backdrop{padding:0}.video-viewer{width:100vw;max-height:100vh;border:none;border-radius:0}.video-viewer-body .video-fullscreen{max-height:calc(100vh - 96px);border-radius:0}}.turn--user .md code,.turn--user .md pre{background:hsl(var(--background) / .55)}.block-thinking,.block-tool{width:100%}.think-head,.tool-head{display:inline-flex;align-items:center;border:none;background:none;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.think-head{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.think-icon{width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center}.think-icon>svg{width:18px;height:18px}.spark{color:hsl(var(--muted-foreground))}.spark.pulse{animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{0%,to{opacity:.45;transform:scale(.92)}50%{opacity:1;transform:scale(1.08)}}.chev{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.chev.open{transform:rotate(90deg)}.think-label{font-size:13.5px;font-weight:400;line-height:1.35}.think-label--done{color:hsl(var(--muted-foreground))}.tool-head{color:hsl(var(--muted-foreground));transition:color .12s}.tool-head:hover{color:hsl(var(--foreground))}.tool-head--generic{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.tool-name{color:inherit;font-size:13.5px;font-weight:400;line-height:1.35}.tool-icon{width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center}.tool-icon>svg{width:18px;height:18px}.tool-icon--generic{color:hsl(var(--muted-foreground))}.tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.tool-chevron.is-open{transform:rotate(90deg)}.tool-detail{display:flex;flex-direction:column;gap:8px;margin:6px 0 4px;padding-left:3px}.tool-section-label{margin-bottom:4px;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:hsl(var(--muted-foreground))}.tool-result{max-height:240px;overflow:auto}.think-collapse{display:grid;grid-template-rows:0fr;transition:grid-template-rows .28s ease}.think-collapse.open{grid-template-rows:1fr}.think-collapse-inner{overflow:hidden}.think-body{margin:8px 0 4px;padding:10px 14px;border-left:2px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:13px;line-height:1.7;white-space:pre-wrap;max-height:220px;overflow-y:auto}.tool-args{margin:0;padding:8px 10px;background:hsl(var(--muted));border-radius:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5;overflow-x:auto;white-space:pre-wrap}.turn-meta{display:flex;align-items:center;gap:10px;margin-top:2px;font-size:12px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s}.turn-empty{margin-top:2px;font-size:13px;font-style:italic;color:hsl(var(--muted-foreground))}.auth-card{width:100%;max-width:640px;margin:2px 0;padding:18px 20px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.auth-card-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}.auth-card-icon{width:18px;height:18px;color:#f59f0a}.auth-card-icon--done{color:#1eae53}.auth-card-collapsed{display:inline-flex;align-items:center;gap:7px;margin:2px 0;padding:6px 12px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--card));font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.auth-card-code{padding:1px 6px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}.auth-card-title{font-size:14px;font-weight:600}.auth-card-desc{margin:0 0 14px;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.auth-card-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;border:none;border-radius:9px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:opacity .12s}.auth-card-btn:hover:not(:disabled){opacity:.88}.auth-card-btn:disabled{opacity:.55;cursor:default}.auth-card-btn .cw-i{width:15px;height:15px}.auth-card-done{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:#1eae53}.auth-card-done .cw-i{width:16px;height:16px}.auth-card-err{margin-top:8px;font-size:12px;color:hsl(var(--destructive))}.turn-actions{display:inline-flex;align-items:center;gap:2px}.turn-actions--right{align-self:flex-end;margin-top:2px;opacity:0;transition:opacity .15s}.turn--assistant:hover .turn-meta,.turn--user:hover .turn-actions--right{opacity:1}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:6px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.icon-btn:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.icon-btn:disabled{opacity:.35;cursor:default}.icon-btn:disabled:hover{background:none;color:hsl(var(--muted-foreground))}.icon-btn .icon{width:15px;height:15px}.meta-text{white-space:nowrap;font-size:12px;color:hsl(var(--muted-foreground))}.turn-actions--right{gap:6px}.drawer-scrim{position:fixed;top:0;right:0;bottom:0;left:0;background:hsl(var(--foreground) / .2);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fade .2s ease;z-index:40}@keyframes fade{0%{opacity:0}to{opacity:1}}.drawer{position:fixed;top:0;right:0;bottom:0;width:min(560px,92vw);background:hsl(var(--background));border-left:1px solid hsl(var(--border));box-shadow:-12px 0 40px hsl(var(--foreground) / .14);display:flex;flex-direction:column;z-index:41;animation:slidein .24s cubic-bezier(.22,1,.36,1)}@keyframes slidein{0%{transform:translate(100%)}to{transform:translate(0)}}.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas))}.drawer-title{font-weight:650;font-size:15px;letter-spacing:-.01em}.drawer-sub{font-size:12px;color:hsl(var(--muted-foreground));margin-top:3px;font-variant-numeric:tabular-nums}.drawer-close{display:flex;padding:6px;border:none;background:none;cursor:pointer;color:hsl(var(--muted-foreground));border-radius:6px}.drawer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.drawer-body{flex:1;overflow:auto;padding:16px 18px}.drawer-loading,.drawer-empty{display:flex;align-items:center;gap:8px;color:hsl(var(--muted-foreground));font-size:14px;padding:20px 0}.drawer--trace{width:min(1080px,96vw)}.trace-split{flex:1;min-height:0;display:flex}.trace-tree{flex:1.25;min-width:0;overflow:auto;padding:8px 6px;border-right:1px solid hsl(var(--border))}.trace-row{display:flex;align-items:center;gap:10px;width:100%;padding:5px 8px;border:none;background:none;border-radius:6px;cursor:pointer;font:inherit;text-align:left;transition:background .1s}.trace-row:hover{background:hsl(var(--foreground) / .04)}.trace-row.active{background:hsl(var(--primary) / .07);box-shadow:inset 2px 0 hsl(var(--primary) / .55)}.trace-label{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.trace-caret{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:hsl(var(--muted-foreground))}.trace-caret.hidden{visibility:hidden}.trace-caret .chev{width:13px;height:13px;transition:transform .18s}.trace-caret.open .chev{transform:rotate(90deg)}.trace-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.trace-name{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.trace-dur{flex-shrink:0;width:66px;text-align:right;font-size:11px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}.trace-track{position:relative;flex:0 0 34%;height:16px;border-radius:5px;background:hsl(var(--foreground) / .05)}.trace-bar{position:absolute;top:4px;height:8px;min-width:3px;border-radius:4px;opacity:.9}.trace-detail{flex:1;min-width:0;overflow:auto;padding:18px 20px}.td-title{font-size:15px;font-weight:600;letter-spacing:-.01em;word-break:break-all}.td-dur{display:flex;align-items:center;gap:7px;margin-top:4px;font-size:12px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}.td-dot{width:8px;height:8px;border-radius:50%}.td-section{margin:22px 0 9px;font-size:12px;font-weight:650;letter-spacing:.01em;color:hsl(var(--foreground))}.td-props{display:flex;flex-direction:column}.td-prop{display:flex;gap:16px;padding:7px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.td-key{flex-shrink:0;color:hsl(var(--muted-foreground));min-width:140px}.td-val{flex:1;min-width:0;text-align:right;word-break:break-word;font-variant-numeric:tabular-nums}.td-pre{margin:0;padding:11px 13px;background:hsl(var(--canvas));border:1px solid hsl(var(--border));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:320px;overflow:auto}.composer{max-width:768px;width:100%;margin:0 auto;padding:6px 16px 18px}.composer-box{position:relative;display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 8px;border:1px solid hsl(var(--border));border-radius:26px;background:hsl(var(--background))}.composer--new-chat .composer-box{display:block;min-height:136px;padding:10px;border-radius:16px}.composer-input-stack{display:flex;flex:1;min-width:0;flex-direction:column}.composer-input-stack .comp-input{width:100%}.composer--new-chat .composer-input-stack{min-height:114px}.composer--new-chat .comp-input{min-height:76px;padding:4px 10px}.composer--new-chat .composer-menu-wrap{position:absolute;bottom:10px;left:10px;height:36px}.composer--new-chat .new-chat-mode{position:absolute;right:52px;bottom:10px;display:flex;align-items:center;min-height:36px}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.composer-meta{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;padding:7px 12px 0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4}.composer-session-line{display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap}.composer-session-id{max-width:300px;overflow:hidden;text-overflow:ellipsis;font-family:inherit}.composer-session-copy{display:inline-grid;flex:0 0 18px;width:18px;height:18px;padding:0;place-items:center;border:0;border-radius:4px;background:transparent;color:inherit;cursor:pointer;opacity:.72;transition:background .12s ease,color .12s ease,opacity .12s ease}.composer-session-copy:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground));opacity:1}.composer-session-copy svg{width:11px;height:11px}.composer-meta-separator{opacity:.55}.comp-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 4px;max-height:200px;overflow-y:auto}.comp-input::placeholder{color:hsl(var(--muted-foreground))}.comp-icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.comp-icon:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.comp-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.comp-send:hover:not(:disabled){opacity:.85}.comp-send:active:not(:disabled){transform:scale(.94)}.comp-send:disabled{opacity:.3;cursor:default}.invocation-chips{display:flex;flex-wrap:wrap;gap:6px;min-width:0}.composer>.invocation-chips{padding:0 8px 8px}.turn--user>.invocation-chips{justify-content:flex-end;margin-bottom:6px}.invocation-chip{display:inline-flex;align-items:center;gap:5px;max-width:260px;min-height:28px;padding:4px 8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .025);font-size:12px;font-weight:560;line-height:1.2}.invocation-chip--skill{color:#267848}.invocation-chip--agent{color:#2762b0}.invocation-chip>svg{width:13px;height:13px;flex:0 0 auto}.invocation-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.invocation-chip button{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;margin:-1px -3px -1px 1px;padding:0;border:none;border-radius:5px;background:transparent;color:currentColor;cursor:pointer;opacity:.55}.invocation-chip button:hover{background:hsl(var(--accent));opacity:1}.invocation-chip button svg{width:11px;height:11px}.composer-command-menu{position:absolute;z-index:34;bottom:calc(100% + 10px);left:0;width:min(500px,calc(100vw - 48px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));box-shadow:0 2px 7px hsl(var(--foreground) / .08),0 22px 60px -24px hsl(var(--foreground) / .28);transform-origin:bottom left;animation:command-menu-in .13s ease-out}@keyframes command-menu-in{0%{opacity:0;transform:translateY(5px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}.composer-command-head{display:flex;align-items:center;gap:7px;height:38px;padding:0 10px 0 12px;border-bottom:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11px;font-weight:650;letter-spacing:.02em}.composer-command-head>svg{width:13px;height:13px}.composer-command-head>span{flex:1}.composer-command-menu kbd{min-width:22px;padding:2px 5px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--canvas));color:hsl(var(--muted-foreground));font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.composer-command-list{display:grid;max-height:min(330px,42vh);overflow-y:auto;padding:5px}.composer-command-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;width:100%;min-height:52px;padding:6px 8px;border:none;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.composer-command-item.is-active{background:hsl(var(--accent))}.composer-command-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:9px}.composer-command-icon--skill{background:#e7f8ee;color:#218349}.composer-command-icon--agent{background:#e9f1fc;color:#2664b5}.composer-command-icon svg{width:16px;height:16px}.composer-command-copy{display:grid;min-width:0;gap:3px}.composer-command-copy strong{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.composer-command-copy>span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.composer-command-empty{display:flex;align-items:center;justify-content:center;gap:7px;min-height:68px;padding:14px;color:hsl(var(--muted-foreground));font-size:12px}.composer-command-empty svg{width:14px;height:14px}.composer-menu-wrap{position:relative;flex-shrink:0}.composer-menu{position:absolute;bottom:100%;left:0;z-index:31;min-width:168px;margin-bottom:6px;padding:4px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 6px 20px hsl(var(--foreground) / .12)}.media-grid{display:flex;flex-wrap:wrap;gap:8px;max-width:min(620px,100%)}.turn--user .media-grid{justify-content:flex-end}.composer>.media-grid{padding:0 8px 9px;justify-content:flex-start}.media-card{position:relative;width:272px;min-width:0;overflow:visible;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .025);transition:border-color .16s,box-shadow .16s,transform .16s}.media-card:hover{border-color:hsl(var(--foreground) / .2);box-shadow:0 8px 28px -20px hsl(var(--foreground) / .28);transform:translateY(-1px)}.media-card--image{width:176px}.media-grid--compact .media-card{width:224px}.media-grid--compact .media-card--image{width:92px}.media-card-main{display:flex;align-items:center;gap:11px;width:100%;min-width:0;height:68px;padding:10px 12px;border:none;border-radius:inherit;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.media-card-main:disabled{cursor:default}.media-card--image .media-card-main{display:block;height:132px;padding:4px}.media-grid--compact .media-card-main{height:58px;padding:8px 10px}.media-grid--compact .media-card--image .media-card-main{height:72px;padding:3px}.media-card-image{width:100%;height:100%;object-fit:cover;border-radius:10px;display:block;background:hsl(var(--muted))}.media-card--image .media-card-copy,.media-card--image .media-card-open{display:none}.media-card-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:44px;flex:0 0 auto;border-radius:9px;color:hsl(var(--muted-foreground));background:hsl(var(--muted))}.media-card--pdf .media-card-icon{color:#db2a24;background:#fdeded}.media-card--video .media-card-icon{color:#226cd3;background:#edf3fd}.media-card--markdown .media-card-icon{color:#259353;background:#ebfaf1}.media-card-icon svg{width:21px;height:21px}.media-card-video-container{position:relative;display:grid;place-items:center;width:100%;height:100%;overflow:hidden;background:#131316}.media-card-video{width:100%;height:100%;object-fit:cover;opacity:.85}.media-card-video-play{position:absolute;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#0000008c;color:#fff;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transform:scale(1);transition:transform .18s ease,background .18s ease}.media-card-video-play svg{width:20px;height:20px;margin-left:3px}.media-card-main:hover .media-card-video-play{transform:scale(1.08);background:#000000b3}.media-card-copy{min-width:0;flex:1;display:grid;gap:5px}.media-card-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:1.2;font-weight:560}.media-card-meta{display:flex;align-items:center;gap:5px;min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.2}.media-card-type{font-size:9px;font-weight:700;letter-spacing:.06em}.media-card-open{width:14px;height:14px;flex:0 0 auto;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s}.media-card:hover .media-card-open{opacity:1}.media-card-spinner{width:12px;height:12px;animation:spin .85s linear infinite}.media-card--error{border-color:hsl(var(--destructive) / .42)}.media-card--error .media-card-meta{color:hsl(var(--destructive))}.media-card-remove{position:absolute;z-index:2;top:-7px;right:-7px;display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;padding:0;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));box-shadow:0 2px 8px hsl(var(--foreground) / .12);cursor:pointer}.media-card-remove:hover{color:hsl(var(--foreground))}.media-card-remove svg{width:12px;height:12px}.media-viewer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:grid;place-items:center;padding:28px;background:#131316b8;-webkit-backdrop-filter:blur(12px) saturate(.8);backdrop-filter:blur(12px) saturate(.8)}.media-viewer{display:flex;flex-direction:column;width:min(1080px,94vw);height:min(820px,90vh);overflow:hidden;border:1px solid hsl(var(--foreground) / .13);border-radius:18px;background:hsl(var(--background));box-shadow:0 32px 100px #07070875}.media-viewer-header{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:58px;padding:9px 12px 9px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background) / .94)}.media-viewer-header>div{min-width:0;display:grid;gap:2px}.media-viewer-header strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:620}.media-viewer-header span{color:hsl(var(--muted-foreground));font-size:11px}.media-viewer-header nav{display:flex;gap:4px}.media-viewer-header a,.media-viewer-header button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.media-viewer-header a:hover,.media-viewer-header button:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.media-viewer-header svg{width:17px;height:17px}.media-viewer-body{flex:1;min-height:0;overflow:auto;background:hsl(var(--canvas))}.media-viewer-body--image,.media-viewer-body--video{display:grid;place-items:center;padding:24px;background:#161618}.media-viewer-body--image img,.media-viewer-body--video video{max-width:100%;max-height:100%;object-fit:contain;border-radius:8px}.media-viewer-video-wrapper{width:100%;display:grid;place-items:center}.media-viewer-video{max-width:100%;max-height:calc(90vh - 140px);border-radius:12px;background:#000;box-shadow:0 4px 20px #0006}.media-viewer-body--pdf iframe{display:block;width:100%;height:100%;border:none;background:#fff}.media-document{width:min(820px,calc(100% - 48px));margin:24px auto;padding:34px 40px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 38px -30px hsl(var(--foreground) / .3)}.media-document--plain{min-height:calc(100% - 48px);white-space:pre-wrap;word-break:break-word;font:13px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace}.media-viewer-loading{display:flex;align-items:center;justify-content:center;gap:8px;height:100%;color:hsl(var(--muted-foreground));font-size:13px}.media-viewer-loading svg{width:17px;height:17px;animation:spin .85s linear infinite}@media (max-width: 640px){.composer-command-menu{right:0;width:auto}.media-card{width:min(272px,82vw)}.media-viewer-backdrop{padding:0}.media-viewer{width:100vw;height:100vh;border:none;border-radius:0}.media-document{width:calc(100% - 24px);margin:12px auto;padding:22px 18px}.md .image-preview-trigger{max-width:100%}}.a2ui-surface{max-width:360px;width:100%;font-size:14px}.a2ui-card{background:hsl(var(--card));border:1px solid hsl(var(--border));border-radius:8px;padding:18px;box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .18)}.a2ui-column,.a2ui-row{gap:10px}.a2ui-text{margin:0;line-height:1.5;color:hsl(var(--foreground))}.a2ui-text--h1{font-size:19px;font-weight:650;letter-spacing:0}.a2ui-text--h2{font-size:16px;font-weight:650;letter-spacing:0}.a2ui-text--h3{font-size:14px;font-weight:600}.a2ui-text--h4{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));text-transform:uppercase;letter-spacing:0}.a2ui-text--caption{font-size:12px;color:hsl(var(--muted-foreground))}.a2ui-text--body{font-size:14px}.a2ui-icon{display:inline-flex;align-items:center;justify-content:center;font-size:15px;line-height:1;color:hsl(var(--muted-foreground))}.a2ui-divider--h{height:1px;background:hsl(var(--border));margin:4px 0;width:100%}.a2ui-divider--v{width:1px;background:hsl(var(--border));align-self:stretch}.a2ui-button{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));border:1px solid transparent;border-radius:10px;padding:8px 14px;cursor:pointer;font:inherit;font-size:13px;font-weight:500;transition:background .15s,opacity .15s}.a2ui-button:hover{background:hsl(var(--accent))}.a2ui-button--primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.a2ui-button--primary:hover{background:hsl(var(--primary));opacity:.88}.a2ui-button--borderless{background:transparent;color:hsl(var(--foreground))}.a2ui-button--borderless:hover{background:hsl(var(--accent))}.a2ui-surface[data-a2ui-surface^=flight-]{max-width:520px}.a2ui-surface[data-a2ui-surface^=flight-] .a2ui-card{padding:0;overflow:hidden;background:linear-gradient(180deg,#f6fbfe,hsl(var(--card)) 42%),hsl(var(--card));border-color:#d7e0ea;box-shadow:0 1px 2px hsl(var(--foreground) / .05),0 18px 48px -28px #283d5359}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-content]{gap:16px;padding:18px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-top]{gap:12px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-brand]{min-width:0}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-brand-icon]{width:28px;height:28px;border-radius:999px;background:#006fe61a;color:#004fa3}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-title]{font-size:13px;color:#41454e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip]{flex-shrink:0;gap:6px;padding:5px 9px;border-radius:999px;background:#e3f8ed;border:1px solid hsl(151 48% 82%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip] .a2ui-icon,.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-text]{color:#126e41}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-hero]{position:relative;gap:16px;padding:18px;border-radius:8px;background:hsl(var(--background) / .88);border:1px solid hsl(210 32% 90%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination]{flex:1 1 0;min-width:0;gap:2px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{font-size:34px;line-height:1;font-weight:760;color:#191d24}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-label],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-label]{font-size:11px;font-weight:700;color:#717784}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-city],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-city]{font-size:13px;color:#545964}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{flex:0 0 auto;gap:3px;padding:0 4px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-icon]{width:34px;height:34px;border-radius:999px;background:#006fe61f;color:#0054ad}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-duration],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-aircraft]{font-size:11px;white-space:nowrap}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-times],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-details]{gap:10px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-time],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-time],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding]{flex:1 1 0;min-width:0;gap:2px;padding:11px 12px;border-radius:8px;background:#f3f4f6;border:1px solid hsl(220 13% 91%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-value]{font-size:14px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-airport],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-airport]{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding-value]{font-size:20px;line-height:1.15}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-footer]{gap:10px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-divider]{margin:0;background:#d9e0e8}@media (max-width: 520px){.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-content]{padding:14px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-hero],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-times],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-details]{flex-wrap:wrap}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{order:3;width:100%}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding]{min-width:120px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{font-size:34px}}.a2ui-fallback{background:hsl(var(--muted));border:1px solid hsl(var(--border));border-radius:10px;padding:8px 10px;font-size:12px;color:hsl(var(--muted-foreground))}.a2ui-fallback pre{overflow-x:auto;margin:6px 0 0}.boot{height:100vh;background:hsl(var(--background))}.boot-error{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:hsl(var(--foreground));font-size:14px}.boot-error p{margin:0}.boot-error button,.login-provider-error button{padding:7px 18px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--card));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer}.boot-error button:hover,.login-provider-error button:hover{background:hsl(var(--accent))}.navbar{flex:0 0 54px;min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 10px;background:transparent}.navbar-left,.navbar-right,.navbar-default,.navbar-portal-slot,.navbar-portal-actions{display:flex;align-items:center}.navbar-left{flex:1;min-width:0}.navbar-default{min-width:0}.navbar-right{flex:0 0 auto;min-width:0;gap:10px}.navbar-portal-slot,.navbar-portal-actions{min-width:0}.navbar-portal-slot:empty,.navbar-portal-actions:empty{display:none}.navbar-left:has(.navbar-portal-slot:not(:empty))>.navbar-default{display:none}.global-deploy-center{position:relative;z-index:38}.global-deploy-task{max-width:300px;min-height:32px;display:flex;align-items:center;gap:7px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background) / .82);color:hsl(var(--muted-foreground));font:inherit;font-size:12px;outline:none;white-space:nowrap;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}.global-deploy-task:hover{background:hsl(var(--background))}.global-deploy-task:focus-visible{border-color:hsl(var(--ring) / .32);box-shadow:0 0 0 2px hsl(var(--ring) / .07)}.global-deploy-task.is-idle{color:hsl(var(--muted-foreground))}.global-deploy-task.is-running{border-color:#0c77e93d;color:#1863b4}.global-deploy-task.is-success{border-color:#279b5138;color:#277c46}.global-deploy-task.is-error{border-color:hsl(var(--destructive) / .24);color:hsl(var(--destructive))}.global-deploy-task.is-cancelled{color:hsl(var(--muted-foreground))}.global-deploy-task-icon{width:14px;height:14px;flex:0 0 auto}.global-deploy-task-detail{overflow:hidden;text-overflow:ellipsis}.global-deploy-task-chevron{width:13px;height:13px;flex:0 0 auto;transition:transform .14s ease}.global-deploy-task-chevron.is-open{transform:rotate(180deg)}.global-deploy-task-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;padding:0;border:0;background:transparent}.global-deploy-popover{position:absolute;top:40px;right:0;z-index:2;width:390px;max-width:calc(100vw - 32px);overflow:hidden;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--background));box-shadow:0 14px 36px hsl(var(--foreground) / .14)}.global-deploy-popover-head{height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground));font-size:13px;font-weight:650}.global-deploy-popover-head span:last-child{min-width:20px;padding:1px 6px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.global-deploy-list{max-height:min(520px,calc(100vh - 82px));overflow-y:auto;padding:8px}.global-deploy-empty{padding:34px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.global-deploy-item{padding:12px;border:1px solid hsl(var(--border) / .8);border-radius:8px;background:hsl(var(--canvas) / .42)}.global-deploy-item+.global-deploy-item{margin-top:7px}.global-deploy-item-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.global-deploy-runtime-name{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.global-deploy-status{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:11.5px}.global-deploy-item.is-running .global-deploy-status{color:#1863b4}.global-deploy-item.is-success .global-deploy-status{color:#277c46}.global-deploy-item.is-error .global-deploy-status{color:hsl(var(--destructive))}.global-deploy-item.is-cancelled .global-deploy-status{color:hsl(var(--muted-foreground))}.global-deploy-meta{display:grid;grid-template-columns:1fr 1fr;gap:9px 14px;margin:11px 0 0}.global-deploy-meta>div{min-width:0}.global-deploy-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:10.5px}.global-deploy-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.global-deploy-message{margin:10px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.global-deploy-error{margin-top:10px;color:hsl(var(--muted-foreground));font-size:11.5px}.deploy-error-message-text{display:-webkit-box;margin:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-height:1.5;overflow-wrap:anywhere;white-space:pre-wrap}.deploy-error-message.is-expanded .deploy-error-message-text{display:block;max-height:280px;overflow:auto;-webkit-line-clamp:unset}.deploy-error-message-actions{display:flex;justify-content:flex-end;gap:2px;margin-top:6px}.deploy-error-message-actions button{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:inherit;cursor:pointer;opacity:.72}.deploy-error-message-actions button:hover{background:hsl(var(--foreground) / .07);opacity:1}.deploy-error-message-actions button:disabled{cursor:default;opacity:.5}.deploy-error-message-actions .deploy-error-retry{width:auto;gap:5px;margin-right:auto;padding:0 8px;font:inherit;font-size:11.5px;font-weight:600}.deploy-error-message-actions svg{width:14px;height:14px}.global-deploy-progress{height:3px;margin-top:10px;overflow:hidden;border-radius:999px;background:hsl(var(--foreground) / .08)}.global-deploy-progress span{display:block;height:100%;border-radius:inherit;background:#2581e4;transition:width .18s ease}.global-deploy-item-actions{display:flex;justify-content:flex-end;margin-top:9px}.global-deploy-item-actions button{min-height:27px;padding:0 9px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;cursor:pointer}.global-deploy-item-actions button:hover:not(:disabled){border-color:hsl(var(--destructive) / .3);background:hsl(var(--destructive) / .05);color:hsl(var(--destructive))}.global-deploy-item-actions button:disabled{opacity:.55;cursor:default}.navbar-title{padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.agent-dd{position:relative}.agent-dd-trigger{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:16px;font-weight:650;letter-spacing:-.01em;cursor:pointer;transition:background .12s}.agent-dd-trigger:hover{background:hsl(var(--foreground) / .05)}.agent-dd-current{max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-dd-chev{width:16px;height:16px;opacity:.6;transition:transform .2s ease}.agent-dd-chev.open{transform:rotate(180deg)}.agent-dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;min-width:240px;max-width:360px;max-height:min(560px,calc(100dvh - 84px));padding:6px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);display:flex;flex-direction:column;gap:2px;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;animation:ddpop .14s ease}@keyframes ddpop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.agent-dd-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;text-align:left;cursor:pointer;transition:background .12s}.agent-dd-row{position:relative}.agent-dd-item{width:100%}.agent-dd-item:hover{background:hsl(var(--foreground) / .05)}.agent-dd-item.active{background:hsl(var(--foreground) / .04)}.agent-dd-item-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-dd-item-dot{width:8px;height:8px;flex-shrink:0;border-radius:50%;background:#21c45d;box-shadow:0 0 0 3px #21c45d2e}.agent-dd-flyout{position:absolute;left:248px;z-index:32;width:280px;padding:12px 14px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);animation:ddpop .12s ease}.agent-dd-flyout:before{content:"";position:absolute;top:0;bottom:0;left:-12px;width:14px}.agent-dd-fly-loading{display:flex;align-items:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground))}.agent-dd-fly-name{font-size:14px;font-weight:650;letter-spacing:-.01em}.agent-dd-fly-desc{margin-top:3px;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.agent-dd-fly-field{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12.5px;color:hsl(var(--foreground))}.agent-dd-fly-field .icon{width:14px;height:14px;flex-shrink:0;color:hsl(var(--muted-foreground))}.agent-dd-fly-field--tools{align-items:flex-start}.agent-dd-fly-field--tools .icon{margin-top:3px}.agent-dd-fly-label{color:hsl(var(--muted-foreground))}.agent-dd-fly-model{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}.agent-dd-fly-chips{display:flex;flex-wrap:wrap;gap:5px}.agent-dd-chip{padding:2px 8px;border-radius:999px;background:hsl(var(--foreground) / .06);font-size:11.5px;white-space:nowrap}.account{position:relative}.account-avatar{width:32px;height:32px;flex-shrink:0;position:relative;isolation:isolate;overflow:hidden;border:none;border-radius:9px;background:radial-gradient(circle at var(--avatar-x, 32%) var(--avatar-y, 30%),hsl(var(--avatar-hue-a, 202) 100% 92%) 0 12%,hsl(var(--avatar-hue-a, 202) 95% 75% / .76) 34%,transparent 62%),radial-gradient(ellipse at 82% 78%,hsl(var(--avatar-hue-c, 185) 86% 49% / .88) 0 18%,transparent 58%),linear-gradient(142deg,hsl(var(--avatar-hue-b, 222) 94% 83%),hsl(var(--avatar-hue-b, 222) 95% 54%) 52%,hsl(var(--avatar-hue-c, 185) 74% 62%));background-size:180% 180%,160% 160%,100% 100%;background-position:20% 12%,80% 80%,center;color:#152747e0;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;cursor:pointer;text-shadow:0 1px 2px hsl(0 0% 100% / .62);box-shadow:none;animation:avatar-smoke-drift 9s ease-in-out infinite alternate;transition:filter .16s,transform .16s}.account-avatar:hover{filter:saturate(1.12) brightness(1.03);transform:scale(1.035)}.account-avatar.has-image{animation:none;text-shadow:none}.account-avatar-image{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;border-radius:inherit;object-fit:cover}@keyframes avatar-smoke-drift{0%{background-position:18% 12%,82% 84%,center}50%{background-position:58% 42%,54% 62%,center}to{background-position:82% 70%,26% 24%,center}}.account-avatar--lg{width:40px;height:40px;border-radius:11px;font-size:16px;cursor:default}.account-pop{position:absolute;top:calc(100% + 8px);right:0;z-index:31;min-width:220px;padding:12px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);animation:ddpop .12s ease}.account-head{display:flex;align-items:center;gap:10px}.account-id{min-width:0;flex:1}.account-name-row{display:flex;align-items:center;gap:6px;min-width:0}.account-name{min-width:0;flex:1;font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-sub{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-logout{display:flex;align-items:center;gap:8px;width:100%;margin-top:10px;padding:9px 10px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s}.account-logout:hover{background:hsl(var(--foreground) / .05)}.account-logout .icon{width:16px;height:16px;color:hsl(var(--muted-foreground))}.sidebar-user{position:relative;flex-shrink:0;margin-top:auto;padding:8px 10px 12px}.sidebar-user-btn{display:flex;align-items:center;gap:9px;width:100%;padding:7px 8px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;cursor:pointer;transition:background .12s}.sidebar-user-btn:hover{background:hsl(var(--foreground) / .05)}.sidebar-user-identity{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.sidebar-user-primary{min-width:0;display:flex;align-items:center;gap:6px}.sidebar-user-name{min-width:0;flex:1;text-align:left;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-user-email{min-width:0;text-align:left;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.studio-role-badge{flex-shrink:0;padding:2px 5px;border:1px solid transparent;border-radius:999px;font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap}.studio-role-badge--admin{color:#7027b4;background:#8f37e11c;border-color:#7d2cc93d}.studio-role-badge--developer{color:#976507;background:#fac70f2e;border-color:#ce9b0d4d}.studio-role-badge--user{color:#1b7e43;background:#25b15f1f;border-color:#2994543d}.sidebar.is-collapsed .sidebar-user-btn{width:36px;height:36px;justify-content:center;gap:0;padding:2px;overflow:hidden}.sidebar.is-collapsed .sidebar-user-identity{display:none}.sidebar.is-collapsed .sidebar-user-pop{left:8px;right:auto;width:220px}@media (prefers-reduced-motion: reduce){.sidebar{transition:none}}.sidebar-user-pop{position:absolute;bottom:calc(100% - 4px);top:auto;left:10px;right:10px}.skillcenter{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;padding:0}.skillcenter-regions{display:grid;padding:2px;border:1px solid hsl(var(--border));background:hsl(var(--canvas) / .62)}.skillcenter-regions button{border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.skillcenter-regions button.active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.skillcenter-regions button:focus-visible,.skillcenter-pager button:focus-visible,.skill-detail-close:focus-visible{outline:2px solid hsl(var(--ring) / .28);outline-offset:1px}.skillcenter-space-item:focus-visible,.skillcenter-skill-item:focus-visible{outline:none;border-color:transparent;background:hsl(var(--muted) / .62)}.skillcenter-regions{grid-template-columns:repeat(2,58px);border-radius:7px}.skillcenter-regions button{height:27px;border-radius:5px;font-size:11.5px}.skillcenter-browser{flex:1;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(270px,.9fr) minmax(360px,1.35fr);gap:0}.skillcenter-panel{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.skillcenter-panel+.skillcenter-panel{border-left:1px solid hsl(var(--border))}.skillcenter-panel-head{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.skillcenter-panel-head>div{min-width:0;display:flex;align-items:center;gap:8px}.skillcenter-panel-head .icon{width:17px;height:17px;color:hsl(var(--muted-foreground))}.skillcenter-panel-head h2{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:13.5px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.skillcenter-panel-head>span{flex-shrink:0;color:hsl(var(--muted-foreground));font-size:11.5px}.skillcenter-count-badge{min-width:25px;height:21px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:11px;font-weight:600;line-height:1}.skillcenter-listwrap{position:relative;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}.skillcenter-list{display:flex;flex-direction:column;gap:6px;padding:8px}.skillcenter-space-item,.skillcenter-skill-item{width:100%;min-width:0;display:flex;align-items:flex-start;gap:10px;padding:10px;border:1px solid transparent;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:background-color .12s ease,border-color .12s ease}.skillcenter-space-item:hover,.skillcenter-skill-item:hover,.skillcenter-space-item.active{border-color:transparent;background:hsl(var(--muted) / .62)}.skillcenter-symbol{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground) / .78)}.skillcenter-symbol .icon{width:18px;height:18px}.skillcenter-symbol--skill{color:#2764b4;background:#f2f7fd;border-color:#ccdbf0}.skillcenter-item-body{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}.skillcenter-item-title{min-width:0;overflow:hidden;font-size:13px;font-weight:600;line-height:18px;text-overflow:ellipsis;white-space:nowrap}.skillcenter-item-description{display:-webkit-box;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:17px;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skillcenter-item-meta{min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px;margin-top:2px}.skillcenter-status{flex-shrink:0;padding:2px 6px;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10.5px;line-height:16px}.skillcenter-status.is-positive{color:#1d7742;background:#e7f8ee}.skillcenter-status.is-progress{color:#8d5911;background:#fdf5e3}.skillcenter-status.is-danger{color:hsl(var(--destructive));background:hsl(var(--destructive) / .09)}.skillcenter-meta-text{min-width:0;max-width:170px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}.skillcenter-pager{height:44px;flex:0 0 44px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11.5px}.skillcenter-pager-actions{display:flex;align-items:center;gap:7px}.skillcenter-pager-actions>span{min-width:38px;text-align:center}.skillcenter-pager button,.skill-detail-close{display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.skillcenter-pager button{width:26px;height:26px;padding:0}.skillcenter-pager button:hover:not(:disabled),.skill-detail-close:hover{color:hsl(var(--foreground));background:hsl(var(--accent))}.skillcenter-pager button:disabled{opacity:.35;cursor:default}.skillcenter-pager button .icon{width:17px;height:17px}.skillcenter-empty,.skillcenter-loading,.skillcenter-error{min-height:130px;display:flex;align-items:center;justify-content:center;gap:8px;padding:24px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55;text-align:center;overflow-wrap:anywhere}.skillcenter-error{color:hsl(var(--destructive))}.skillcenter-loading--overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;min-height:0;background:hsl(var(--background) / .82);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.skillcenter-loading-mark{width:14px;height:14px;flex-shrink:0;border:1.5px solid hsl(var(--foreground) / .16);border-top-color:hsl(var(--foreground) / .62);border-radius:50%;animation:spin .8s linear infinite}.skill-detail-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;display:grid;place-items:center;padding:16px;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.skill-detail-dialog{width:min(760px,100%);height:min(760px,100%);min-height:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 18px 48px hsl(var(--foreground) / .16)}.skill-detail-head{flex-shrink:0;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 18px 14px;border-bottom:1px solid hsl(var(--border))}.skill-detail-heading{min-width:0;display:flex;align-items:flex-start;gap:11px}.skill-detail-heading>div{min-width:0}.skill-detail-heading h2{margin:1px 0 4px;overflow:hidden;font-size:16px;font-weight:650;line-height:22px;text-overflow:ellipsis;white-space:nowrap}.skill-detail-heading p{display:-webkit-box;margin:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:17px;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skill-detail-close{width:30px;height:30px;flex:0 0 30px;padding:0}.skill-detail-meta{flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 18px;margin:0;padding:14px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas) / .45)}.skill-detail-meta>div{min-width:0}.skill-detail-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:10.5px}.skill-detail-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;line-height:17px;text-overflow:ellipsis;white-space:nowrap}.skill-detail-content{flex:1;min-height:0;display:flex;flex-direction:column}.skill-detail-content-title{height:40px;flex:0 0 40px;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid hsl(var(--border));font-size:12px;font-weight:600}.skill-detail-content>.skillcenter-loading,.skill-detail-content>.skillcenter-error,.skill-detail-content>.skillcenter-empty{flex:1;min-height:0}.skill-detail-markdown{flex:1;min-height:0;overflow-y:auto;padding:18px 22px 28px;overflow-wrap:anywhere}@media (max-width: 760px){.skillcenter-browser{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr))}.skillcenter-panel+.skillcenter-panel{border-top:1px solid hsl(var(--border));border-left:0}.skill-detail-meta{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 560px){.skillcenter-regions{grid-template-columns:repeat(2,46px)}.skillcenter-browser{gap:8px}.skillcenter-item-meta{gap:4px 6px}.skillcenter-meta-text{max-width:132px}.skill-detail-backdrop{padding:8px}.skill-detail-dialog{border-radius:10px}.skill-detail-meta{grid-template-columns:minmax(0,1fr);gap:8px;max-height:180px;overflow-y:auto}}.addagent{flex:1;min-height:0;overflow-y:auto;display:flex;justify-content:center;align-items:flex-start;padding:8vh 16px 16px}.addagent-card{width:100%;max-width:480px}.addagent-title{margin:0 0 6px;font-size:20px;font-weight:650;letter-spacing:-.01em}.addagent-sub{margin:0 0 22px;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.addagent-field{display:block;margin-bottom:14px}.addagent-label{display:block;margin-bottom:6px;font-size:12.5px;font-weight:500;color:hsl(var(--muted-foreground))}.addagent-input{width:100%;border:1px solid hsl(var(--border));border-radius:10px;padding:10px 12px;font:inherit;font-size:14px;background:hsl(var(--background));color:hsl(var(--foreground))}.addagent-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.addagent-error{margin:4px 0 14px;padding:9px 12px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.addagent-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.addagent-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:14px;font-weight:500;cursor:pointer;transition:background .12s,opacity .12s}.addagent-btn--ghost{background:none;border-color:hsl(var(--border));color:hsl(var(--foreground))}.addagent-btn--ghost:hover{background:hsl(var(--foreground) / .05)}.addagent-btn--primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.addagent-btn--primary:hover:not(:disabled){opacity:.88}.addagent-btn:disabled{opacity:.4;cursor:default}.addagent-btn .icon{width:15px;height:15px}.search{flex:1;min-height:0;display:flex;flex-direction:column;width:100%;max-width:720px;margin:0 auto;padding:28px 16px 16px}.search-box{position:relative;display:flex;align-items:center;gap:0;padding:5px 6px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));transition:border-color .16s,box-shadow .16s}.search-box:focus-within{border-color:hsl(var(--foreground) / .3);box-shadow:0 0 0 3px hsl(var(--foreground) / .035)}.search-source-picker-wrap{position:relative;flex:0 0 auto}.search-source-picker{display:inline-flex;align-items:center;gap:5px;max-width:176px;height:34px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;cursor:pointer}.search-source-picker:hover,.search-source-picker[aria-expanded=true]{background:hsl(var(--foreground) / .045)}.search-source-picker>span{flex:0 0 auto;font-size:13px;font-weight:550}.search-source-picker>small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.search-source-chevron{width:12px;height:12px;flex:0 0 auto;color:hsl(var(--muted-foreground));transition:transform .15s ease}.search-source-chevron.open{transform:rotate(180deg)}.search-source-menu{position:absolute;z-index:30;top:calc(100% + 9px);left:-6px;display:flex;width:224px;padding:5px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .1);flex-direction:column}.search-source-menu>button{display:flex;min-width:0;padding:8px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;flex-direction:column;gap:2px}.search-source-menu>button:hover:not(:disabled),.search-source-menu>button[aria-selected=true]{background:hsl(var(--foreground) / .055)}.search-source-menu>button:disabled{color:hsl(var(--muted-foreground));cursor:default}.search-source-menu>button>span{font-size:12.5px;font-weight:550}.search-source-menu>button>small{overflow:hidden;max-width:100%;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.search-box-divider{width:1px;height:18px;margin:0 11px 0 5px;background:hsl(var(--border))}.search-input{flex:1;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px}.search-input::placeholder{color:hsl(var(--muted-foreground))}.search-input:disabled{cursor:default}.search-go{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.search-go:hover:not(:disabled){opacity:.85}.search-go:active:not(:disabled){transform:scale(.94)}.search-go:disabled{opacity:.3;cursor:default}.search-go .icon{width:17px;height:17px}.search-results{flex:1;min-height:0;overflow-y:auto;margin-top:12px;display:flex;flex-direction:column;gap:4px}.search-empty{padding:40px 8px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.search-result{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:12px 14px;border:none;border-radius:12px;background:none;color:hsl(var(--foreground));font:inherit;cursor:pointer;transition:background .12s}.search-result:hover{background:hsl(var(--foreground) / .05)}.search-result-static{cursor:default;border:1px solid transparent}.search-result-static:hover{border-color:hsl(var(--border));background:hsl(var(--foreground) / .025)}a.search-result{text-decoration:none;color:inherit}.search-result-ext{width:12px;height:12px;margin-left:4px;vertical-align:-1px;opacity:.6}.search-result-icon{width:16px;height:16px;flex-shrink:0;margin-top:2px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.search-result-body{min-width:0;flex:1}.search-result-head{display:flex;align-items:baseline;gap:10px;justify-content:space-between}.search-result-title{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-result-meta{flex-shrink:0;font-size:11.5px;color:hsl(var(--muted-foreground))}.search-result-snippet{margin-top:3px;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground));display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.search-result-snippet-expanded{-webkit-line-clamp:4;white-space:pre-wrap;overflow-wrap:anywhere}.login{position:fixed;top:10px;right:10px;bottom:10px;left:10px;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;display:flex;flex-direction:column;background:hsl(var(--panel));color:hsl(var(--foreground))}.login-top{padding:18px 24px}.login-brand{display:inline-flex;align-items:center;gap:9px;font-weight:600;font-size:15px;letter-spacing:-.01em}.login-main{flex:1;display:flex;align-items:center;justify-content:center;padding:0 24px}.login-card{width:100%;max-width:420px}.login-title{margin:0 0 14px;font-size:28px;font-weight:700;line-height:1.2;letter-spacing:-.02em}.login-sub{margin:0 0 28px;color:hsl(var(--muted-foreground));font-size:15px}.login-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:14px 18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer;transition:background .15s,border-color .15s,transform .1s}.login-btn:hover{background:hsl(var(--accent));border-color:hsl(var(--ring) / .3)}.login-btn:active{transform:scale(.99)}.login-btn .icon{width:18px;height:18px}.login-powered{margin:18px 0 0;font-size:12px;color:hsl(var(--muted-foreground))}.login-legal{margin:6px 0 0;font-size:12px;color:hsl(var(--muted-foreground))}.login-legal a{color:inherit;font-weight:600;text-decoration:underline;text-decoration-color:hsl(var(--muted-foreground) / .45);text-underline-offset:2px}.login-legal a:hover{color:hsl(var(--foreground))}.login-footer{padding:18px 24px;text-align:center;font-size:12px;color:hsl(var(--muted-foreground))}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}.login-providers{display:flex;flex-direction:column;gap:10px}.login-provider-error{display:flex;flex-direction:column;align-items:flex-start;gap:12px;color:hsl(var(--destructive));font-size:13px}.login-provider-error p{margin:0}.login-name{display:flex;align-items:center;gap:8px}.login-name-input{flex:1;border:1px solid hsl(var(--border));border-radius:14px;padding:13px 16px;font:inherit;font-size:15px;background:hsl(var(--background));color:hsl(var(--foreground))}.login-name-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.login-name-go{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s}.login-name-go .icon{width:18px;height:18px}.login-name-go:disabled{opacity:.35;cursor:default}.login-hint{margin:8px 0 0;min-height:16px;line-height:16px;font-size:12px;color:hsl(var(--destructive))}.session-loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .6);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.main{position:relative}.topo{position:absolute;top:68px;right:18px;width:220px;max-height:calc(100% - 150px);overflow-y:auto;padding:12px;background:hsl(var(--canvas));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 4px 16px #0000000a;z-index:2}.topo-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}.topo-head-title{font-size:12px;font-weight:650;letter-spacing:.02em}.topo-head-sub{font-size:11px;color:hsl(var(--muted-foreground))}.topo-tree{display:flex;flex-direction:column;gap:4px}.topo-children{display:flex;flex-direction:column;gap:4px;margin-top:4px;margin-left:10px;padding-left:8px;border-left:1px solid hsl(var(--border))}.topo-node{display:flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));font-size:12px;transition:border-color .15s ease,background .15s ease,opacity .15s ease}.topo-icon{width:14px;height:14px;flex-shrink:0;opacity:.8}.topo-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.topo-badge{flex-shrink:0;font-size:10px;padding:1px 5px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.topo-node.is-active{border-color:hsl(var(--primary));background:hsl(var(--primary) / .08);animation:topo-pulse 1.4s ease-in-out infinite}.topo-node.is-active .topo-icon{opacity:1}.topo-node.is-onpath{border-color:hsl(var(--primary) / .4);background:hsl(var(--primary) / .04)}.topo-node.is-done{opacity:.55}.topo-remote{margin:3px 0 2px 22px;font-size:10.5px;color:hsl(var(--primary));animation:topo-blink 1.2s ease-in-out infinite}@keyframes topo-blink{0%,to{opacity:1}50%{opacity:.45}}.topo-path{display:flex;flex-wrap:wrap;align-items:center;gap:1px;margin-bottom:9px;padding:6px 8px;border-radius:7px;background:hsl(var(--primary) / .05);font-size:11px;line-height:1.4}.topo-path-seg{display:inline-flex;align-items:center;min-width:0}.topo-path-sep{width:12px;height:12px;flex-shrink:0;color:hsl(var(--muted-foreground))}.topo-path-name{color:hsl(var(--muted-foreground))}.topo-path-name.is-current{color:hsl(var(--primary));font-weight:600}@keyframes topo-pulse{0%,to{box-shadow:0 0 hsl(var(--primary) / .28)}50%{box-shadow:0 0 0 4px hsl(var(--primary) / 0)}}@media (max-width: 1200px){.topo{display:none}}.quick-create{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.qc-head{text-align:center;margin-bottom:28px}.qc-title{margin:0;font-size:26px;font-weight:650;letter-spacing:-.02em}.qc-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.qc-cards{display:grid;grid-template-columns:repeat(4,220px);justify-content:center;gap:16px}@media (max-width: 1240px){.qc-cards{grid-template-columns:repeat(2,220px)}}@media (max-width: 560px){.qc-cards{grid-template-columns:minmax(0,320px)}}.qc-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:20px;text-align:left;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--card));cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s}.qc-card:hover{border-color:hsl(var(--ring) / .35);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.qc-card-arrow{position:absolute;top:18px;right:18px;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.qc-card:hover .qc-card-arrow{opacity:1;transform:translate(0)}.qc-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;margin-bottom:6px;border-radius:12px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.qc-icon svg{width:20px;height:20px}.qc-card-title{font-size:15px;font-weight:600}.qc-card-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.navbar-title{min-width:0;max-width:min(60vw,640px);overflow:hidden;padding:0;font-size:15px;font-weight:600;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.create-stub{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:hsl(var(--muted-foreground))}.create-back{align-self:flex-start;margin:12px;border:none;background:none;font:inherit;font-size:13px;color:hsl(var(--muted-foreground));cursor:pointer}.create-back:hover{color:hsl(var(--foreground))}.navbar-crumbs{display:flex;align-items:center;gap:4px;min-width:0}.navbar-crumbs>.crumb:first-child{padding-left:0}.crumb{font-size:15px;font-weight:600;letter-spacing:-.01em;padding:2px 4px;border-radius:6px;white-space:nowrap}.crumb-link{border:none;background:none;font:inherit;font-weight:500;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.crumb-link:hover{color:hsl(var(--foreground));background:hsl(var(--foreground) / .05)}.crumb-current{color:hsl(var(--foreground))}.crumb-sep{width:15px;height:15px;color:hsl(var(--muted-foreground));flex-shrink:0}.confirm-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;display:flex;align-items:center;justify-content:center;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.confirm-box{width:340px;max-width:calc(100vw - 32px);padding:20px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 16px 48px -16px hsl(var(--foreground) / .3)}.confirm-title{font-size:15px;font-weight:600;margin-bottom:6px}.confirm-text{font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground));margin-bottom:18px}.confirm-actions{display:flex;justify-content:flex-end;gap:8px}.confirm-btn{padding:7px 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s}.confirm-btn:hover{background:hsl(var(--foreground) / .05)}.confirm-btn--danger{border-color:transparent;background:hsl(var(--destructive));color:#fff}.confirm-btn--danger:hover{background:hsl(var(--destructive) / .9)} diff --git a/veadk/webui/assets/index-BXS3Zyyl.css b/veadk/webui/assets/index-BXS3Zyyl.css new file mode 100644 index 00000000..0dcb7a36 --- /dev/null +++ b/veadk/webui/assets/index-BXS3Zyyl.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: GitHub + Description: Light theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-light + Current colors taken from GitHub's CSS +*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.manage{max-width:760px;margin:0 auto;padding:28px 24px 16px;width:100%;overflow-y:auto}.manage-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}.manage-title{margin:0 0 4px;font-size:20px;font-weight:650;color:hsl(var(--foreground))}.manage-sub{margin:0;font-size:13px;color:hsl(var(--muted-foreground))}.manage-head-actions{display:flex;align-items:center;gap:8px}.manage-region-picker{position:relative}.manage-region{display:inline-flex;align-items:center;justify-content:space-between;gap:10px;min-width:88px;height:34px;padding:0 10px;font-size:13px;font-weight:550;color:hsl(var(--foreground));background:hsl(var(--card));border:1px solid hsl(var(--border));border-radius:var(--radius);cursor:pointer;transition:background .12s ease,border-color .12s ease,box-shadow .12s ease}.manage-region:hover,.manage-region[aria-expanded=true]{background:hsl(var(--foreground) / .04);border-color:hsl(var(--foreground) / .2)}.manage-region:focus-visible{outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 3px hsl(var(--ring) / .14)}.manage-region-chevron{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .16s ease}.manage-region-chevron.is-open{transform:rotate(180deg)}.manage-region-menu{position:absolute;top:calc(100% + 6px);right:0;z-index:31;width:128px;padding:6px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 12px 32px hsl(var(--foreground) / .14),0 2px 8px hsl(var(--foreground) / .06);animation:manage-region-pop .14s ease-out}.manage-region-option{display:flex;align-items:center;justify-content:space-between;width:100%;height:36px;padding:0 9px;border:0;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px;text-align:left;cursor:pointer;transition:background .1s ease}.manage-region-option:hover,.manage-region-option:focus-visible{outline:none;background:hsl(var(--foreground) / .06)}.manage-region-option.is-selected{font-weight:600;background:hsl(var(--foreground) / .04)}.manage-region-option svg{width:15px;height:15px;color:hsl(var(--primary))}@keyframes manage-region-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.manage-refresh{display:inline-flex;align-items:center;gap:6px;flex:none;padding:7px 12px;font-size:13px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--card));color:hsl(var(--foreground));cursor:pointer}.manage-refresh:hover:not(:disabled){background:hsl(var(--foreground) / .05)}.manage-refresh:disabled{opacity:.6;cursor:default}.manage-error{padding:10px 12px;margin-bottom:16px;font-size:13px;color:hsl(var(--destructive));background:hsl(var(--destructive) / .08);border:1px solid hsl(var(--destructive) / .3);border-radius:var(--radius)}.manage-empty{display:flex;align-items:center;gap:8px;padding:40px 0;justify-content:center;font-size:14px;color:hsl(var(--muted-foreground))}.manage-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.manage-item{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--card))}.manage-item-row{display:flex;align-items:center;gap:8px}.manage-item-actions{flex:none;display:flex;align-items:center;gap:6px}.manage-item-toggle{display:flex;align-items:center;gap:8px;flex:1;min-width:0;padding:0;border:0;background:transparent;cursor:pointer;color:inherit;text-align:left}.manage-item-toggle .icon{flex:none;color:hsl(var(--muted-foreground))}.manage-item-main{display:flex;align-items:center;gap:10px;min-width:0}.manage-item-name{font-size:15px;font-weight:600;color:hsl(var(--foreground));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.manage-badge{flex:none;padding:2px 8px;font-size:11px;font-weight:500;border-radius:999px;border:1px solid transparent}.manage-badge.is-ok{color:#15803d;background:#15803d1a;border-color:#15803d40}.manage-badge.is-warn{color:#b45309;background:#b453091a;border-color:#b4530940}.manage-badge.is-bad{color:hsl(var(--destructive));background:hsl(var(--destructive) / .1);border-color:hsl(var(--destructive) / .35)}.manage-badge.is-muted{color:hsl(var(--muted-foreground));background:hsl(var(--foreground) / .05);border-color:hsl(var(--border))}.manage-item-meta{display:flex;align-items:center;gap:6px;padding-left:24px;font-size:12px;color:hsl(var(--muted-foreground));min-width:0}.manage-item-id{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.manage-item-dot{opacity:.5}.manage-del{flex:none;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--card));color:hsl(var(--muted-foreground));cursor:pointer}.manage-connect{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--card));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:550;cursor:pointer;transition:background .12s,border-color .12s,color .12s}.manage-connect:hover:not(:disabled){border-color:hsl(var(--foreground) / .28);background:hsl(var(--foreground) / .05)}.manage-connect:disabled{color:hsl(var(--muted-foreground));background:hsl(var(--foreground) / .035);cursor:default}@media (max-width: 700px){.manage-item-row{flex-wrap:wrap}.manage-item-toggle{flex-basis:100%}.manage-item-actions{width:100%;justify-content:flex-end;padding-left:24px}}.manage-del:hover:not(:disabled){color:hsl(var(--destructive));border-color:hsl(var(--destructive) / .4);background:hsl(var(--destructive) / .06)}.manage-del:disabled{opacity:.6;cursor:default}.manage-detail{margin-top:8px;padding:12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background))}.manage-detail-loading{display:flex;align-items:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground))}.manage-detail-card{margin-bottom:12px}.manage-kv{margin:0;display:grid;gap:4px}.manage-kv-row{display:grid;grid-template-columns:96px 1fr;gap:8px;font-size:13px}.manage-kv-row dt{color:hsl(var(--muted-foreground))}.manage-kv-row dd{margin:0;color:hsl(var(--foreground));word-break:break-word}.manage-envs{margin-top:10px}.manage-envs-head,.manage-tree-head{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));margin-bottom:6px}.manage-tree-head{margin-top:4px}.manage-env{display:flex;gap:8px;font-size:12px;padding:2px 0}.manage-env-k{color:hsl(var(--muted-foreground));flex:none}.manage-env-v{color:hsl(var(--foreground));word-break:break-all}.manage-env-masked{padding:0;border:0;background:none;color:hsl(var(--muted-foreground));font:inherit;letter-spacing:2px;cursor:pointer;-webkit-user-select:none;user-select:none}.manage-tree-note{font-size:12px;color:hsl(var(--muted-foreground));padding:4px 0}.manage-tree{padding:3px 0}.manage-tree-node{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.manage-tree-name{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.manage-tree-type{font-size:10px;font-weight:600;padding:1px 6px;border-radius:999px;color:hsl(var(--primary));background:hsl(var(--primary) / .1);border:1px solid hsl(var(--primary) / .3)}.manage-tree-model{font-size:11px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.manage-tree-tools{display:flex;flex-wrap:wrap;gap:4px;margin:3px 0 0 2px}.manage-tree-tool{font-size:10px;padding:1px 6px;border-radius:4px;color:hsl(var(--muted-foreground));background:hsl(var(--foreground) / .05);border:1px solid hsl(var(--border))}.text-shimmer.text-shimmer{color:transparent;background-size:200% auto;background-position:200% center;background-clip:text;-webkit-background-clip:text;animation:text-shimmer 4s linear infinite}@keyframes text-shimmer{to{background-position:-200% center}}@media (prefers-reduced-motion: reduce){.text-shimmer.text-shimmer{animation:none;background-position:50% center}}.builtin-tool-head{--builtin-tool-accent: 215 18% 42%;display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:3px 7px 3px 3px;border:0;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;transition:color .12s ease}.builtin-tool-head[data-tool-tone=search]{--builtin-tool-accent: 211 62% 42%}.builtin-tool-head[data-tool-tone=image]{--builtin-tool-accent: 28 67% 42%}.builtin-tool-head[data-tool-tone=video]{--builtin-tool-accent: 260 38% 48%}.builtin-tool-head[data-tool-tone=memory]{--builtin-tool-accent: 174 52% 34%}.builtin-tool-head[data-tool-tone=knowledge]{--builtin-tool-accent: 225 48% 45%}.builtin-tool-head:hover{color:hsl(var(--foreground))}.builtin-tool-icon{position:relative;width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center;color:hsl(var(--builtin-tool-accent))}.builtin-tool-icon>svg{width:18px;height:18px}.builtin-tool-label{font-size:13.5px;font-weight:400;line-height:1.35}.builtin-tool-head.is-done .builtin-tool-label{color:hsl(var(--muted-foreground))}.builtin-tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.builtin-tool-chevron.is-open{transform:rotate(90deg)}.new-chat-mode{position:relative;align-self:flex-start}.new-chat-mode__trigger{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:2px 7px 2px 5px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer;transition:color .12s ease,background .12s ease}.composer--new-chat .new-chat-mode__trigger{min-height:36px;font-size:15px}.new-chat-mode__trigger:hover,.new-chat-mode__trigger[aria-expanded=true]{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-mode__current{max-width:min(180px,42vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__trigger:focus-visible,.new-chat-mode__option:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:1px}.new-chat-mode__icon,.new-chat-mode__option-icon{display:inline-grid;place-items:center;flex:0 0 auto}.new-chat-mode__icon svg{width:15px;height:15px}.new-chat-mode__option-icon svg{width:18px;height:18px}.new-chat-mode svg{fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}.new-chat-mode__skill-icon path:first-child{fill:currentColor;stroke:none}.new-chat-mode__chevron{width:12px;height:12px;transition:transform .14s ease}.new-chat-mode__trigger[aria-expanded=true] .new-chat-mode__chevron{transform:rotate(180deg)}.new-chat-mode__menu{position:absolute;z-index:42;top:calc(100% + 7px);right:0;width:286px;padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-mode__option{display:grid;grid-template-columns:24px minmax(0,1fr) 18px;align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.new-chat-mode__option.is-active{background:hsl(var(--accent))}.new-chat-mode__option:disabled{cursor:not-allowed;opacity:.48}.new-chat-mode__copy{display:flex;min-width:0;flex-direction:column;gap:2px}.new-chat-mode__copy>span:last-child{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.new-chat-mode__label{display:flex;align-items:center;gap:7px;font-size:13px;line-height:1.3}.new-chat-mode__beta{padding:1px 5px;border:1px solid hsl(var(--border));border-radius:999px;color:hsl(var(--muted-foreground));font-size:9px;font-weight:500;line-height:1.2}.new-chat-mode__check{width:16px;height:16px;color:hsl(var(--primary))}@media (prefers-reduced-motion: reduce){.new-chat-mode__trigger,.new-chat-mode__chevron{transition:none}}.stk{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.stk-head{text-align:center;margin-bottom:26px}.stk-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em}.stk-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.stk-list{display:flex;flex-direction:column;gap:12px;width:100%;max-width:520px}.stk-card{display:flex;align-items:center;gap:14px;width:100%;padding:18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));cursor:pointer;font:inherit;text-align:left;transition:border-color .15s,box-shadow .15s,background .12s}.stk-card:hover{border-color:hsl(var(--ring) / .35);background:hsl(var(--foreground) / .02);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.stk-card-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.stk-card-icon svg{width:21px;height:21px}.stk-card-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.stk-card-title{font-size:15px;font-weight:600}.stk-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.stk-card-arrow{flex-shrink:0;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.stk-card:hover .stk-card-arrow{opacity:1;transform:translate(0)}.stk-card-disabled{opacity:.5;cursor:not-allowed}.stk-card-disabled:hover{border-color:hsl(var(--border));background:hsl(var(--card));box-shadow:none}.stk-card-disabled .stk-card-arrow{display:none}.stk-footer{margin-top:18px;width:100%;max-width:520px;display:flex;justify-content:center}.stk-import{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border:1px dashed hsl(var(--border));border-radius:9px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.stk-import:hover{color:hsl(var(--foreground));border-color:hsl(var(--ring) / .4);background:hsl(var(--foreground) / .03)}.stk-import svg{width:15px;height:15px}.code-browser-trigger{min-height:26px;display:inline-flex;align-items:center;gap:5px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:color .12s ease,background-color .12s ease}.code-browser-trigger svg{width:13px;height:13px}.code-browser-trigger:hover{background:hsl(var(--foreground) / .04);color:hsl(var(--foreground))}.code-browser-trigger:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:1px}.code-browser-backdrop{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:code-browser-fade-in .14s ease-out}.code-browser-dialog{width:min(1040px,92vw);height:min(720px,84vh);min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .16);animation:code-browser-rise-in .18s cubic-bezier(.2,.8,.2,1)}.code-browser-head{flex:0 0 58px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 16px 0 18px;border-bottom:1px solid hsl(var(--border))}.code-browser-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.code-browser-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-title-icon svg,.code-browser-close svg{width:16px;height:16px}.code-browser-title-wrap h2,.code-browser-title-wrap p{margin:0}.code-browser-title-wrap h2{color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.code-browser-title-wrap p{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.code-browser-close{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.code-browser-close:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-workspace{flex:1;min-height:0;display:flex}.code-browser-sidebar{flex:0 0 220px;min-width:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .22)}.code-browser-sidebar-head,.code-browser-path{flex:0 0 38px;min-height:38px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.code-browser-sidebar-head{justify-content:space-between;padding:0 12px;color:hsl(var(--muted-foreground));font-size:11px;font-weight:650}.code-browser-sidebar-head span{font-variant-numeric:tabular-nums;font-weight:500}.code-browser-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.code-browser-file,.code-browser-folder{width:100%;min-height:30px;display:flex;align-items:center;gap:6px;padding-top:4px;padding-right:10px;padding-bottom:4px;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;text-align:left;cursor:pointer}.code-browser-file:hover,.code-browser-folder:hover{background:hsl(var(--foreground) / .045);color:hsl(var(--foreground))}.code-browser-file.is-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.code-browser-file svg,.code-browser-folder svg{width:14px;height:14px;flex:0 0 auto}.code-browser-folder>svg:first-child{width:12px;height:12px;transition:transform .12s ease}.code-browser-folder>svg:first-child.is-open{transform:rotate(90deg)}.code-browser-file span,.code-browser-folder span,.code-browser-path span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-browser-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.code-browser-path{gap:7px;padding:0 13px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px}.code-browser-path svg{width:13px;height:13px;flex:0 0 auto}.code-browser-editor{flex:1;min-height:0;overflow:hidden}.code-browser-editor>div,.code-browser-editor .cm-theme,.code-browser-editor .cm-editor{height:100%}.code-browser-editor .cm-scroller{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12.5px}.code-browser-empty{height:100%;display:grid;place-items:center;padding:20px;color:hsl(var(--muted-foreground));font-size:12px}@keyframes code-browser-fade-in{0%{opacity:0}to{opacity:1}}@keyframes code-browser-rise-in{0%{opacity:0;transform:translateY(8px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 720px){.code-browser-backdrop{padding:12px}.code-browser-dialog{width:100%;height:min(760px,92vh)}.code-browser-sidebar{flex-basis:168px}}@media (prefers-reduced-motion: reduce){.code-browser-backdrop,.code-browser-dialog{animation:none}}.pp-root{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.pp-toolbar{flex:0 0 auto;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:10px 24px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-toolbar-left,.pp-toolbar-actions,.pp-actions{display:flex;align-items:center}.pp-toolbar-left{min-width:0;gap:18px}.pp-toolbar-actions{flex:0 0 auto;gap:8px}.pp-toolbar-back{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer}.pp-toolbar-back:hover{color:hsl(var(--foreground))}.pp-toolbar-title{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-secondary,.pp-deploy{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border-radius:6px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.pp-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.pp-secondary:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--accent))}.pp-deploy{min-width:82px;border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-deploy:hover:not(:disabled){background:hsl(var(--primary) / .9)}.pp-deploy:disabled,.pp-secondary:disabled{opacity:.55;cursor:default}.pp-body{flex:1;min-height:0;min-width:0;display:flex}.pp-files-area{flex:1 1 auto;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.pp-sidebar{flex:0 0 218px;width:218px;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .24)}.pp-sidebar-head,.pp-main-head{flex:0 0 42px;min-height:42px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.pp-sidebar-head{gap:8px;padding:0 9px 0 14px}.pp-project-name{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:650;letter-spacing:.04em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.pp-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.pp-row{width:100%;min-height:29px;display:flex;align-items:center;gap:6px;padding:4px 8px;border:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.pp-row:hover{background:hsl(var(--foreground) / .045)}.pp-file.pp-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.pp-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-folder .pp-label{color:hsl(var(--muted-foreground))}.pp-ic{width:15px;height:15px;flex:0 0 auto}.pp-chevron{color:hsl(var(--muted-foreground));transition:transform .12s ease}.pp-chevron.pp-open{transform:rotate(90deg)}.pp-icon-btn{width:28px;height:28px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-icon-btn:hover:not(:disabled){background:hsl(var(--foreground) / .07);color:hsl(var(--foreground))}.pp-icon-btn:disabled{opacity:.45;cursor:default}.pp-danger:hover:not(:disabled){color:hsl(var(--destructive))}.pp-new-input{width:calc(100% - 16px);height:30px;margin:2px 8px 6px;padding:0 8px;border:1px solid hsl(var(--ring) / .55);border-radius:4px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.pp-empty,.pp-placeholder{width:100%;padding:28px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.pp-main{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.pp-main-head{gap:12px;padding:0 10px 0 14px;background:hsl(var(--background))}.pp-path{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-actions{gap:2px}.pp-content{flex:1;min-height:0;min-width:0;display:flex;overflow:hidden}.pp-codemirror,.pp-codemirror>div,.pp-codemirror .cm-editor{width:100%;height:100%;min-height:0}.pp-codemirror .cm-editor{overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground));font-size:12.5px}.pp-codemirror .cm-scroller{overflow:auto;overscroll-behavior:none;scroll-padding-block:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.58}.pp-codemirror .cm-content{padding:10px 0 0}.pp-codemirror .cm-line{padding:0 14px 0 8px}.pp-codemirror .cm-content>.cm-line:last-child:has(>br:only-child){display:none}.pp-codemirror .cm-gutters{border-right:1px solid hsl(var(--border) / .7);background:hsl(var(--secondary) / .2);color:hsl(var(--muted-foreground) / .65)}.pp-codemirror .cm-activeLine,.pp-codemirror .cm-activeLineGutter{background:hsl(var(--foreground) / .035)}.pp-codemirror .cm-focused{outline:none}.pp-editor-loading{height:100%;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12px}.pp-pre{flex:1;width:100%;height:100%;box-sizing:border-box;margin:0;padding:14px 16px 0;overflow:auto;background:hsl(var(--background));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px;font-style:normal;font-variant-ligatures:none;font-weight:400;line-height:1.58;-moz-tab-size:2;tab-size:2;white-space:pre}.pp-root.is-deploy .pp-body{display:grid;grid-template-columns:minmax(260px,3fr) minmax(520px,7fr)}.pp-root.is-deploy .pp-files-area{display:none}.pp-topology-pane{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-topology-head{flex:0 0 58px;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;border-bottom:1px solid hsl(var(--border))}.pp-topology-title{color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-topology-count{margin-top:2px;color:hsl(var(--muted-foreground));font-size:10.5px}.pp-topology-scroll{flex:1;min-height:0;overflow-y:auto;padding:12px 12px 16px}.pp-topology-tree{padding-bottom:12px}.pp-topology-branch{position:relative}.pp-topology-children{position:relative;display:flex;flex-direction:column;gap:2px;margin-top:2px}.pp-topology-children:before{content:"";position:absolute;top:0;bottom:6px;left:8px;width:1px;background:hsl(var(--border))}.pp-agent-node{position:relative;width:100%;min-height:49px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:7px 9px;border:1px solid transparent;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:default;transition:border-color .12s ease,background-color .12s ease}.pp-agent-node:hover,.pp-agent-node:focus-visible,.pp-agent-node.is-inspected{border-color:hsl(var(--primary) / .16);outline:none;background:hsl(var(--primary) / .04)}.pp-agent-node-icon,.pp-agent-inspector-icon{display:inline-flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground))}.pp-agent-node-icon{width:24px;height:24px;flex:0 0 24px}.pp-agent-node-icon svg,.pp-agent-inspector-icon svg{width:15px;height:15px}.pp-agent-node-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.pp-agent-node-name{overflow:hidden;color:hsl(var(--foreground));font-size:12.5px;font-weight:550;text-overflow:ellipsis;white-space:nowrap}.pp-agent-node-type{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.pp-agent-child-count{flex:0 0 auto;min-width:18px;padding:1px 5px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:9.5px;text-align:center}.pp-agent-inspector{padding:13px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .22)}.pp-agent-inspector-head{display:flex;align-items:center;gap:9px}.pp-agent-inspector-icon{width:28px;height:28px;flex:0 0 28px;border-radius:7px;background:hsl(var(--background))}.pp-agent-inspector-head>div{min-width:0;display:flex;flex-direction:column;gap:1px}.pp-agent-inspector-head strong{overflow:hidden;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-agent-inspector-head span,.pp-agent-inspector p{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-agent-inspector p{margin:10px 0 0;line-height:1.5}.pp-agent-config-grid{display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 12px;margin:12px 0 0;padding-top:11px;border-top:1px solid hsl(var(--border) / .72);font-size:10.5px}.pp-agent-config-grid dt{color:hsl(var(--muted-foreground))}.pp-agent-config-grid dd{min-width:0;margin:0;overflow-wrap:anywhere;color:hsl(var(--foreground));text-align:right}.pp-topology-actions{flex:0 0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px 12px;border-top:1px solid hsl(var(--border))}.pp-topology-actions .pp-secondary{width:100%;padding-inline:8px}.pp-config{min-width:0;width:auto;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.pp-config-head{flex:0 0 58px;height:58px;box-sizing:border-box;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid hsl(var(--border))}.pp-config-title{color:hsl(var(--foreground));font-size:17px;font-weight:650;letter-spacing:-.01em}.pp-env-sub{margin-top:4px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.pp-config-scroll{flex:1;min-height:0;overflow-y:auto}.pp-config-actions{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:6px;padding:10px 14px;border-top:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-config-actions .pp-deploy{min-width:108px}.pp-config-section{padding:16px 18px 18px}.pp-config-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650;letter-spacing:-.01em}.pp-config-select,.pp-channel-fields input,.pp-network-fields input,.pp-env-row input{width:100%;min-width:0;height:34px;box-sizing:border-box;padding:0 10px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;transition:border-color .12s ease,box-shadow .12s ease}.pp-config-select:focus,.pp-channel-fields input:focus,.pp-network-fields input:focus,.pp-env-row input:focus{border-color:hsl(var(--ring) / .55);box-shadow:0 0 0 2px hsl(var(--ring) / .08)}.pp-config-select:disabled,.pp-channel-fields input:disabled,.pp-network-fields input:disabled,.pp-env-row input:disabled{opacity:.55}.pp-channel{width:auto;display:inline-flex;align-items:center;justify-content:flex-start;gap:10px;padding:2px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.pp-channel:disabled{cursor:default}.pp-channel-title{color:hsl(var(--foreground));font-size:13px;font-weight:560}.pp-switch{position:relative;flex:0 0 34px;width:34px;height:19px;border-radius:999px;background:hsl(var(--foreground) / .16);transition:background-color .15s ease}.pp-switch span{position:absolute;top:3px;left:3px;width:13px;height:13px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .18);transition:transform .15s ease}.pp-channel.is-on .pp-switch{background:hsl(var(--primary))}.pp-channel.is-on .pp-switch span{transform:translate(15px)}.pp-channel-fields{display:flex;flex-direction:column;gap:12px;margin-top:14px}.pp-channel-fields label{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-channel-fields label>span{color:hsl(var(--foreground));font-weight:560}.pp-channel-fields small{margin-left:5px;color:hsl(var(--destructive));font-size:10px;font-weight:500}.pp-channel-fields code{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-channel-fields input{grid-column:1 / -1}.pp-network-modes{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;padding:3px;border:1px solid hsl(var(--border) / .8);border-radius:6px;background:hsl(var(--secondary) / .42)}.pp-network-modes button{min-height:29px;padding:0 7px;border:0;border-radius:4px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer}.pp-network-modes button.is-on{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .08)}.pp-network-modes button:disabled{cursor:default}.pp-network-fields{display:flex;flex-direction:column;gap:12px;margin-top:14px}.pp-network-fields label:not(.pp-network-check){display:flex;flex-direction:column;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-network-fields small{font-size:10.5px;font-weight:400}.pp-network-check{display:flex;align-items:center;gap:8px;color:hsl(var(--foreground));font-size:12.5px;cursor:pointer}.pp-network-check input{width:14px;height:14px;margin:0}.pp-env-section{padding-bottom:16px}.pp-env-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.pp-env-head .pp-config-label{display:flex;align-items:center;gap:7px;margin-bottom:0}.pp-env-count{display:inline-flex;align-items:center}.pp-env-table{display:flex;flex-direction:column;margin-top:10px}.pp-env-group{padding:4px 7px 0;border:1px solid hsl(var(--border) / .75);border-radius:6px;background:hsl(var(--secondary) / .16)}.pp-env-group-head{display:flex;align-items:center;justify-content:space-between;padding:5px 1px 3px;color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.pp-env-group-head small{color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:450}.pp-env-group-head-custom{margin-top:12px}.pp-env-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px;align-items:center;gap:7px;padding:7px 0;border-bottom:1px solid hsl(var(--border) / .65)}.pp-env-row input:first-child{font-family:inherit;font-size:13px}.pp-env-row-derived:last-child{border-bottom:0}.pp-env-key-fixed{background:hsl(var(--secondary) / .32)!important;cursor:default}.pp-env-source{color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.pp-env-remove{width:28px;height:28px}.pp-env-add{width:100%;min-height:52px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer}.pp-env-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025);color:hsl(var(--foreground))}.pp-env-add:disabled{opacity:.5}.pp-steps{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none}.pp-step{position:relative;min-height:34px;display:flex;align-items:flex-start;gap:9px}.pp-step:not(:last-child):after{content:"";position:absolute;top:20px;bottom:-2px;left:9px;width:1px;background:hsl(var(--border))}.pp-step-dot{z-index:1;width:19px;height:19px;flex:0 0 19px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10px}.pp-step-body{min-width:0;display:flex;flex-direction:column;padding-top:1px}.pp-step-label{color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560}.pp-step-msg{max-width:300px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-step.is-active .pp-step-dot{border-color:hsl(var(--primary));color:hsl(var(--primary))}.pp-step.is-done .pp-step-dot{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-step.is-failed .pp-step-dot{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.pp-error{margin:14px 18px;padding:10px 11px;border:1px solid hsl(var(--destructive) / .22);border-radius:5px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.pp-deploy-result{margin:14px 18px 18px;padding:14px;border:1px solid hsl(var(--primary) / .2);border-radius:6px;background:hsl(var(--primary) / .035)}.pp-deploy-result-header{margin-bottom:12px;color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-deploy-result-body{display:flex;flex-direction:column;gap:10px}.pp-deploy-result-field{display:flex;flex-direction:column;gap:4px}.pp-deploy-result-field label{color:hsl(var(--muted-foreground));font-size:12.5px}.pp-deploy-result-field code{overflow-wrap:anywhere;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px}.pp-deploy-result-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.pp-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;min-height:0}.pp-confirm-head{flex-basis:60px}.pp-confirm-icon{background:#f59f0a1f;color:#ba6708}.pp-confirm-body{padding:24px 20px}.pp-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.pp-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.pp-confirm-actions button{min-width:76px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.pp-confirm-actions button:hover{background:hsl(var(--secondary))}.pp-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.pp-confirm-actions .is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-confirm-actions .is-primary:hover{background:hsl(var(--primary) / .9)}.pp-deploy-result-btn,.pp-console-link-btn{min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border-radius:5px;font-size:12.5px;font-weight:600;text-decoration:none;cursor:pointer}.pp-deploy-result-btn{border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-console-link-btn{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.spin{animation:pp-spin .85s linear infinite}@keyframes pp-spin{to{transform:rotate(360deg)}}@media (max-width: 1120px){.pp-root.is-deploy .pp-body{grid-template-columns:minmax(235px,3fr) minmax(470px,7fr)}.pp-sidebar{flex-basis:190px;width:190px}}@media (max-width: 860px){.pp-toolbar{align-items:flex-start;flex-direction:column;gap:8px}.pp-toolbar-actions{width:100%}.pp-body{overflow-y:auto;flex-direction:column}.pp-root.is-deploy .pp-body{display:flex}.pp-topology-pane{flex:0 0 auto;min-height:420px;border-right:0;border-bottom:1px solid hsl(var(--border))}.pp-files-area{min-height:520px}.pp-config{width:100%;min-height:520px;border-top:1px solid hsl(var(--border));border-left:0}}.ic-root{display:flex;flex-direction:column;height:100%;min-height:0}.ic-body{flex:1;min-height:0;display:flex}.ic-chat{flex:0 0 380px;width:380px;min-width:0;display:flex;flex-direction:column;min-height:0;border-right:1px solid hsl(var(--border))}.ic-transcript{flex:1;min-height:0;overflow-y:auto;padding:24px 20px 12px}.ic-turn{display:flex;gap:10px;max-width:760px;margin:0 auto 16px}.ic-turn:last-child{margin-bottom:0}.ic-turn--assistant{justify-content:flex-start}.ic-turn--user{justify-content:flex-end}.ic-avatar{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:hsl(var(--secondary));color:#7c48f4}.ic-avatar-icon{width:17px;height:17px}.ic-bubble{max-width:78%;padding:11px 15px;border-radius:16px;font-size:14px;line-height:1.6;word-break:break-word}.ic-turn--user .ic-bubble{white-space:pre-wrap}.ic-turn--assistant .ic-bubble{background:hsl(var(--secondary));color:hsl(var(--foreground));border-top-left-radius:5px}.ic-turn--user .ic-bubble{background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-top-right-radius:5px}.ic-bubble .md>:first-child{margin-top:0}.ic-bubble .md>:last-child{margin-bottom:0}.ic-bubble--typing{display:inline-flex;align-items:center;gap:4px;padding:14px 16px}.ic-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground));animation:ic-bounce 1.2s ease-in-out infinite}.ic-dot:nth-child(2){animation-delay:.16s}.ic-dot:nth-child(3){animation-delay:.32s}@keyframes ic-bounce{0%,60%,to{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.ic-error{flex-shrink:0;display:flex;align-items:center;gap:8px;max-width:760px;width:100%;margin:0 auto;padding:9px 14px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px;line-height:1.45}.ic-error-icon{width:15px;height:15px;flex-shrink:0}.ic-composer{flex-shrink:0;max-width:760px;width:100%;margin:0 auto;padding:8px 20px 18px}.ic-composer-box{display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 12px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background));transition:border-color .15s,box-shadow .15s}.ic-composer-box:focus-within{border-color:hsl(var(--ring) / .4);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.ic-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 2px;max-height:160px;overflow-y:auto}.ic-input::placeholder{color:hsl(var(--muted-foreground))}.ic-input:disabled{opacity:.6}.ic-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.ic-send-icon{width:17px;height:17px}.ic-send:hover:not(:disabled){opacity:.85}.ic-send:active:not(:disabled){transform:scale(.94)}.ic-send:disabled{opacity:.3;cursor:default}.ic-composer-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.ic-composer-hint{flex:1;text-align:center;font-size:11px;color:hsl(var(--muted-foreground))}.ic-ab-toggle{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;cursor:pointer;-webkit-user-select:none;user-select:none}.ic-ab-checkbox{position:absolute;opacity:0;width:0;height:0}.ic-ab-track{position:relative;display:inline-block;width:30px;height:17px;border-radius:999px;background:hsl(var(--muted-foreground) / .35);transition:background .15s}.ic-ab-thumb{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0003;transition:transform .15s}.ic-ab-checkbox:checked+.ic-ab-track{background:hsl(var(--primary))}.ic-ab-checkbox:checked+.ic-ab-track .ic-ab-thumb{transform:translate(13px)}.ic-ab-checkbox:disabled+.ic-ab-track{opacity:.5}.ic-ab-checkbox:focus-visible+.ic-ab-track{box-shadow:0 0 0 3px hsl(var(--ring) / .25)}.ic-ab-label{font-size:12px;font-weight:600;color:hsl(var(--foreground))}.ic-compare{flex:1;min-height:0;display:flex}.ic-compare-divider{flex:0 0 1px;background:hsl(var(--border))}.ic-pane{flex:1 1 0;min-width:0;min-height:0;display:flex;flex-direction:column}.ic-pane-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background))}.ic-pane-title{display:flex;align-items:center;gap:8px;min-width:0}.ic-pane-tag{flex-shrink:0;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;color:#fff}.ic-pane-tag--a{background:#7c48f4}.ic-pane-tag--b{background:#0da2e7}.ic-pane-model{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ic-adopt{flex-shrink:0;padding:6px 12px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font-size:12px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.ic-adopt:hover:not(:disabled){opacity:.85}.ic-adopt:active:not(:disabled){transform:scale(.96)}.ic-adopt:disabled{opacity:.4;cursor:default}.ic-pane-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.ic-pane-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-size:13px;color:hsl(var(--muted-foreground))}.ic-pane-spinner{width:22px;height:22px;color:#7c48f4;animation:ic-spin .9s linear infinite}@keyframes ic-spin{to{transform:rotate(360deg)}}.ic-pane-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.ic-preview{flex:1 1 0;min-width:0;display:flex;flex-direction:column;min-height:0;background:hsl(var(--muted) / .35)}.ic-preview-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px;text-align:center}.ic-preview-empty-icon{position:relative;display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:18px;background:#7c48f414;color:#7c48f4;margin-bottom:4px}.ic-preview-empty-glyph{width:30px;height:30px}.ic-preview-empty-spark{position:absolute;top:9px;right:9px;width:14px;height:14px}.ic-preview-empty-title{font-size:15px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.ic-preview-empty-sub{font-size:13px;line-height:1.55;color:hsl(var(--muted-foreground));max-width:240px}@media (max-width: 920px){.ic-body{flex-direction:column}.ic-preview{width:100%;border-left:none;border-top:1px solid hsl(var(--border));min-height:320px}}.cw-root{--cw-workbench-toolbar-height: 64px;flex:1;min-height:0;display:flex;flex-direction:column;height:100%;color:hsl(var(--foreground))}.cw-editor{flex:1;min-height:0;display:flex;align-items:stretch}.cw-tree{flex-shrink:0;width:248px;overflow-y:auto;padding:16px 14px;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.cw-tree-head{font-size:12px;font-weight:650;letter-spacing:.02em;color:hsl(var(--muted-foreground));padding:0 6px;margin-bottom:10px}.cw-tree-branch{display:flex;flex-direction:column}.cw-tree-node{position:relative;display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:8px;cursor:pointer;font-size:13px;border:1px solid transparent;transition:background .12s ease,border-color .12s ease}.cw-tree-node:hover{background:hsl(var(--accent))}.cw-tree-node.is-selected{background:hsl(var(--primary) / .04);border-color:hsl(var(--primary) / .16)}.cw-tree-node.is-invalid{background:hsl(var(--destructive) / .07);border-color:hsl(var(--destructive) / .5)}.cw-tree-node.is-invalid.is-selected{background:hsl(var(--destructive) / .1);border-color:hsl(var(--destructive) / .6)}.cw-tree-node.is-draggable{cursor:grab}.cw-tree-node.is-draggable:active{cursor:grabbing}.cw-tree-node.is-dragover{background:hsl(var(--primary) / .1);border-color:hsl(var(--primary) / .45)}.cw-tree-icon{width:15px;height:15px;flex-shrink:0;opacity:.8}.cw-tree-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.cw-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.cw-tree-type{font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:hsl(var(--muted-foreground))}.cw-tree-actions{display:flex;align-items:center;gap:1px;flex-shrink:0;opacity:0;pointer-events:none;transition:opacity .12s ease}.cw-tree-node:hover .cw-tree-actions,.cw-tree-node.is-selected .cw-tree-actions{opacity:1;pointer-events:auto}.cw-tree-children{display:flex;flex-direction:column;gap:2px;margin-top:2px;margin-left:8px;padding-left:8px;border-left:1px solid hsl(var(--border))}.cw-detail{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-typebar{position:relative;z-index:5;flex-shrink:0;height:var(--cw-workbench-toolbar-height);background:hsl(var(--panel));border-bottom:1px solid hsl(var(--border));padding:10px 16px}.cw-typebar-inner{height:100%;display:flex;align-items:center;max-width:1080px;margin:0 auto}.cw-detail-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;padding:24px 16px 48px}.cw-detail-inner{max-width:780px;margin:0 auto}.cw-lower{display:flex;gap:8px;align-items:flex-start}.cw-detail .cw-form-col{flex:1;min-width:0;max-width:720px;margin:0}.cw-debug{flex-shrink:0;width:380px;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid hsl(var(--border));background:hsl(var(--panel));transition:width .22s cubic-bezier(.22,1,.36,1),min-width .22s cubic-bezier(.22,1,.36,1),height .22s cubic-bezier(.22,1,.36,1),min-height .22s cubic-bezier(.22,1,.36,1),flex-basis .22s cubic-bezier(.22,1,.36,1),padding .18s ease}.cw-debug:not(.is-collapsed)>*{animation:cw-debug-content-in .18s ease-out both}.cw-debug.is-collapsed .cw-debug-expand{animation:cw-debug-control-in .18s .06s ease-out both}@keyframes cw-debug-content-in{0%{opacity:0;transform:scale(.985)}}@keyframes cw-debug-control-in{0%{opacity:0;transform:scale(.9)}}@media (prefers-reduced-motion: reduce){.cw-debug{transition:none}.cw-debug:not(.is-collapsed)>*,.cw-debug.is-collapsed .cw-debug-expand{animation:none}}.cw-debug-head{flex-shrink:0;height:var(--cw-workbench-toolbar-height);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid hsl(var(--border))}.cw-debug-head-actions{display:flex;align-items:center;gap:6px}.cw-debug-collapse,.cw-debug-expand{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s,background .12s,transform .12s}.cw-debug-collapse{width:24px;height:24px}.cw-debug-collapse:hover,.cw-debug-expand:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.cw-debug-expand:hover{transform:scale(1.06)}.cw-debug.is-collapsed{width:48px;min-width:48px;height:100%;min-height:0;align-items:center;padding-top:14px}.cw-debug-expand{width:34px;height:34px;min-height:34px}.cw-debug-title{display:inline-flex;align-items:center;gap:7px;font-size:17px;font-weight:650;color:hsl(var(--foreground))}.cw-debug-deploy,.cw-debug-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:6px 10px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:opacity .12s,transform .1s}.cw-debug-deploy{gap:4px;font-size:13px}.cw-debug-deploy .cw-i{width:13px;height:13px;transition:transform .18s ease}.cw-debug-deploy:hover:not(:disabled) .cw-i:not(.cw-spin){transform:translate(2px)}@media (prefers-reduced-motion: reduce){.cw-debug-deploy .cw-i{transition:none}.cw-debug-deploy:hover:not(:disabled) .cw-i:not(.cw-spin){transform:none}}.cw-debug-deploy:hover:not(:disabled),.cw-debug-start:hover:not(:disabled){opacity:.86}.cw-debug-deploy:active:not(:disabled),.cw-debug-start:active:not(:disabled){transform:scale(.96)}.cw-debug-deploy:disabled,.cw-debug-start:disabled{opacity:.45;cursor:default}.cw-debug-sub{flex-shrink:0;display:flex;flex-direction:column;gap:3px;padding:10px 16px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.cw-debug-deploy-error{margin:0 16px 12px;padding:8px 10px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px;line-height:1.45}.cw-debug-stage{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.cw-debug-body{flex:1;min-height:0;overflow-y:auto;padding:10px 16px 18px}.cw-debug-empty{min-height:120px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:14px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-start{color:hsl(var(--primary-foreground))}.cw-debug-run-icon{width:17px;height:17px;transition:transform .16s cubic-bezier(.22,1,.36,1)}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:translate(1.5px)}@media (prefers-reduced-motion: reduce){.cw-debug-run-icon{transition:none}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:none}}.cw-debug-progress{display:flex;flex-direction:column;gap:8px}.cw-debug-logline{display:flex;align-items:center;gap:8px;min-height:28px;padding:7px 9px;border-radius:9px;background:hsl(var(--foreground) / .04);color:hsl(var(--muted-foreground));font-size:12.5px}.cw-debug-logline .cw-i{color:hsl(var(--foreground))}.cw-debug-error{display:flex;flex-direction:column;gap:12px;color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-debug-error-detail,.cw-debug-msg-error{width:100%;min-width:0;color:hsl(var(--destructive));text-align:left}.cw-debug-error-detail .deploy-error-message-text,.cw-debug-msg-error .deploy-error-message-text{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px}.cw-debug-chat{min-height:100%;display:flex;flex-direction:column;gap:18px}.cw-debug-chat-empty{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-msg{display:flex;flex-direction:column;gap:6px;max-width:100%}.cw-debug-msg-user{align-items:flex-end}.cw-debug-msg-assistant{align-items:flex-start}.cw-debug-role{display:none}.cw-debug-content{max-width:100%;color:hsl(var(--foreground));font-size:14px;line-height:1.65;word-break:break-word}.cw-debug-msg-user .cw-debug-content{max-width:88%;padding:9px 14px;border-radius:18px;background:hsl(var(--secondary))}.cw-debug-msg-assistant .cw-debug-content{width:100%}.cw-debug-composer{flex-shrink:0;padding:10px 14px 14px;background:hsl(var(--panel))}.cw-debug-composerbox{display:flex;align-items:center;gap:6px;padding:6px 6px 6px 10px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background))}.cw-debug-input{flex:1;min-width:0;max-height:120px;padding:8px 4px;border:none;outline:none;resize:none;overflow-y:auto;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.5}.cw-debug-input::placeholder{color:hsl(var(--muted-foreground))}.cw-debug-send{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:50%;cursor:pointer;transition:opacity .15s,transform .1s,background .12s,color .12s}.cw-debug-send{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-debug-send:hover:not(:disabled){opacity:.85}.cw-debug-send:active:not(:disabled){transform:scale(.94)}.cw-debug-send:disabled{opacity:.3;cursor:default}.cw-debug-overlay{position:absolute;z-index:5;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:22px;background:hsl(var(--panel) / .5);backdrop-filter:blur(9px) saturate(.9);-webkit-backdrop-filter:blur(9px) saturate(.9)}.cw-debug-overlay-content{width:min(100%,290px);display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px;border:1px solid hsl(var(--border) / .72);border-radius:12px;background:hsl(var(--background) / .82);box-shadow:0 10px 30px hsl(var(--foreground) / .08);text-align:center}.cw-debug-overlay-title{color:hsl(var(--foreground));font-size:14px;font-weight:650}.cw-debug-overlay-copy{color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55}.cw-debug-overlay-progress{width:100%;display:flex;flex-direction:column;gap:8px}.cw-debug-overlay-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:2px}.cw-debug-ignore{min-height:30px;padding:6px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background) / .72);color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s,transform .1s}.cw-debug-ignore:hover:not(:disabled){border-color:hsl(var(--foreground) / .2);background:hsl(var(--background))}.cw-debug-ignore:active:not(:disabled){transform:scale(.96)}.cw-debug-ignore:disabled{opacity:.45;cursor:default}.cw-header{flex-shrink:0;display:flex;align-items:flex-start;gap:16px;padding:18px 24px 16px;border-bottom:1px solid hsl(var(--border))}.cw-header-title{flex:1;min-width:0}.cw-header-mode{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:hsl(var(--muted-foreground))}.cw-title{margin:5px 0 2px;font-size:21px;font-weight:650;letter-spacing:-.02em}.cw-subtitle{margin:0;font-size:13px;color:hsl(var(--muted-foreground))}.cw-progress-pill{flex-shrink:0;margin-top:2px;padding:5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}.cw-body{flex:1;min-height:0;overflow-y:auto}.cw-center{display:flex;align-items:flex-start;justify-content:center;gap:32px;max-width:960px;margin:0 auto;padding:32px 24px 80px}.cw-form-col{flex:1 1 auto;min-width:0;max-width:640px;display:flex;flex-direction:column;gap:44px}.cw-section{scroll-margin-top:24px}.cw-sec-head{margin-bottom:18px}.cw-sec-title{display:flex;align-items:center;gap:8px;margin:0 0 4px;font-size:17px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.cw-sec-required{padding:1px 7px;border-radius:999px;background:hsl(var(--foreground) / .08);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600;letter-spacing:.02em}.cw-sec-hint{margin:0;font-size:13px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-rail{position:sticky;top:12px;align-self:flex-start;flex-shrink:0;width:32px;margin-left:auto;padding:0;z-index:4}.cw-steps{position:relative;list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.cw-rail-track{position:absolute;left:15px;top:18px;bottom:18px;width:2px;border-radius:2px;background:hsl(var(--border));z-index:0}.cw-rail-fill{position:absolute;left:0;top:0;width:100%;border-radius:2px;background:hsl(var(--foreground) / .55)}.cw-step{position:relative;display:flex;align-items:center;justify-content:center;width:32px;min-height:36px;padding:0;border:none;border-radius:9px;background:none;text-align:left;cursor:pointer;font:inherit;transition:background .12s}.cw-step:hover{background:hsl(var(--foreground) / .05)}.cw-step.is-active{background:hsl(var(--foreground) / .06)}.cw-step:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-step-marker{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:32px;height:36px}.cw-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--foreground) / .25);transition:background .15s,width .15s,height .15s}.cw-step.is-active .cw-dot{width:10px;height:10px;background:hsl(var(--foreground));box-shadow:0 0 0 3px hsl(var(--panel))}.cw-step-check{width:14px;height:14px;padding:1px;border-radius:50%;background:hsl(var(--panel));color:hsl(var(--foreground) / .68)}.cw-step-tooltip{position:absolute;z-index:5;top:50%;right:calc(100% + 8px);padding:5px 8px;border-radius:6px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 4px 12px hsl(var(--foreground) / .12);font-size:11.5px;font-weight:550;white-space:nowrap;opacity:0;pointer-events:none;transform:translate(4px,-50%);transition:opacity .12s,transform .12s}.cw-step:hover .cw-step-tooltip,.cw-step:focus-visible .cw-step-tooltip{opacity:1;transform:translateY(-50%)}.cw-form{display:flex;flex-direction:column;gap:20px}.cw-section-desc{margin:0;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.cw-field{display:flex;flex-direction:column;gap:7px}.cw-more-options{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;margin-top:-4px;padding:4px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer;transition:color .14s ease}.cw-more-options:hover,.cw-more-options:focus-visible{color:hsl(var(--foreground))}.cw-more-options:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:3px;border-radius:4px}.cw-more-options-chevron{width:14px;height:14px;transition:transform .18s ease}.cw-more-options-chevron.is-open{transform:rotate(90deg)}.cw-more-options-count{margin-left:2px;padding:2px 7px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:10.5px;font-weight:600}.cw-model-advanced{display:flex;flex-direction:column;gap:20px;overflow:hidden}.cw-label{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-req{margin-left:2px;color:hsl(var(--destructive))}.cw-help{font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-remote-center-head{display:flex;flex-direction:column;gap:6px}.cw-remote-center-description{display:block;max-width:560px;margin:0;line-height:1.6}.cw-a2a-space-picker{display:flex;flex-direction:column;gap:8px}.cw-a2a-space-row{display:flex;align-items:center;gap:8px}.cw-a2a-space-select-wrap{position:relative;flex:1;min-width:0}.cw-a2a-space-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:34px;min-height:34px;gap:8px;padding:0 8px 0 10px;border:0;border-radius:6px;background-color:hsl(var(--muted) / .38);color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;letter-spacing:0}.cw-a2a-space-trigger[aria-expanded=true]{border-bottom-right-radius:0;border-bottom-left-radius:0;background-color:hsl(var(--background));filter:drop-shadow(0 2px 2px hsl(var(--foreground) / .2))}.cw-a2a-space-trigger:disabled{cursor:not-allowed;opacity:.5}.cw-a2a-space-trigger.is-error{box-shadow:0 0 0 1px hsl(var(--destructive) / .55)}.cw-a2a-space-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-trigger-icon{width:14px;height:14px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .14s ease}.cw-a2a-space-trigger[aria-expanded=true] .cw-a2a-space-trigger-icon{transform:rotate(90deg)}.cw-a2a-space-menu{position:absolute;z-index:30;top:100%;left:0;width:100%;max-height:238px;overflow-y:auto;padding:0;border-bottom-right-radius:6px;border-bottom-left-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));filter:drop-shadow(0 2px 2px hsl(var(--foreground) / .2));font-size:12px}.cw-a2a-space-option{display:flex;align-items:center;width:100%;min-height:32px;padding:8px;border:0;background:transparent;color:hsl(var(--foreground));cursor:default;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left}.cw-a2a-space-option:hover,.cw-a2a-space-option:focus-visible{outline:none;background:hsl(var(--muted) / .55)}.cw-a2a-space-option.is-selected{background:hsl(var(--muted) / .55);color:hsl(var(--foreground))}.cw-a2a-space-option:last-child{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.cw-a2a-space-refresh{flex-shrink:0;width:34px;height:34px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--muted) / .38);color:hsl(var(--foreground))}.cw-a2a-space-status{display:inline-flex;align-items:center;gap:6px}.cw-a2a-space-error{align-items:flex-start;padding:9px 11px;font-size:12.5px}.cw-error-text{font-size:12px;color:hsl(var(--destructive))}.cw-env-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:12px;margin-top:5px}.cw-env-field{display:flex;min-width:0;flex-direction:column;gap:6px}.cw-env-field-head{display:grid;min-width:0;gap:3px;color:hsl(var(--foreground));font-size:12px;font-weight:560}.cw-env-field-label{min-width:0;line-height:1.4;overflow-wrap:anywhere}.cw-env-field-head code{display:block;max-width:100%;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.cw-env-empty{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12px}.cw-input{min-width:0;width:100%;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .12s,box-shadow .12s}.cw-input::placeholder{color:hsl(var(--muted-foreground))}.cw-input:focus{outline:none;border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-input.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-textarea{width:100%;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.6;resize:vertical;transition:border-color .12s,box-shadow .12s}.cw-textarea::placeholder{color:hsl(var(--muted-foreground))}.cw-textarea:focus{outline:none;border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-textarea.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}@keyframes cw-error-shake-a{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}@keyframes cw-error-shake-b{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}.cw-error-shake-0{animation:cw-error-shake-a .28s ease-in-out}.cw-error-shake-1{animation:cw-error-shake-b .28s ease-in-out}@media (prefers-reduced-motion: reduce){.cw-error-shake-0,.cw-error-shake-1{animation:none}}.cw-textarea-sm{min-height:80px;max-height:160px;overflow-y:auto}.cw-textarea-lg{min-height:340px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.cw-markdown-loading,.cw-markdown-editor:not(.mdxeditor-popup-container){min-height:340px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background))}.cw-markdown-loading{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px}.cw-markdown-editor:not(.mdxeditor-popup-container){display:flex;flex-direction:column;max-height:420px;overflow:hidden;color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.cw-markdown-editor:not(.mdxeditor-popup-container):focus-within{border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-markdown-editor:not(.mdxeditor-popup-container).is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-markdown-toolbar{flex-shrink:0;min-height:40px;padding:5px 8px;border:0;border-bottom:1px solid hsl(var(--border));border-radius:0;background:hsl(var(--muted) / .38)}.cw-markdown-toolbar button,.cw-markdown-toolbar [role=combobox]{color:hsl(var(--foreground))}.cw-markdown-content{min-height:298px;max-height:360px;overflow-y:auto;padding:18px 20px 28px;color:hsl(var(--foreground));font-size:14px;line-height:1.7}.cw-markdown-content:focus{outline:none}.cw-markdown-content h1,.cw-markdown-content h2,.cw-markdown-content h3{margin:1.1em 0 .45em;color:hsl(var(--foreground));font-weight:650;line-height:1.3}.cw-markdown-content h1:first-child,.cw-markdown-content h2:first-child,.cw-markdown-content h3:first-child{margin-top:0}.cw-markdown-content h1{font-size:20px}.cw-markdown-content h2{font-size:17px}.cw-markdown-content h3{font-size:15px}.cw-markdown-content p{margin:0 0 .8em}.cw-markdown-content ul,.cw-markdown-content ol{margin:.5em 0 .9em;padding-left:1.5em}.cw-markdown-content blockquote{margin:.8em 0;padding-left:12px;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.cw-markdown-error{display:block;margin-top:6px;color:hsl(var(--destructive));font-size:12px}.cw-tag-editor{display:flex;flex-direction:column;gap:12px}.cw-tag-inputrow{display:flex;gap:8px}.cw-tag-inputrow .cw-input{flex:1}.cw-presets{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.cw-presets-label{font-size:11.5px;color:hsl(var(--muted-foreground));margin-right:2px}.cw-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12.5px;white-space:nowrap}.cw-chip-ghost{border:1px dashed hsl(var(--border));background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;transition:background .12s,color .12s,border-color .12s}.cw-chip-ghost:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-chip-sub{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-pills{display:flex;flex-wrap:wrap;gap:8px}.cw-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 6px 5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:13px}.cw-pill-x{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:none;border-radius:50%;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-pill-x:hover{background:hsl(var(--destructive) / .12);color:hsl(var(--destructive))}.cw-empty-line{margin:0;font-size:12.5px;color:hsl(var(--muted-foreground))}.cw-check-inline{display:flex;align-items:center;gap:8px;margin-top:2px;font-size:13px;color:hsl(var(--foreground));cursor:pointer;-webkit-user-select:none;user-select:none}.cw-check-inline input[type=checkbox]{width:16px;height:16px;margin:0;flex-shrink:0;accent-color:hsl(var(--primary));cursor:pointer}.cw-checklist{display:flex;flex-direction:column;gap:8px}.cw-tools-list-shell{min-width:0;container-type:inline-size}.cw-checklist-tools{--cw-checklist-row-height: 65px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(var(--cw-checklist-row-height),auto);max-height:var(--cw-checklist-max-height);padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-checklist-tools .cw-check{min-height:var(--cw-checklist-row-height)}.cw-checklist-tools .cw-check-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}@container (max-width: 575px){.cw-checklist-tools{grid-template-columns:minmax(0,1fr)}}.cw-check{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-check:hover{background:hsl(var(--foreground) / .05)}.cw-check.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-check-box{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background));color:hsl(var(--background));transition:background .12s,border-color .12s,color .12s}.cw-check.is-on .cw-check-box{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-check-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-check-title{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.cw-check-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-segmented{display:flex;flex-wrap:wrap;gap:8px}.cw-seg{flex:1 1 160px;display:flex;flex-direction:column;gap:2px;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-seg:hover{background:hsl(var(--foreground) / .05)}.cw-seg.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-seg-title{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-seg-desc{font-size:11.5px;line-height:1.45;color:hsl(var(--muted-foreground))}.cw-ctool{display:flex;flex-direction:column;gap:12px}.cw-ctool-inputs{display:flex;flex-wrap:wrap;gap:8px}.cw-ctool-inputs .cw-input{flex:1 1 180px}.cw-ctool-list{display:flex;flex-direction:column;gap:8px}.cw-ctool-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--card))}.cw-ctool-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}.cw-ctool-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ctool-name{font-size:13.5px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--foreground));word-break:break-word}.cw-ctool-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp,.cw-mcp-list{display:flex;flex-direction:column;gap:12px}.cw-mcp-row{display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.cw-mcp-rowhead{display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-mcp-transport{display:inline-flex;gap:6px}.cw-seg-sm{flex:0 0 auto;min-width:72px;flex-direction:row;align-items:center;justify-content:center;text-align:center;padding:6px 16px;border-radius:9px}.cw-seg-sm .cw-seg-title{font-size:12.5px}.cw-mcp-note{margin:0;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp .cw-add-sub{margin-top:0}.cw-subfield{margin:-2px 0 2px;padding:14px 16px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .02)}.cw-toggle-stack{gap:14px}.cw-toggle{display:flex;align-items:center;gap:14px;width:100%;padding:16px 18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));text-align:left;cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s,background .15s}.cw-toggle:hover{border-color:hsl(var(--ring) / .25)}.cw-toggle.is-on{border-color:hsl(var(--primary) / .4);box-shadow:0 1px 2px hsl(var(--foreground) / .04)}.cw-toggle-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));transition:background .15s,color .15s}.cw-toggle.is-on .cw-toggle-icon{background:hsl(var(--primary) / .1);color:hsl(var(--primary))}.cw-toggle-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-toggle-title{font-size:14px;font-weight:600}.cw-toggle-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-switch{flex-shrink:0;display:flex;align-items:center;width:42px;height:24px;padding:2px;border-radius:999px;background:hsl(var(--border));transition:background .18s}.cw-toggle.is-on .cw-switch{background:hsl(var(--primary));justify-content:flex-end}.cw-switch-knob{display:block;width:20px;height:20px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .2)}.cw-sub-list{display:flex;flex-direction:column;gap:14px}.cw-sub{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .03)}.cw-sub-head{display:flex;align-items:center;justify-content:space-between}.cw-sub-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.cw-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-icon-btn:not(:disabled):hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-icon-btn:disabled{opacity:.35;cursor:not-allowed}.cw-icon-danger:not(:disabled):hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.cw-sub-head-actions{display:inline-flex;align-items:center;gap:2px}.cw-sub-list-wrap{display:flex;flex-direction:column}.cw-typeradio{display:flex}.cw-typeradio--row{position:relative;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:var(--cw-agent-type-gap);height:44px;width:100%;max-width:100%;padding:4px;overflow:visible;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-typeradio-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-agent-type-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-type-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-typeradio-item{position:relative;z-index:1;flex:1 1 0;min-width:0;min-height:34px;display:flex;align-items:center;justify-content:center;padding:7px 10px;border:none;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .16s,background .16s}.cw-typeradio-item:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-typeradio-item.is-disabled{color:hsl(var(--muted-foreground) / .45);cursor:not-allowed}.cw-typeradio-item.is-disabled:hover{background:transparent;color:hsl(var(--muted-foreground) / .45)}.cw-typeradio-disabled-hint{position:absolute;top:calc(100% + 17px);right:0;width:max-content;max-width:220px;padding:7px 10px;border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--popover));box-shadow:0 8px 24px hsl(var(--foreground) / .1);color:hsl(var(--popover-foreground));font-size:12px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-2px);transition:opacity .14s ease,transform .14s ease}.cw-typeradio-item.is-disabled:hover .cw-typeradio-disabled-hint,.cw-typeradio-item.is-disabled:focus .cw-typeradio-disabled-hint,.cw-typeradio-item.is-disabled:focus-visible .cw-typeradio-disabled-hint{opacity:1;transform:translateY(0)}.cw-typeradio-item.is-on{background:transparent;color:hsl(var(--foreground))}.cw-typeradio-item:has(.cw-typeradio-input:focus-visible){box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-typeradio-input{position:absolute;opacity:0;width:0;height:0}.cw-typeradio-title{min-width:0;white-space:normal;word-break:keep-all;font-size:clamp(11px,1.1vw,13px);font-weight:600;line-height:1.12;text-align:center}.cw-add-sub{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:14px;padding:12px;width:100%;border:1px dashed hsl(var(--border));border-radius:12px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13.5px;font-weight:500;cursor:pointer;transition:background .12s,color .12s,border-color .12s}.cw-add-sub:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-banner{display:flex;align-items:center;gap:8px;padding:11px 14px;border-radius:var(--radius);background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-review{display:flex;flex-direction:column;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;background:hsl(var(--card))}.cw-review-row{display:flex;gap:18px;padding:13px 16px;border-bottom:1px solid hsl(var(--border))}.cw-review-row:last-child{border-bottom:none}.cw-review-key{flex-shrink:0;width:110px;font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.cw-review-val{flex:1;min-width:0;font-size:13.5px}.cw-review-strong{font-weight:600}.cw-review-muted{color:hsl(var(--muted-foreground))}.cw-review-pre{margin:0;padding:10px 12px;background:hsl(var(--muted));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:200px;overflow-y:auto}.cw-review-chips,.cw-review-subs{display:flex;flex-wrap:wrap;gap:6px}.cw-tag{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:500}.cw-tag-on{background:#22c35d24;color:#1c7d3f}.cw-tag-off{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.cw-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:13.5px;font-weight:550;cursor:pointer;transition:background .13s,opacity .13s,border-color .13s,transform .1s}.cw-btn:active{transform:scale(.98)}.cw-btn-primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-btn-primary:hover:not(:disabled){opacity:.88}.cw-btn-primary:disabled{opacity:.4;cursor:default}.cw-btn-ghost{background:hsl(var(--background));border-color:hsl(var(--border));color:hsl(var(--foreground))}.cw-btn-ghost:hover{background:hsl(var(--accent))}.cw-btn-soft{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));flex-shrink:0}.cw-btn-soft:hover:not(:disabled){background:hsl(var(--accent))}.cw-btn-soft:disabled{opacity:.45;cursor:default}.cw-i{width:16px;height:16px;flex-shrink:0}.cw-i-sm{width:14px;height:14px}.cw-root-preview{height:100%}.cw-preview-body{flex:1;min-height:0;display:flex}.cw-preview-body>*{flex:1;min-height:0}.cw-skillhub{display:flex;flex-direction:column;gap:14px}.cw-skill-searchrow{display:flex;gap:8px}.cw-skill-searchbox{position:relative;flex:1;min-width:0;display:flex;align-items:center}.cw-skill-searchicon{position:absolute;left:11px;color:hsl(var(--muted-foreground));pointer-events:none}.cw-skill-input{padding-left:36px}.cw-skill-selected{display:flex;flex-direction:column;gap:8px}.cw-skill-selected-label{font-size:11.5px;font-weight:600;color:hsl(var(--muted-foreground))}.cw-skill-results{display:flex;flex-direction:column;gap:8px;max-height:472px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-skill-result{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s;min-height:72px;max-height:72px;overflow:hidden}.cw-skill-result:hover{background:hsl(var(--foreground) / .05)}.cw-skill-result.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-skill-result-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--muted-foreground));transition:background .12s,border-color .12s,color .12s}.cw-skill-result.is-on .cw-skill-result-icon{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-skill-result-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-skill-result-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground));word-break:break-word}.cw-skill-result-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-skill-result-repo{font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--muted-foreground));word-break:break-all}.cw-spin{animation:cw-spin .8s linear infinite}@keyframes cw-spin{to{transform:rotate(360deg)}}.cw-skillspane{display:flex;flex-direction:column;gap:10px}.cw-skill-add{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:600;transition:border-color .15s,background .15s,color .15s}.cw-skill-add:hover{border-color:hsl(var(--foreground) / .34);background:transparent;color:hsl(var(--foreground))}.cw-skill-add:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-skill-add-icon{flex-shrink:0;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}.cw-skill-dialog-backdrop{position:fixed;z-index:80;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:20px;background:#15181e47;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.cw-skill-dialog{width:min(680px,calc(100vw - 32px));height:min(640px,calc(100dvh - 40px));min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 72px #10131933}.cw-skill-dialog-head{flex-shrink:0;min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px 0 20px;border-bottom:1px solid hsl(var(--border))}.cw-skill-dialog-head h3{margin:0;font-size:16px;font-weight:650;letter-spacing:-.01em}.cw-skill-dialog-close{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-skill-dialog-close:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-skill-dialog-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px;padding:18px 20px 20px}.cw-skill-sourcetabs{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;height:44px;padding:4px;overflow:hidden;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-skill-tab-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-skill-tab-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-skill-tab-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-skill-pickertab{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:7px 10px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background .16s,color .16s}.cw-skill-pickertab:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-skill-pickertab.is-on{background:transparent;color:hsl(var(--foreground))}.cw-skill-pickertab:focus-visible{outline:none;box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-skill-tabbody{flex:1;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}.cw-selected-skill-list{display:flex;flex-direction:column;gap:7px;max-height:347px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-selected-skill-row{display:flex;align-items:center;gap:10px;min-width:0;min-height:52px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--card))}.cw-selected-skill-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-selected-skill-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-selected-skill-name{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-detail{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-remove{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-selected-skill-remove:hover{background:hsl(var(--destructive) / .09);color:hsl(var(--destructive))}.cw-advanced-section{overflow:hidden}.cw-advanced-disclosure{width:100%;display:flex;align-items:center;gap:10px;padding:0;border:0;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.cw-advanced-disclosure-title{font-size:17px;font-weight:650;letter-spacing:-.01em}.cw-advanced-disclosure-chevron{width:18px;height:18px;color:hsl(var(--muted-foreground));transition:transform .18s ease}.cw-advanced-disclosure-chevron.is-open{transform:rotate(90deg)}.cw-advanced-content{overflow:hidden}.cw-advanced-group{padding-top:20px}.cw-advanced-group+.cw-advanced-group{margin-top:22px}.cw-advanced-group-head{display:flex;align-items:center;margin-bottom:12px;color:hsl(var(--foreground));font-size:15px;font-weight:600}.cw-local-dropzone{display:flex;flex-direction:column;align-items:center;gap:9px;padding:18px 14px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .15s,color .15s}.cw-local-drop-icon{width:20px;height:20px;color:hsl(var(--muted-foreground))}.cw-local-dropzone.is-dragging{border-color:hsl(var(--foreground) / .48);color:hsl(var(--foreground))}.cw-local-drop-hint{margin:0;color:hsl(var(--muted-foreground));font-size:11.5px}.cw-local-dropzone.is-dragging .cw-local-drop-hint,.cw-local-dropzone.is-dragging .cw-local-drop-icon{color:hsl(var(--foreground))}.cw-local-hint{margin:0 0 8px;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-skillspace-header{display:flex;gap:8px;align-items:flex-start;margin-bottom:10px}.cw-skillspace-select{width:100%;flex:1;min-width:0}.cw-skillspace-console-link{flex-shrink:0;padding:9px 12px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-color:hsl(var(--primary))}.cw-skillspace-console-link .cw-i{display:block}.cw-skill-result-version{color:hsl(var(--muted-foreground));font-weight:400;font-size:11px;margin-left:4px}.cw-skill-result-repo .cw-i{vertical-align:-2px;margin-right:2px}@media (max-width: 1280px){.cw-debug{width:280px}.cw-tree{width:208px}}@media (max-width: 1080px){.cw-editor{flex-wrap:wrap;overflow-y:auto}.cw-tree{height:260px}.cw-detail{height:min(720px,calc(100dvh - 120px));min-height:560px}.cw-debug{flex:0 0 100%;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px;border-left:none;border-top:1px solid hsl(var(--border))}.cw-debug.is-collapsed{flex:0 0 48px;width:100%;min-width:0;height:48px;min-height:48px;align-items:flex-end;padding:7px 12px}.cw-debug.is-collapsed .cw-debug-expand{width:34px;min-height:34px}.cw-rail{display:none}.cw-lower{gap:0}.cw-detail .cw-form-col{max-width:100%}}@media (max-width: 860px){.cw-editor{flex-direction:column;flex-wrap:nowrap;overflow-x:hidden;overflow-y:auto}.cw-tree{width:100%;height:auto;max-height:220px;border-right:0;border-bottom:1px solid hsl(var(--border))}.cw-detail{flex:none;width:100%;height:min(720px,calc(100dvh - 120px));min-height:560px}.cw-typebar{padding-inline:12px}.cw-detail-scroll{padding:20px 12px 40px}.cw-debug{flex:none;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px}.cw-debug.is-collapsed{width:100%;height:48px;min-height:48px}.cw-center{gap:0;padding:24px 16px 64px}.cw-form-col{max-width:100%}}@media (max-width: 700px){.cw-typeradio-item{padding-inline:6px}.cw-typeradio-title{font-size:12.5px}}.tpl-root{flex:1;min-height:0;display:flex;flex-direction:column}.tpl-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 18px;padding:6px 10px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,color .12s}.tpl-back:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.tpl-back .icon{width:15px;height:15px}.tpl-scroll{flex:1;min-height:0;overflow-y:auto;padding:24px 28px 40px}.tpl-scroll--detail{padding-left:14px;padding-right:14px}.tpl-head{max-width:720px;margin:8px auto 28px;text-align:center}.tpl-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;max-width:1100px;margin:0 auto}.tpl-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;height:100%;padding:16px 16px 18px;text-align:left;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;transition:background .14s,border-color .14s}.tpl-card:hover{background:hsl(var(--foreground) / .05)}.tpl-card:active{background:hsl(var(--foreground) / .08)}.tpl-card-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;color:hsl(var(--muted-foreground))}.tpl-card-icon .icon{width:20px;height:20px}.tpl-card-name{font-size:14px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground))}.tpl-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.tpl-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.tpl-tags--detail{margin-top:0}.tpl-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border:1px solid hsl(var(--border));border-radius:999px;background:none;color:hsl(var(--muted-foreground));font-size:11.5px;white-space:nowrap}.tpl-tag-icon{width:12px;height:12px;flex-shrink:0}.tpl-detail{max-width:720px;margin:0 auto;display:flex;flex-direction:column;gap:20px}.tpl-detail-head{display:flex;align-items:flex-start;gap:14px}.tpl-detail-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;border:1px solid hsl(var(--border));border-radius:12px;background:none;color:hsl(var(--muted-foreground))}.tpl-detail-icon .icon{width:22px;height:22px}.tpl-detail-headtext{min-width:0}.tpl-detail-name{font-size:20px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-detail-desc{margin-top:4px;font-size:13.5px;line-height:1.6;color:hsl(var(--muted-foreground))}.tpl-field{display:flex;flex-direction:column;gap:8px}.tpl-field-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.tpl-input{width:100%;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .15s}.tpl-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.tpl-instruction{margin:0;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .03);color:hsl(var(--foreground));font-size:13px;line-height:1.7;white-space:pre-wrap}.tpl-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px}.tpl-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.tpl-meta-key{flex-shrink:0;color:hsl(var(--muted-foreground))}.tpl-meta-val{text-align:right;word-break:break-word;color:hsl(var(--foreground))}.tpl-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.tpl-subagents{display:flex;flex-direction:column;gap:10px}.tpl-subagent{padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background))}.tpl-subagent-top{display:flex;align-items:center;gap:8px}.tpl-subagent-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.tpl-subagent-tools{margin-left:auto;font-size:11px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.tpl-subagent-desc{margin-top:5px;font-size:12.5px;line-height:1.55;color:hsl(var(--muted-foreground))}.tpl-create{display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:flex-start;margin-top:4px;padding:11px 20px;border:none;border-radius:12px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.tpl-create:hover{opacity:.88}.tpl-create:active{transform:scale(.98)}.tpl-create .icon{width:17px;height:17px}@media (max-width: 560px){.tpl-meta-grid{grid-template-columns:1fr}.tpl-scroll{padding:20px 16px 32px}}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}.wfb{flex:1;min-height:0;display:flex;flex-direction:column;height:100%}.wfb-create{position:absolute;top:14px;right:14px;z-index:5;display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border:1px solid transparent;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:550;cursor:pointer;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .4);transition:opacity .15s,transform .1s}.wfb-create:hover:not(:disabled){opacity:.88}.wfb-create:active:not(:disabled){transform:scale(.97)}.wfb-create:disabled{opacity:.4;cursor:default}.wfb-grid{flex:1;min-height:0;display:grid;grid-template-columns:248px minmax(0,1fr) 288px}.wfb-section-label{margin:4px 0 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.wfb-field{display:flex;flex-direction:column;gap:5px}.wfb-field-label{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-input{width:100%;border:1px solid hsl(var(--border));border-radius:var(--radius);padding:8px 10px;font:inherit;font-size:13px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.wfb-input::placeholder{color:hsl(var(--muted-foreground) / .7)}.wfb-input:focus{outline:none;border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.wfb-input--error,.wfb-input--error:focus{border-color:hsl(var(--destructive));box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.wfb-field-error,.wfb-field-help{font-size:11px;line-height:1.4}.wfb-field-error{color:hsl(var(--destructive))}.wfb-field-help{color:hsl(var(--muted-foreground))}.wfb-textarea{resize:vertical;min-height:52px;line-height:1.5}.wfb-palette{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-right:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-types{display:flex;flex-direction:column;gap:6px}.wfb-type{display:flex;align-items:center;gap:10px;width:100%;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:border-color .12s,background .12s}.wfb-type:hover{border-color:hsl(var(--ring) / .3)}.wfb-type .icon{color:hsl(var(--muted-foreground))}.wfb-type--active{border-color:hsl(var(--ring) / .55);background:hsl(var(--accent))}.wfb-type--active .icon{color:#7c48f4}.wfb-type-text{display:flex;flex-direction:column;gap:1px;min-width:0}.wfb-type-name{font-size:13px;font-weight:550}.wfb-type-desc{font-size:11px;color:hsl(var(--muted-foreground))}.wfb-palette-item{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));cursor:grab;transition:border-color .12s,background .12s}.wfb-palette-item:hover{border-color:hsl(var(--ring) / .4);background:hsl(var(--accent))}.wfb-palette-item:active{cursor:grabbing}.wfb-grip{color:hsl(var(--muted-foreground) / .7)}.wfb-palette-item-text{font-size:13px;font-weight:500}.wfb-add{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;padding:9px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background .12s}.wfb-add:hover{background:hsl(var(--accent))}.wfb-hint{margin-top:auto;padding-top:10px;font-size:11.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.wfb-canvas{position:relative;min-width:0;height:100%;background:hsl(var(--canvas))}.wfb-canvas .react-flow{background:transparent}.wfb-node{display:flex;align-items:center;gap:10px;width:188px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .2);transition:border-color .12s,box-shadow .12s}.wfb-node--selected{border-color:hsl(var(--ring) / .6);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.wfb-node-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:9px;background:hsl(var(--secondary));color:#7c48f4}.wfb-node-icon--sm{width:24px;height:24px;border-radius:7px}.wfb-node-body{min-width:0;display:flex;flex-direction:column;gap:2px}.wfb-node-name{font-size:13px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-node-desc{font-size:11px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-handle{width:9px!important;height:9px!important;background:hsl(var(--background))!important;border:2px solid hsl(258 89% 62%)!important}.wfb-handle:hover{background:#7c48f4!important}.wfb-canvas .react-flow__controls{border-radius:10px;overflow:hidden;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .25);border:1px solid hsl(var(--border))}.wfb-canvas .react-flow__controls-button{background:hsl(var(--background));border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground))}.wfb-canvas .react-flow__controls-button:hover{background:hsl(var(--accent))}.wfb-canvas .react-flow__controls-button svg{fill:hsl(var(--foreground))}.wfb-canvas .react-flow__edge-path{stroke:hsl(var(--muted-foreground) / .55);stroke-width:1.5}.wfb-canvas .react-flow__edge.selected .react-flow__edge-path,.wfb-canvas .react-flow__edge:hover .react-flow__edge-path{stroke:#7c48f4}.wfb-canvas .react-flow__arrowhead *{fill:hsl(var(--muted-foreground) / .55)}.wfb-minimap{border:1px solid hsl(var(--border));border-radius:10px;overflow:hidden}.wfb-inspector{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-left:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-inspector-head{display:flex;align-items:center;justify-content:space-between}.wfb-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:7px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.wfb-icon-btn:hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.wfb-inspector-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;padding-top:12px;border-top:1px solid hsl(var(--border))}.wfb-meta-key{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-meta-val{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;padding:2px 7px;border-radius:6px;background:hsl(var(--muted));color:hsl(var(--foreground))}.wfb-inspector-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:hsl(var(--muted-foreground));font-size:13px}.wfb-empty-icon{width:32px;height:32px;opacity:.4;margin-bottom:4px}.wfb-inspector-empty p{margin:0}.wfb-empty-sub{font-size:12px;color:hsl(var(--muted-foreground) / .8)}@media (max-width: 900px){.wfb-grid{grid-template-columns:220px minmax(0,1fr)}.wfb-inspector{display:none}}.skill-workspace{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:34px clamp(18px,4vw,54px) 44px;background:hsl(var(--panel))}.skill-workspace__intro{width:min(1180px,100%);margin:0 auto 32px}.skill-workspace__intro h1{margin:0;font-size:22px;font-weight:620;letter-spacing:-.025em}.skill-workspace__poll-error{width:min(1180px,100%);margin:0 auto 14px;padding:9px 11px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px}.skill-workspace__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1;min-height:0;gap:clamp(36px,5vw,72px);width:min(1180px,100%);margin:0 auto}.skill-candidate{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;background:transparent}.skill-candidate:nth-child(2):before{position:absolute;top:0;bottom:0;left:calc(clamp(36px,5vw,72px)/-2);width:1px;background:hsl(var(--border));content:""}.skill-candidate__header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:0 0 12px;border-bottom:1px solid hsl(var(--border))}.skill-candidate__header h2{margin:0;font-family:inherit;font-size:13px;font-weight:500;line-height:1.4;letter-spacing:0}.skill-candidate__selected{padding:3px 7px;border-radius:999px;background:hsl(var(--primary) / .1);color:hsl(var(--primary));font-size:10px}.skill-candidate__view{min-height:0;overflow-y:auto;padding-right:8px;scrollbar-gutter:stable;animation:skill-view-in .18s ease-out}.skill-candidate__status{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:46px;padding:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.4;text-align:left}.skill-candidate--succeeded .skill-candidate__status{color:#2a844f}.skill-candidate--failed .skill-candidate__status{color:hsl(var(--destructive))}.skill-candidate__status-icon{display:inline-grid;place-items:center;width:18px;height:18px}.skill-candidate__status-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__spinner{animation:skill-spin .9s linear infinite}.skill-candidate__spinner circle{opacity:.2}.skill-candidate__duration{margin-left:auto;font-size:10px;color:hsl(var(--muted-foreground))}.skill-conversation{min-height:220px;margin:0 0 16px;padding:8px 0 18px}.skill-conversation .bubble{font-size:13px;line-height:1.65}.skill-conversation .think-head,.skill-conversation .tool-head,.skill-conversation .builtin-tool-head{display:grid;grid-template-columns:20px minmax(0,1fr) 13px;align-items:center;gap:8px;width:100%;min-height:38px;padding:4px 0;text-align:left}.skill-conversation .think-label,.skill-conversation .tool-name,.skill-conversation .builtin-tool-label{min-width:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere;text-align:left}.skill-conversation .think-icon,.skill-conversation .tool-icon,.skill-conversation .builtin-tool-icon{width:20px;height:26px}.skill-conversation .chev,.skill-conversation .tool-chevron,.skill-conversation .builtin-tool-chevron{justify-self:end}.skill-candidate__error{margin:0 0 14px;padding:9px 10px;border-radius:7px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:11px;line-height:1.5}.skill-candidate__view-actions{display:flex;justify-content:flex-start;padding:4px 0 20px}.skill-candidate__preview-nav{display:flex;align-items:center;min-height:46px}.skill-candidate__back{display:inline-flex;align-items:center;gap:6px;padding:5px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer}.skill-candidate__back:hover{color:hsl(var(--foreground))}.skill-candidate__back svg,.skill-action--preview svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__result{padding:0 0 20px}.skill-candidate__summary{display:grid;grid-template-columns:1fr .55fr .7fr;gap:8px;margin-bottom:13px}.skill-candidate__summary>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:9px 10px;border-radius:8px;background:hsl(var(--muted) / .55)}.skill-candidate__summary span{color:hsl(var(--muted-foreground));font-size:9px;text-transform:uppercase;letter-spacing:.05em}.skill-candidate__summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:560}.skill-candidate__summary .is-valid{color:#2a844f}.skill-candidate__summary .is-invalid{color:hsl(var(--destructive))}.skill-candidate__description{margin:0 0 13px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.skill-validation{margin-bottom:12px;font-size:11px;color:hsl(var(--muted-foreground))}.skill-validation summary{margin-bottom:6px;cursor:pointer;color:hsl(var(--foreground))}.skill-files{overflow:hidden;margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:9px}.skill-files__tabs{display:flex;gap:2px;overflow-x:auto;padding:5px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--muted) / .34)}.skill-files__tabs button{flex:0 0 auto;max-width:180px;overflow:hidden;text-overflow:ellipsis;padding:4px 7px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:10px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer}.skill-files__tabs button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 3px hsl(var(--foreground) / .08)}.skill-files__content{margin:0;overflow-x:auto;padding:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:10.5px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-word}.skill-files__truncated{margin:0;padding:8px 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:10px}.skill-files__unavailable{padding:20px 12px;color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.skill-candidate__actions{display:flex;flex-wrap:wrap;gap:7px}.skill-action{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px;text-decoration:none;cursor:pointer}.skill-action:hover:not(:disabled){background:hsl(var(--accent))}.skill-action:disabled{cursor:default;opacity:.42}.skill-action--select{border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-action--select[aria-pressed=true]{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.skill-action--preview{gap:7px;border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-publish-form{display:flex;flex-direction:column;gap:9px;margin-top:12px;padding:11px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--muted) / .28)}.skill-publish-form label{display:flex;flex-direction:column;gap:4px;color:hsl(var(--muted-foreground));font-size:10px}.skill-publish-form input{min-width:0;height:31px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px}.skill-publish-form input:focus{border-color:hsl(var(--primary) / .55)}.skill-publish-form__optional{display:grid;grid-template-columns:1fr 1fr;gap:8px}@keyframes skill-spin{to{transform:rotate(360deg)}}@keyframes skill-view-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 780px){.skill-workspace{overflow-y:auto;padding:24px 12px 32px}.skill-workspace__grid{flex:none;grid-template-columns:1fr;gap:32px}.skill-candidate{display:block}.skill-candidate__view{overflow:visible;padding-right:0}.skill-candidate:nth-child(2){padding-top:32px;border-top:1px solid hsl(var(--border))}.skill-candidate:nth-child(2):before{display:none}.skill-workspace__intro h1{font-size:20px}.skill-publish-form__optional{grid-template-columns:1fr}.skill-action{min-height:44px}}@media (prefers-reduced-motion: reduce){.skill-candidate__view,.skill-candidate__spinner{animation:none}}.sandbox-entry{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid hsl(268 58% 58% / .34);background:#f4eefb;color:#5b318c;font:inherit;font-weight:600;cursor:pointer;transition:background-color .14s ease-out,border-color .14s ease-out}.sandbox-entry svg{width:15px;height:15px;flex:0 0 auto}.sandbox-entry:hover:not(:disabled){border-color:#803ecc85;background:#ece2f9}.sandbox-entry:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-entry:disabled{cursor:default;opacity:.72}.sandbox-entry--composer{min-height:30px;padding:0 13px;border-radius:999px;font-size:12px}.sandbox-entry--header{min-height:32px;padding:0 10px;border-radius:7px;font-size:12px}.sandbox-entry.is-active{border-style:dashed}.sandbox-new-chat-entry{display:flex;justify-content:center;min-height:30px}.composer-slot{width:100%;min-width:0}.sandbox-composer-wrap{position:relative;z-index:2}.sandbox-session-warning{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;width:calc(100% - 32px);max-width:736px;min-height:24px;margin:0 auto 6px;color:#c7840f;font-size:12px}.sandbox-session-warning-dot{display:none}.sandbox-session-warning-copy{grid-column:2;white-space:nowrap;text-align:center}.sandbox-session-warning button{grid-column:3;justify-self:end;padding:3px 5px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-weight:580;cursor:pointer}.sandbox-session-warning button:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.sandbox-composer-wrap .composer-box{display:grid;grid-template-columns:1fr auto;grid-template-rows:minmax(44px,auto) 36px;align-items:center;gap:2px 8px;min-height:104px;padding:10px 8px 8px;border-radius:24px}.sandbox-composer-wrap .comp-input{grid-row:1;grid-column:1 / -1;align-self:stretch;width:100%;min-height:44px;padding:8px 10px 4px}.sandbox-composer-wrap .composer-menu-wrap{grid-row:2;grid-column:1;justify-self:start}.sandbox-composer-wrap .comp-send{grid-row:2;grid-column:2}.main.is-sandbox-session{position:relative;isolation:isolate;background:linear-gradient(to bottom,#f4edfd,#f8f3fc,#fbf8fc 48%,hsl(var(--panel)) 76%)}.main.is-sandbox-session:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;background:radial-gradient(ellipse 78% 40% at 18% 0%,hsl(244 82% 84% / .24),transparent 70%),radial-gradient(ellipse 70% 36% at 52% 0%,hsl(284 70% 86% / .2),transparent 72%),radial-gradient(ellipse 64% 38% at 88% 2%,hsl(324 66% 88% / .16),transparent 72%),linear-gradient(to bottom,hsl(var(--panel) / 0),hsl(var(--panel) / .18) 42%,hsl(var(--panel)) 76%);filter:blur(24px);opacity:1;animation:sandbox-smoke-enter .42s ease-out both}.main.is-sandbox-session>*{position:relative;z-index:1}.sandbox-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .24);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.sandbox-dialog{width:min(440px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 20px 56px hsl(var(--foreground) / .2);animation:sandbox-dialog-enter .18s ease-out both}.sandbox-dialog-visual{position:relative;display:grid;height:112px;place-items:center;overflow:hidden;border-bottom:1px solid hsl(var(--border));background:radial-gradient(circle at 35% 70%,hsl(256 68% 78% / .34),transparent 40%),radial-gradient(circle at 68% 30%,hsl(276 66% 72% / .28),transparent 42%),#f9f8fc}.sandbox-dialog-orbit{position:absolute;width:104px;height:44px;border:1px solid hsl(268 52% 54% / .22);border-radius:50%;transform:rotate(-12deg)}.sandbox-dialog-icon{display:grid;width:46px;height:46px;place-items:center;border:1px solid hsl(268 58% 58% / .3);border-radius:14px;background:hsl(var(--panel) / .9);color:#68389f;box-shadow:0 8px 24px #6c38a824}.sandbox-dialog-icon svg{width:23px;height:23px}.sandbox-spinner{width:21px;height:21px;border:2px solid hsl(268 48% 42% / .2);border-top-color:currentColor;border-radius:50%;animation:sandbox-spin .8s linear infinite}.sandbox-dialog-copy{padding:22px 24px 20px;text-align:center}.sandbox-dialog-copy h2{margin:0 0 8px;color:hsl(var(--foreground));font-size:17px;font-weight:650}.sandbox-dialog-copy p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.65}.sandbox-dialog-copy .sandbox-dialog-error{color:hsl(var(--destructive))}.sandbox-dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.sandbox-dialog-actions button{min-width:80px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.sandbox-dialog-actions button:hover{background:hsl(var(--secondary))}.sandbox-dialog-actions button:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-dialog-actions .is-primary{border-color:#68389f;background:#68389f;color:hsl(var(--primary-foreground))}.sandbox-dialog-actions .is-primary:hover{background:#5b318c}@keyframes sandbox-spin{to{transform:rotate(360deg)}}@keyframes sandbox-dialog-enter{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sandbox-smoke-enter{0%{opacity:0}to{opacity:1}}@media (max-width: 700px){.sandbox-entry--header span{display:none}.sandbox-entry--header{width:32px;padding:0}.sandbox-session-warning{grid-template-columns:1fr auto;width:calc(100% - 16px)}.sandbox-session-warning-copy{grid-column:1;white-space:normal;text-align:left}.sandbox-session-warning button{grid-column:2}}@media (prefers-reduced-motion: reduce){.sandbox-entry,.sandbox-dialog,.main.is-sandbox-session:before{animation:none;transition:none}}.PhotoView-Portal{direction:ltr;height:100%;left:0;overflow:hidden;position:fixed;top:0;touch-action:none;width:100%;z-index:2000}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes PhotoView__delayIn{0%,50%{opacity:0}to{opacity:1}}.PhotoView__Spinner{animation:PhotoView__delayIn .4s linear both}.PhotoView__Spinner svg{animation:PhotoView__rotate .6s linear infinite}.PhotoView__Photo{cursor:grab;max-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.PhotoView__Photo:active{cursor:grabbing}.PhotoView__icon{display:inline-block;left:0;position:absolute;top:0;transform:translate(-50%,-50%)}.PhotoView__PhotoBox,.PhotoView__PhotoWrap{bottom:0;direction:ltr;left:0;position:absolute;right:0;top:0;touch-action:none;width:100%}.PhotoView__PhotoWrap{overflow:hidden;z-index:10}.PhotoView__PhotoBox{transform-origin:left top}@keyframes PhotoView__fade{0%{opacity:0}to{opacity:1}}.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,.PhotoView-Slider__clean .PhotoView-Slider__Overlay,.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover{opacity:0}.PhotoView-Slider__Backdrop{background:#000;height:100%;left:0;position:absolute;top:0;transition-property:background-color;width:100%;z-index:-1}.PhotoView-Slider__fadeIn{animation:PhotoView__fade linear both;opacity:0}.PhotoView-Slider__fadeOut{animation:PhotoView__fade linear reverse both;opacity:0}.PhotoView-Slider__BannerWrap{align-items:center;background-color:#00000080;color:#fff;display:flex;height:44px;justify-content:space-between;left:0;position:absolute;top:0;transition:opacity .2s ease-out;width:100%;z-index:20}.PhotoView-Slider__BannerWrap:hover{opacity:1}.PhotoView-Slider__Counter{font-size:14px;opacity:.75;padding:0 10px}.PhotoView-Slider__BannerRight{align-items:center;display:flex;height:100%}.PhotoView-Slider__toolbarIcon{fill:#fff;box-sizing:border-box;cursor:pointer;opacity:.75;padding:10px;transition:opacity .2s linear}.PhotoView-Slider__toolbarIcon:hover{opacity:1}.PhotoView-Slider__ArrowLeft,.PhotoView-Slider__ArrowRight{align-items:center;bottom:0;cursor:pointer;display:flex;height:100px;justify-content:center;margin:auto;opacity:.75;position:absolute;top:0;transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;z-index:20}.PhotoView-Slider__ArrowLeft:hover,.PhotoView-Slider__ArrowRight:hover{opacity:1}.PhotoView-Slider__ArrowLeft svg,.PhotoView-Slider__ArrowRight svg{fill:#fff;background:#0000004d;box-sizing:content-box;height:24px;padding:10px;width:24px}.PhotoView-Slider__ArrowLeft{left:0}.PhotoView-Slider__ArrowRight{right:0}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--destructive: 0 72% 51%;--border: 240 5.9% 90%;--ring: 240 5.9% 10%;--radius: .5rem;--canvas: 240 5% 97.3%;--panel: 0 0% 100%;color-scheme:light;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0;overflow:hidden;overscroll-behavior:none}#root{position:fixed;top:0;right:0;bottom:0;left:0}body{background:hsl(var(--canvas));color:hsl(var(--foreground));-webkit-font-smoothing:antialiased}.icon{width:16px;height:16px;flex-shrink:0}.spin{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}*{scrollbar-width:thin;scrollbar-color:hsl(var(--foreground) / .18) transparent}*::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:hsl(var(--foreground) / .18);border-radius:999px;border:2px solid transparent;background-clip:content-box}*::-webkit-scrollbar-thumb:hover{background:hsl(var(--foreground) / .32);background-clip:content-box}*::-webkit-scrollbar-corner{background:transparent}.layout{display:flex;height:100vh;height:100dvh;min-height:0;overflow:hidden}.main-shell{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.sidebar{width:236px;height:100%;min-height:0;flex-shrink:0;display:flex;flex-direction:column;background:transparent;position:relative;transition:width .22s cubic-bezier(.22,1,.36,1)}.sidebar.is-collapsed{width:56px}@media (max-width: 860px){.sidebar{width:204px}}.sidebar-top{display:flex;flex-direction:column;gap:2px;padding:0 10px 8px}.sidebar-brand-row{height:54px;min-height:54px;display:flex;align-items:center;gap:6px;padding:0 0 0 10px}.brand{flex:1;min-width:0;display:flex;align-items:center;gap:9px;font-weight:600;font-size:15px;letter-spacing:-.01em}.brand-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand-logo,.brand-title,.login-brand-logo,.login-brand,.login-title{cursor:text}.sidebar-collapse-toggle{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.sidebar-collapse-toggle:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.sidebar-collapse-toggle .icon{width:17px;height:17px}.sidebar.is-collapsed .sidebar-brand-row{justify-content:center;padding-inline:0}.sidebar.is-collapsed .brand{display:none}.brand-logo,.login-brand-logo{display:block;width:20px;min-width:20px;max-width:20px;height:20px;min-height:20px;max-height:20px;flex:0 0 20px;object-fit:contain}.new-chat{display:flex;align-items:center;gap:10px;padding:10px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;cursor:pointer;transition:background .12s}.new-chat .icon{width:18px;height:18px}.new-chat:hover{background:hsl(var(--foreground) / .05)}.sidebar.is-collapsed .new-chat,.sidebar.is-collapsed .agent-row{align-self:center;width:36px;height:36px;min-height:36px;gap:0;padding:9px;overflow:hidden;white-space:nowrap}.sidebar.is-collapsed .agent-row-name,.sidebar.is-collapsed .agent-row-region,.sidebar.is-collapsed .agent-row-chev,.sidebar.is-collapsed .sidebar-nav-label,.sidebar.is-collapsed .sidebar-history{display:none}.agent-row{display:flex;align-items:center;gap:9px;margin:2px 0 6px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,border-color .12s}.agent-row:hover{background:hsl(var(--foreground) / .04);border-color:hsl(var(--foreground) / .2)}.agent-row--empty{border-color:#e2b3ac;background:#fcf6f5;color:#905047}.agent-row--empty .agent-row-lead{color:#bc6052}.agent-row--empty .agent-row-chev{color:#ac7e77}.agent-row--empty:hover{border-color:#d6998f;background:#faf1ef}.agent-row-lead{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0;transform:translateY(3px)}.agent-row--connected .agent-row-lead{color:#328f54}.agent-row-name{flex:1;min-width:0;text-align:left;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agent-row-region{flex-shrink:0;padding:1px 6px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10px;font-weight:550;line-height:1.5}.agent-row-chev{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .15s;flex-shrink:0;transform:translateY(1px)}.agent-row-chev.open{transform:translateY(1px) rotate(90deg)}.agentsel{--agentsel-available-width: calc(100vw - 250px) ;container-type:inline-size;position:absolute;left:100%;top:8px;z-index:32;display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;align-content:stretch;gap:8px;width:min(320px,var(--agentsel-available-width));background:transparent;border:0;margin-left:6px;overflow:visible;animation:agentsel-in .16s ease-out}.agentsel.has-detail{width:min(688px,var(--agentsel-available-width))}.sidebar.is-collapsed .agentsel{--agentsel-available-width: calc(100vw - 70px) }.agentsel-main{width:320px;height:100%;max-height:100%;min-width:min(240px,100%);flex:1 1 320px;display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 40px hsl(var(--foreground) / .14)}.agentsel-detail{width:360px;height:100%;max-height:100%;min-width:min(280px,100%);flex:1 1 360px;display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 40px hsl(var(--foreground) / .14)}.agentsel-preview{animation:agentsel-preview-in .16s cubic-bezier(.22,1,.36,1)}@container (max-width: 527px){.agentsel.has-detail>.agentsel-main,.agentsel.has-detail>.agentsel-detail{height:calc((100% - 8px)/2);max-height:calc((100% - 8px)/2)}}.agentsel-preview-head{padding:7px 14px}.agentsel-detail-tabs{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;height:36px;padding:3px;overflow:hidden;border:1px solid hsl(var(--border) / .58);border-radius:9px;background:hsl(var(--secondary) / .58)}.agentsel-detail-tabs-slider{position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc(50% - 3px);border:1px solid hsl(var(--border) / .72);border-radius:6px;background:hsl(var(--background));transform:translate(0);transition:transform .24s cubic-bezier(.22,1,.36,1)}.agentsel-detail-tabs.is-runtime .agentsel-detail-tabs-slider{transform:translate(100%)}.agentsel-detail-tabs button{position:relative;z-index:1;min-width:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;font-weight:550;text-align:center;cursor:pointer;transition:color .16s}.agentsel-detail-tabs button:hover,.agentsel-detail-tabs button[aria-selected=true]{color:hsl(var(--foreground))}.agentsel-detail-tabs button:focus-visible{outline:2px solid hsl(var(--ring) / .24);outline-offset:-2px}.agentsel-tab-panel{display:flex;flex:1;min-height:0;min-width:0;flex-direction:column}.agentsel-tab-panel[hidden]{display:none}.agentsel-detail-body{flex:1;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:12px 14px}.agentsel-panel-state{display:flex;align-items:center;justify-content:center;gap:7px;min-height:120px;color:hsl(var(--muted-foreground));font-size:12.5px}.agentsel-panel-state .icon{width:15px;height:15px}.agentsel-panel-empty{display:flex;flex-direction:column;gap:6px;padding:24px 8px;text-align:center;color:hsl(var(--muted-foreground));font-size:12.5px;overflow-wrap:anywhere}.agentsel-panel-empty small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground) / .75);font-size:11px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:3}.agentsel-identity,.agentsel-runtime-identity{display:flex;align-items:flex-start;gap:10px;min-width:0}.agentsel-identity{padding-bottom:12px}.agentsel-identity-icon,.agentsel-runtime-identity>.icon{width:18px;height:18px;margin-top:1px;flex-shrink:0;color:hsl(var(--muted-foreground))}.agentsel-identity-copy,.agentsel-runtime-identity>div{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}.agentsel-identity-copy strong,.agentsel-runtime-identity strong{overflow:hidden;color:hsl(var(--foreground));font-size:13.5px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.agentsel-identity-copy span,.agentsel-runtime-identity span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.agentsel-runtime-identity{margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid hsl(var(--border))}.agentsel-info-section{min-width:0;padding:11px 0;border-top:1px solid hsl(var(--border))}.agentsel-info-section h3{display:flex;align-items:center;gap:6px;margin:0 0 8px;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:600}.agentsel-info-section h3 .icon{width:13px;height:13px}.agentsel-description{max-height:104px;margin:0;overflow-y:auto;white-space:pre-wrap;overflow-wrap:anywhere;color:hsl(var(--foreground));font-size:12.5px;line-height:1.65}.agentsel-chips{display:flex;flex-wrap:wrap;gap:5px;min-width:0}.agentsel-chip{display:block;max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--canvas) / .7);color:hsl(var(--foreground));font-size:11.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.agentsel-info-list{display:flex;min-width:0;flex-direction:column;gap:6px}.agentsel-info-list-item{display:flex;min-width:0;flex-direction:column;gap:2px;padding:7px 8px;border-radius:6px;background:hsl(var(--canvas) / .72)}.agentsel-info-list-item>strong,.agentsel-component-head>strong{overflow:hidden;font-size:12px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.agentsel-info-list-item>span{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:3}.agentsel-component-head{display:flex;align-items:center;gap:8px;min-width:0}.agentsel-component-head>strong{flex:1;min-width:0}.agentsel-component-head>span{flex-shrink:0;padding:1px 5px;border-radius:4px;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));font-size:10px}.agentsel-kv{margin:0;display:flex;flex-direction:column;gap:8px}.agentsel-kv-row{display:grid;grid-template-columns:52px 1fr;gap:8px;font-size:12.5px}.agentsel-kv-row dt{color:hsl(var(--muted-foreground))}.agentsel-kv-row dd{min-width:0;margin:0;color:hsl(var(--foreground));overflow-wrap:anywhere}.agentsel-envs{margin-top:14px}.agentsel-envs-head{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));margin-bottom:6px}.agentsel-env{display:flex;flex-direction:column;gap:1px;margin-bottom:6px}.agentsel-env-k{overflow-wrap:anywhere;font-family:inherit;font-size:11px;color:hsl(var(--muted-foreground))}.agentsel-env-v{overflow-wrap:anywhere;font-family:inherit;font-size:11.5px;color:hsl(var(--foreground))}.agentsel-head-actions{display:flex;align-items:center;gap:2px}.agentsel-pager{display:flex;align-items:center;justify-content:center;gap:14px;flex:0 0 36px;padding:6px 10px 0}.agentsel-pager button{display:flex;border:none;background:none;padding:2px;cursor:pointer;color:hsl(var(--muted-foreground))}.agentsel-pager button:hover:not(:disabled){color:hsl(var(--foreground))}.agentsel-pager button:disabled{opacity:.3;cursor:default}.agentsel-pager button .icon{width:18px;height:18px}.agentsel-pager-label{font-size:13px;color:hsl(var(--muted-foreground));min-width:40px;text-align:center}@keyframes agentsel-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes agentsel-preview-in{0%{opacity:0;transform:translate(-6px)}to{opacity:1;transform:translate(0)}}.agentsel-head{display:flex;align-items:center;justify-content:space-between;height:52px;flex-shrink:0;box-sizing:border-box;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.agentsel-title{display:flex;min-width:0;align-items:center;gap:8px;overflow:hidden;font-weight:600;font-size:14px;text-overflow:ellipsis;white-space:nowrap}.agentsel-title .icon{width:17px;height:17px}.agentsel-refresh{display:flex;border:none;background:none;cursor:pointer;color:hsl(var(--muted-foreground));padding:4px;border-radius:6px}.agentsel-refresh:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.agentsel-refresh .icon{width:16px;height:16px}.agentsel-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:10px}.agentsel-body--cloud{display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}.agentsel-tools{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}.agentsel-search{display:flex;align-items:center;gap:8px;border:1px solid hsl(var(--border));border-radius:8px;padding:7px 10px}.agentsel-search .icon{width:15px;height:15px;color:hsl(var(--muted-foreground))}.agentsel-search input{flex:1;border:none;outline:none;background:none;font:inherit;font-size:13px;color:hsl(var(--foreground))}.agentsel-regions{display:grid;grid-template-columns:repeat(2,1fr);gap:2px;padding:2px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--canvas) / .55)}.agentsel-regions button{height:27px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;outline:none;cursor:pointer}.agentsel-regions button:hover{color:hsl(var(--foreground))}.agentsel-regions button:focus-visible{box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.agentsel-regions button.active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.agentsel-mine{display:flex;align-items:center;gap:7px;font-size:12.5px;color:hsl(var(--muted-foreground));cursor:pointer}.agentsel-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.agentsel-listwrap{position:relative;min-height:220px}.agentsel-body--cloud .agentsel-listwrap{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:auto}.agentsel-loading{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);border-radius:8px}.agentsel-loading .icon{width:16px;height:16px}.agentsel-item{width:100%;display:flex;align-items:center;gap:9px;min-height:46px;padding:4px 0;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13.5px;text-align:left}.agentsel-main button.agentsel-item{min-height:0;padding:9px 10px;cursor:pointer}.agentsel-item:hover{background:hsl(var(--foreground) / .05);box-shadow:none;transform:none}.agentsel-runtime-item:hover{background:none}.agentsel-item.active{background:hsl(var(--foreground) / .08);font-weight:600}.agentsel-item.is-previewed{background:hsl(var(--foreground) / .055)}.agentsel-runtime-item.active,.agentsel-runtime-item.is-previewed{background:none}.agentsel-item .icon{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-item-main{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}.agentsel-item-name{min-width:0;overflow:hidden;font-size:13px;font-weight:550;text-overflow:ellipsis;white-space:nowrap}.agentsel-item-meta{display:flex;align-items:center;gap:4px;min-width:0}.agentsel-item-actions{display:flex;align-items:center;gap:1px;flex-shrink:0}.agentsel-connect,.agentsel-info{border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.agentsel-connect{min-width:38px;height:28px;padding:0 5px;font-size:11.5px;font-weight:550}.agentsel-info{display:grid;width:28px;height:28px;padding:0;place-items:center}.agentsel-connect:hover:not(:disabled),.agentsel-info:hover{background:hsl(var(--foreground) / .07);color:hsl(var(--foreground));box-shadow:none}.agentsel-info.active{background:transparent;color:hsl(var(--foreground));box-shadow:none}.agentsel-connect:disabled{opacity:.55;cursor:default}.agentsel-info .icon{width:15px;height:15px}.agentsel-rt{display:flex;flex-direction:column}.agentsel-rt-row{width:100%;display:flex;align-items:center;gap:7px;padding:9px 8px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13.5px;cursor:pointer;text-align:left}.agentsel-rt-row:hover{background:hsl(var(--foreground) / .05)}.agentsel-rt-row .icon{width:15px;height:15px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-rt-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agentsel-badge{flex-shrink:0;font-size:10px;font-weight:600;padding:1px 6px;border-radius:999px;background:#007bff1f;color:#0b68cb}.agentsel-status{flex-shrink:0;font-size:10px;padding:1px 6px;border-radius:999px}.agentsel-status.is-ok{background:#21c45d24;color:#238b49}.agentsel-status.is-warn{background:#f59f0a29;color:#b86614}.agentsel-status.is-bad{background:#dc282824;color:#ca2b2b}.agentsel-status.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.agentsel-apps{display:flex;flex-direction:column;gap:2px;padding:2px 0 6px 20px}.agentsel-app{width:100%;display:flex;align-items:center;gap:8px;padding:7px 10px;border:none;border-radius:7px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;text-align:left}.agentsel-app:hover{background:hsl(var(--foreground) / .05)}.agentsel-app.active{background:hsl(var(--foreground) / .08);font-weight:600}.agentsel-app .icon{width:14px;height:14px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-apps-note{display:flex;align-items:center;gap:7px;padding:7px 10px;font-size:12.5px;color:hsl(var(--muted-foreground))}.agentsel-apps-note .icon{width:14px;height:14px}.agentsel-apps-note--muted{font-style:italic}.agentsel-empty{padding:24px 10px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.agentsel-error{min-width:0;max-width:100%;margin:4px 0 10px;padding:8px 10px;overflow:hidden;overflow-wrap:anywhere;border-radius:8px;background:#dc282814;color:#bd2828;font-size:12.5px;white-space:pre-wrap}.agentsel-more{width:100%;margin-top:8px;padding:9px;border:1px dashed hsl(var(--border));border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer}.agentsel-more:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}@media (max-width: 860px){.agentsel{--agentsel-available-width: calc(100vw - 218px) }}.sidebar-history{flex:1;min-height:0;display:flex;flex-direction:column}.history-head{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 6px 20px;font-size:12px;font-weight:500;color:hsl(var(--muted-foreground))}.history-refresh{background:none;border:none;cursor:pointer;padding:2px;color:hsl(var(--muted-foreground));display:flex}.history-refresh:hover{color:hsl(var(--foreground))}.history-new-chat{width:24px;height:24px;margin:-4px 0;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s}.history-new-chat .icon{width:15px;height:15px}.history-new-chat:hover{background:transparent;color:hsl(var(--foreground))}.history-list{flex:1;overflow-y:auto;padding:4px 10px 12px;display:flex;flex-direction:column;gap:2px}.history-empty{padding:16px 8px;font-size:13px;color:hsl(var(--muted-foreground));text-align:center}.history-item{position:relative;display:flex;align-items:center;border-radius:8px;transition:background .12s}.history-item:hover{background:hsl(var(--foreground) / .05)}.history-item.active{background:hsl(var(--foreground) / .08)}.history-item-btn{flex:1;min-width:0;display:flex;align-items:center;gap:7px;text-align:left;padding:9px 10px;border:none;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;cursor:pointer}.history-title{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-streaming{flex-shrink:0;width:7px;height:7px;margin-right:4px;border-radius:50%;background:#22c55e;box-shadow:0 0 #22c55e80;animation:history-pulse 1.4s ease-in-out infinite}@keyframes history-pulse{0%,to{box-shadow:0 0 #22c55e80}50%{box-shadow:0 0 0 4px #22c55e00}}.history-more{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:28px;height:28px;margin-right:4px;border:none;border-radius:6px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;opacity:0;transition:opacity .12s,background .12s}.history-item:hover .history-more{opacity:1}.history-more:hover{background:hsl(var(--border));color:hsl(var(--foreground))}.menu-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:30}.history-menu{position:absolute;top:100%;right:4px;z-index:31;min-width:120px;margin-top:2px;padding:4px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:8px;box-shadow:0 6px 20px hsl(var(--foreground) / .12)}.menu-item{display:flex;align-items:center;gap:8px;width:100%;padding:7px 10px;border:none;border-radius:6px;background:none;font:inherit;font-size:13px;cursor:pointer;color:hsl(var(--foreground))}.menu-item:hover{background:hsl(var(--accent))}.menu-item--danger{color:hsl(var(--destructive))}.menu-item .icon{width:15px;height:15px}.main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;margin:0 10px 10px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:12px;overflow:hidden}.error{margin:10px auto 0;max-width:768px;width:calc(100% - 32px);padding:10px 12px;border-radius:var(--radius);background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px}.transcript{flex:1;overflow-y:auto;padding:28px 16px 8px}.welcome{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 16px 6vh;gap:22px}.welcome-title{margin:0;font-size:26px;font-weight:600;letter-spacing:-.02em}.welcome .composer{padding:0}.turn{max-width:768px;margin:0 auto 22px;display:flex;flex-direction:column;gap:8px}.turn:last-child{margin-bottom:0}.turn--user{align-items:flex-end}.turn--assistant{align-items:flex-start}.bubble{line-height:1.65;font-size:14px}.turn--user .bubble{max-width:85%;padding:10px 16px;border-radius:18px;background:hsl(var(--secondary))}.turn--assistant .bubble{max-width:100%}.md{font-size:14px;line-height:1.65}.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}.md p{margin:0 0 .7em}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{margin:1.1em 0 .5em;font-weight:650;line-height:1.3;letter-spacing:-.01em}.md h1{font-size:1.4em}.md h2{font-size:1.25em}.md h3{font-size:1.1em}.md h4,.md h5,.md h6{font-size:1em}.md ul,.md ol{margin:0 0 .7em;padding-left:1.4em}.md li{margin:.15em 0}.md li>ul,.md li>ol{margin:.15em 0}.md a{color:hsl(var(--primary));text-decoration:underline;text-underline-offset:2px}.md a:hover{opacity:.8}.md blockquote{margin:0 0 .7em;padding:.1em .9em;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.md hr{border:none;border-top:1px solid hsl(var(--border));margin:1em 0}.md strong{font-weight:650}.md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.875em;background:hsl(var(--muted));padding:.12em .35em;border-radius:5px}.md pre{margin:0 0 .7em;padding:12px 14px;background:hsl(var(--muted));border-radius:8px;overflow-x:auto;line-height:1.55}.md pre code{background:none;padding:0;border-radius:0;font-size:12.5px}.md table{width:100%;margin:0 0 .7em;border-collapse:collapse;font-size:.95em;border-radius:12px;overflow:hidden;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border))}.md table thead th,.md table th{background:hsl(var(--muted));font-weight:650;border:1px solid hsl(var(--border));padding:12px 16px;text-align:left;font-size:.98em}.md table tbody td,.md table td{border:1px solid hsl(var(--border));padding:12px 16px;text-align:left;vertical-align:top;line-height:1.65}.md table tbody tr:nth-child(2n){background:hsl(var(--muted) / .25)}.md table tbody tr:hover{background:hsl(var(--accent))}.md table caption{caption-side:top;text-align:left;padding:0 0 8px;font-weight:600;color:hsl(var(--muted-foreground));font-size:.9em}.md table colgroup,.md table col{display:table-column}.md table thead,.md table tbody,.md table tfoot{display:table-row-group}.md table tr{display:table-row}.md strong,.md b{font-weight:650}.md em,.md i{font-style:italic}.md del,.md s{text-decoration:line-through}.md ins,.md u{text-decoration:underline}.md mark{background:#fff3c2b3;padding:.1em .3em;border-radius:4px}.md sub{vertical-align:sub;font-size:.8em}.md sup{vertical-align:super;font-size:.8em}.md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.md pre{overflow-x:auto}@media (max-width: 640px){.md table{font-size:.85em}.md table thead th,.md table th,.md table tbody td,.md table td{padding:8px 10px}}.md p{line-height:1.7}.md br{display:block;content:"";margin:.4em 0}.md hr{border:none;border-top:1px solid hsl(var(--border));margin:1.5em 0}.md blockquote{border-left:3px solid hsl(var(--primary) / .4);padding:.6em 1em;margin:.8em 0;background:hsl(var(--muted) / .3);border-radius:0 8px 8px 0}.md ul,.md ol{padding-left:1.6em;margin:.6em 0}.md li{margin:.3em 0;line-height:1.6}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{margin-top:1.2em;margin-bottom:.5em;line-height:1.3}.md h1{font-size:1.6em;font-weight:700}.md h2{font-size:1.4em;font-weight:650}.md h3{font-size:1.2em;font-weight:600}.md h4{font-size:1.1em;font-weight:600}.md h5,.md h6{font-size:1em;font-weight:600}.md .image-preview-trigger{position:relative;display:block;width:fit-content;max-width:40%;margin:0 0 .7em;padding:0;overflow:hidden;border:0;border-radius:10px;background:hsl(var(--muted));box-shadow:0 0 0 1px hsl(var(--border));cursor:zoom-in;line-height:0}.md .image-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .image-preview-trigger img{display:block;width:auto;max-width:100%;height:auto;border-radius:inherit;transition:filter .18s ease,transform .18s ease}.md .image-preview-trigger:hover img{filter:brightness(.92);transform:scale(1.01)}.image-preview-hint{position:absolute;right:8px;bottom:8px;display:grid;width:28px;height:28px;place-items:center;border:1px solid hsl(0 0% 100% / .2);border-radius:8px;background:#131316ad;color:#fff;opacity:0;transform:translateY(3px);transition:opacity .16s ease,transform .16s ease}.image-preview-hint svg{width:14px;height:14px}.image-preview-trigger:hover .image-preview-hint,.image-preview-trigger:focus-visible .image-preview-hint{opacity:1;transform:translateY(0)}.md .video-container{margin:0 0 .7em;display:grid;gap:6px}.md .video-caption{font-size:.9em;color:hsl(var(--muted-foreground))}.md .video-link-text{color:inherit;text-decoration:none;transition:color .15s ease}.md .video-link-text:hover{color:hsl(var(--foreground));text-decoration:underline}.md .video-preview-trigger{position:relative;display:block;width:fit-content;max-width:80%;padding:0;overflow:hidden;border:0;border-radius:12px;background:hsl(var(--muted));box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border));cursor:pointer;line-height:0;transition:box-shadow .18s ease,transform .18s ease}.md .video-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .video-preview-trigger:hover{box-shadow:0 4px 16px hsl(var(--foreground) / .15),0 0 0 1px hsl(var(--border));transform:translateY(-1px)}.md .video-preview-trigger .video-thumbnail{display:block;width:auto;max-width:100%;height:auto;border-radius:inherit;transition:filter .18s ease,transform .18s ease}.md .video-preview-trigger:hover .video-thumbnail{filter:brightness(.9);transform:scale(1.01)}.video-preview-hint{position:absolute;right:10px;bottom:10px;display:grid;width:32px;height:32px;place-items:center;border:1px solid hsl(0 0% 100% / .2);border-radius:10px;background:#131316b3;color:#fff;opacity:0;transform:translateY(4px);transition:opacity .16s ease,transform .16s ease;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.video-preview-hint svg{width:16px;height:16px}.video-preview-trigger:hover .video-preview-hint,.video-preview-trigger:focus-visible .video-preview-hint{opacity:1;transform:translateY(0)}.md .video-inline{max-width:100%;border-radius:12px;margin:0 0 .7em;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border))}.video-viewer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:grid;place-items:center;padding:28px;background:#131316c7;-webkit-backdrop-filter:blur(16px) saturate(.85);backdrop-filter:blur(16px) saturate(.85)}.video-viewer{display:flex;flex-direction:column;width:min(1080px,94vw);max-height:min(880px,90vh);overflow:hidden;border:1px solid hsl(var(--foreground) / .15);border-radius:18px;background:hsl(var(--background));box-shadow:0 32px 100px #07070885}.video-viewer-header{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:10px 16px;background:hsl(var(--muted) / .3);border-bottom:1px solid hsl(var(--border))}.video-viewer-title{font-weight:500;color:hsl(var(--foreground));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:70%}.video-viewer-nav{display:flex;gap:6px}.video-viewer-download,.video-viewer-close{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.video-viewer-download:hover,.video-viewer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.video-viewer-download svg,.video-viewer-close svg{width:17px;height:17px}.video-viewer-body{flex:1;min-height:0;display:grid;place-items:center;padding:20px;overflow:hidden;background:#161618}.video-viewer-body .video-fullscreen{max-width:100%;max-height:calc(90vh - 96px);border-radius:12px;background:#000;box-shadow:0 4px 20px #0006}@media (max-width: 640px){.md .video-preview-trigger{max-width:100%}.video-viewer-backdrop{padding:0}.video-viewer{width:100vw;max-height:100vh;border:none;border-radius:0}.video-viewer-body .video-fullscreen{max-height:calc(100vh - 96px);border-radius:0}}.turn--user .md code,.turn--user .md pre{background:hsl(var(--background) / .55)}.block-thinking,.block-tool{width:100%}.think-head,.tool-head{display:inline-flex;align-items:center;border:none;background:none;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.think-head{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.think-icon{width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center}.think-icon>svg{width:18px;height:18px}.spark{color:hsl(var(--muted-foreground))}.spark.pulse{animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{0%,to{opacity:.45;transform:scale(.92)}50%{opacity:1;transform:scale(1.08)}}.chev{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.chev.open{transform:rotate(90deg)}.think-label{font-size:13.5px;font-weight:400;line-height:1.35}.think-label--done{color:hsl(var(--muted-foreground))}.tool-head{color:hsl(var(--muted-foreground));transition:color .12s}.tool-head:hover{color:hsl(var(--foreground))}.tool-head--generic{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.tool-name{color:inherit;font-size:13.5px;font-weight:400;line-height:1.35}.tool-icon{width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center}.tool-icon>svg{width:18px;height:18px}.tool-icon--generic{color:hsl(var(--muted-foreground))}.tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.tool-chevron.is-open{transform:rotate(90deg)}.tool-detail{display:flex;flex-direction:column;gap:8px;margin:6px 0 4px;padding-left:3px}.tool-section-label{margin-bottom:4px;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:hsl(var(--muted-foreground))}.tool-result{max-height:240px;overflow:auto}.think-collapse{display:grid;grid-template-rows:0fr;transition:grid-template-rows .28s ease}.think-collapse.open{grid-template-rows:1fr}.think-collapse-inner{overflow:hidden}.think-body{margin:8px 0 4px;padding:10px 14px;border-left:2px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:13px;line-height:1.7;white-space:pre-wrap;max-height:220px;overflow-y:auto}.tool-args{margin:0;padding:8px 10px;background:hsl(var(--muted));border-radius:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5;overflow-x:auto;white-space:pre-wrap}.turn-meta{display:flex;align-items:center;gap:10px;margin-top:2px;font-size:12px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s}.turn-empty{margin-top:2px;font-size:13px;font-style:italic;color:hsl(var(--muted-foreground))}.auth-card{width:100%;max-width:640px;margin:2px 0;padding:18px 20px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.auth-card-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}.auth-card-icon{width:18px;height:18px;color:#f59f0a}.auth-card-icon--done{color:#1eae53}.auth-card-collapsed{display:inline-flex;align-items:center;gap:7px;margin:2px 0;padding:6px 12px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--card));font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.auth-card-code{padding:1px 6px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}.auth-card-title{font-size:14px;font-weight:600}.auth-card-desc{margin:0 0 14px;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.auth-card-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;border:none;border-radius:9px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:opacity .12s}.auth-card-btn:hover:not(:disabled){opacity:.88}.auth-card-btn:disabled{opacity:.55;cursor:default}.auth-card-btn .cw-i{width:15px;height:15px}.auth-card-done{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:#1eae53}.auth-card-done .cw-i{width:16px;height:16px}.auth-card-err{margin-top:8px;font-size:12px;color:hsl(var(--destructive))}.turn-actions{display:inline-flex;align-items:center;gap:2px}.turn-actions--right{align-self:flex-end;margin-top:2px;opacity:0;transition:opacity .15s}.turn--assistant:hover .turn-meta,.turn--user:hover .turn-actions--right{opacity:1}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:6px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.icon-btn:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.icon-btn:disabled{opacity:.35;cursor:default}.icon-btn:disabled:hover{background:none;color:hsl(var(--muted-foreground))}.icon-btn .icon{width:15px;height:15px}.meta-text{white-space:nowrap;font-size:12px;color:hsl(var(--muted-foreground))}.turn-actions--right{gap:6px}.drawer-scrim{position:fixed;top:0;right:0;bottom:0;left:0;background:hsl(var(--foreground) / .2);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fade .2s ease;z-index:40}@keyframes fade{0%{opacity:0}to{opacity:1}}.drawer{position:fixed;top:0;right:0;bottom:0;width:min(560px,92vw);background:hsl(var(--background));border-left:1px solid hsl(var(--border));box-shadow:-12px 0 40px hsl(var(--foreground) / .14);display:flex;flex-direction:column;z-index:41;animation:slidein .24s cubic-bezier(.22,1,.36,1)}@keyframes slidein{0%{transform:translate(100%)}to{transform:translate(0)}}.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas))}.drawer-title{font-weight:650;font-size:15px;letter-spacing:-.01em}.drawer-sub{font-size:12px;color:hsl(var(--muted-foreground));margin-top:3px;font-variant-numeric:tabular-nums}.drawer-close{display:flex;padding:6px;border:none;background:none;cursor:pointer;color:hsl(var(--muted-foreground));border-radius:6px}.drawer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.drawer-body{flex:1;overflow:auto;padding:16px 18px}.drawer-loading,.drawer-empty{display:flex;align-items:center;gap:8px;color:hsl(var(--muted-foreground));font-size:14px;padding:20px 0}.drawer--trace{width:min(1080px,96vw)}.trace-split{flex:1;min-height:0;display:flex}.trace-tree{flex:1.25;min-width:0;overflow:auto;padding:8px 6px;border-right:1px solid hsl(var(--border))}.trace-row{display:flex;align-items:center;gap:10px;width:100%;padding:5px 8px;border:none;background:none;border-radius:6px;cursor:pointer;font:inherit;text-align:left;transition:background .1s}.trace-row:hover{background:hsl(var(--foreground) / .04)}.trace-row.active{background:hsl(var(--primary) / .07);box-shadow:inset 2px 0 hsl(var(--primary) / .55)}.trace-label{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.trace-caret{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:hsl(var(--muted-foreground))}.trace-caret.hidden{visibility:hidden}.trace-caret .chev{width:13px;height:13px;transition:transform .18s}.trace-caret.open .chev{transform:rotate(90deg)}.trace-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.trace-name{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.trace-dur{flex-shrink:0;width:66px;text-align:right;font-size:11px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}.trace-track{position:relative;flex:0 0 34%;height:16px;border-radius:5px;background:hsl(var(--foreground) / .05)}.trace-bar{position:absolute;top:4px;height:8px;min-width:3px;border-radius:4px;opacity:.9}.trace-detail{flex:1;min-width:0;overflow:auto;padding:18px 20px}.td-title{font-size:15px;font-weight:600;letter-spacing:-.01em;word-break:break-all}.td-dur{display:flex;align-items:center;gap:7px;margin-top:4px;font-size:12px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}.td-dot{width:8px;height:8px;border-radius:50%}.td-section{margin:22px 0 9px;font-size:12px;font-weight:650;letter-spacing:.01em;color:hsl(var(--foreground))}.td-props{display:flex;flex-direction:column}.td-prop{display:flex;gap:16px;padding:7px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.td-key{flex-shrink:0;color:hsl(var(--muted-foreground));min-width:140px}.td-val{flex:1;min-width:0;text-align:right;word-break:break-word;font-variant-numeric:tabular-nums}.td-pre{margin:0;padding:11px 13px;background:hsl(var(--canvas));border:1px solid hsl(var(--border));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:320px;overflow:auto}.composer{max-width:768px;width:100%;margin:0 auto;padding:6px 16px 18px}.composer-box{position:relative;display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 8px;border:1px solid hsl(var(--border));border-radius:26px;background:hsl(var(--background))}.composer--new-chat .composer-box{display:block;min-height:136px;padding:10px;border-radius:16px}.composer-input-stack{display:flex;flex:1;min-width:0;flex-direction:column}.composer-input-stack .comp-input{width:100%}.composer--new-chat .composer-input-stack{min-height:114px}.composer--new-chat .comp-input{min-height:76px;padding:4px 10px}.composer--new-chat .composer-menu-wrap{position:absolute;bottom:10px;left:10px;height:36px}.composer--new-chat .new-chat-mode{position:absolute;right:52px;bottom:10px;display:flex;align-items:center;min-height:36px}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.composer-meta{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;padding:7px 12px 0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4}.composer-session-line{display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap}.composer-session-id{max-width:300px;overflow:hidden;text-overflow:ellipsis;font-family:inherit}.composer-session-copy{display:inline-grid;flex:0 0 18px;width:18px;height:18px;padding:0;place-items:center;border:0;border-radius:4px;background:transparent;color:inherit;cursor:pointer;opacity:.72;transition:background .12s ease,color .12s ease,opacity .12s ease}.composer-session-copy:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground));opacity:1}.composer-session-copy svg{width:11px;height:11px}.composer-meta-separator{opacity:.55}.comp-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 4px;max-height:200px;overflow-y:auto}.comp-input::placeholder{color:hsl(var(--muted-foreground))}.comp-icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.comp-icon:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.comp-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.comp-send:hover:not(:disabled){opacity:.85}.comp-send:active:not(:disabled){transform:scale(.94)}.comp-send:disabled{opacity:.3;cursor:default}.invocation-chips{display:flex;flex-wrap:wrap;gap:6px;min-width:0}.composer>.invocation-chips{padding:0 8px 8px}.turn--user>.invocation-chips{justify-content:flex-end;margin-bottom:6px}.invocation-chip{display:inline-flex;align-items:center;gap:5px;max-width:260px;min-height:28px;padding:4px 8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .025);font-size:12px;font-weight:560;line-height:1.2}.invocation-chip--skill{color:#267848}.invocation-chip--agent{color:#2762b0}.invocation-chip>svg{width:13px;height:13px;flex:0 0 auto}.invocation-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.invocation-chip button{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;margin:-1px -3px -1px 1px;padding:0;border:none;border-radius:5px;background:transparent;color:currentColor;cursor:pointer;opacity:.55}.invocation-chip button:hover{background:hsl(var(--accent));opacity:1}.invocation-chip button svg{width:11px;height:11px}.composer-command-menu{position:absolute;z-index:34;bottom:calc(100% + 10px);left:0;width:min(500px,calc(100vw - 48px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));box-shadow:0 2px 7px hsl(var(--foreground) / .08),0 22px 60px -24px hsl(var(--foreground) / .28);transform-origin:bottom left;animation:command-menu-in .13s ease-out}@keyframes command-menu-in{0%{opacity:0;transform:translateY(5px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}.composer-command-head{display:flex;align-items:center;gap:7px;height:38px;padding:0 10px 0 12px;border-bottom:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11px;font-weight:650;letter-spacing:.02em}.composer-command-head>svg{width:13px;height:13px}.composer-command-head>span{flex:1}.composer-command-menu kbd{min-width:22px;padding:2px 5px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--canvas));color:hsl(var(--muted-foreground));font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.composer-command-list{display:grid;max-height:min(330px,42vh);overflow-y:auto;padding:5px}.composer-command-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;width:100%;min-height:52px;padding:6px 8px;border:none;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.composer-command-item.is-active{background:hsl(var(--accent))}.composer-command-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:9px}.composer-command-icon--skill{background:#e7f8ee;color:#218349}.composer-command-icon--agent{background:#e9f1fc;color:#2664b5}.composer-command-icon svg{width:16px;height:16px}.composer-command-copy{display:grid;min-width:0;gap:3px}.composer-command-copy strong{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.composer-command-copy>span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.composer-command-empty{display:flex;align-items:center;justify-content:center;gap:7px;min-height:68px;padding:14px;color:hsl(var(--muted-foreground));font-size:12px}.composer-command-empty svg{width:14px;height:14px}.composer-menu-wrap{position:relative;flex-shrink:0}.composer-menu{position:absolute;bottom:100%;left:0;z-index:31;min-width:168px;margin-bottom:6px;padding:4px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 6px 20px hsl(var(--foreground) / .12)}.media-grid{display:flex;flex-wrap:wrap;gap:8px;max-width:min(620px,100%)}.turn--user .media-grid{justify-content:flex-end}.composer>.media-grid{padding:0 8px 9px;justify-content:flex-start}.media-card{position:relative;width:272px;min-width:0;overflow:visible;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .025);transition:border-color .16s,box-shadow .16s,transform .16s}.media-card:hover{border-color:hsl(var(--foreground) / .2);box-shadow:0 8px 28px -20px hsl(var(--foreground) / .28);transform:translateY(-1px)}.media-card--image{width:176px}.media-grid--compact .media-card{width:224px}.media-grid--compact .media-card--image{width:92px}.media-card-main{display:flex;align-items:center;gap:11px;width:100%;min-width:0;height:68px;padding:10px 12px;border:none;border-radius:inherit;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.media-card-main:disabled{cursor:default}.media-card--image .media-card-main{display:block;height:132px;padding:4px}.media-grid--compact .media-card-main{height:58px;padding:8px 10px}.media-grid--compact .media-card--image .media-card-main{height:72px;padding:3px}.media-card-image{width:100%;height:100%;object-fit:cover;border-radius:10px;display:block;background:hsl(var(--muted))}.media-card--image .media-card-copy,.media-card--image .media-card-open{display:none}.media-card-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:44px;flex:0 0 auto;border-radius:9px;color:hsl(var(--muted-foreground));background:hsl(var(--muted))}.media-card--pdf .media-card-icon{color:#db2a24;background:#fdeded}.media-card--video .media-card-icon{color:#226cd3;background:#edf3fd}.media-card--markdown .media-card-icon{color:#259353;background:#ebfaf1}.media-card-icon svg{width:21px;height:21px}.media-card-video-container{position:relative;display:grid;place-items:center;width:100%;height:100%;overflow:hidden;background:#131316}.media-card-video{width:100%;height:100%;object-fit:cover;opacity:.85}.media-card-video-play{position:absolute;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#0000008c;color:#fff;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transform:scale(1);transition:transform .18s ease,background .18s ease}.media-card-video-play svg{width:20px;height:20px;margin-left:3px}.media-card-main:hover .media-card-video-play{transform:scale(1.08);background:#000000b3}.media-card-copy{min-width:0;flex:1;display:grid;gap:5px}.media-card-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:1.2;font-weight:560}.media-card-meta{display:flex;align-items:center;gap:5px;min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.2}.media-card-type{font-size:9px;font-weight:700;letter-spacing:.06em}.media-card-open{width:14px;height:14px;flex:0 0 auto;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s}.media-card:hover .media-card-open{opacity:1}.media-card-spinner{width:12px;height:12px;animation:spin .85s linear infinite}.media-card--error{border-color:hsl(var(--destructive) / .42)}.media-card--error .media-card-meta{color:hsl(var(--destructive))}.media-card-remove{position:absolute;z-index:2;top:-7px;right:-7px;display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;padding:0;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));box-shadow:0 2px 8px hsl(var(--foreground) / .12);cursor:pointer}.media-card-remove:hover{color:hsl(var(--foreground))}.media-card-remove svg{width:12px;height:12px}.media-viewer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:grid;place-items:center;padding:28px;background:#131316b8;-webkit-backdrop-filter:blur(12px) saturate(.8);backdrop-filter:blur(12px) saturate(.8)}.media-viewer{display:flex;flex-direction:column;width:min(1080px,94vw);height:min(820px,90vh);overflow:hidden;border:1px solid hsl(var(--foreground) / .13);border-radius:18px;background:hsl(var(--background));box-shadow:0 32px 100px #07070875}.media-viewer-header{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:58px;padding:9px 12px 9px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background) / .94)}.media-viewer-header>div{min-width:0;display:grid;gap:2px}.media-viewer-header strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:620}.media-viewer-header span{color:hsl(var(--muted-foreground));font-size:11px}.media-viewer-header nav{display:flex;gap:4px}.media-viewer-header a,.media-viewer-header button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.media-viewer-header a:hover,.media-viewer-header button:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.media-viewer-header svg{width:17px;height:17px}.media-viewer-body{flex:1;min-height:0;overflow:auto;background:hsl(var(--canvas))}.media-viewer-body--image,.media-viewer-body--video{display:grid;place-items:center;padding:24px;background:#161618}.media-viewer-body--image img,.media-viewer-body--video video{max-width:100%;max-height:100%;object-fit:contain;border-radius:8px}.media-viewer-video-wrapper{width:100%;display:grid;place-items:center}.media-viewer-video{max-width:100%;max-height:calc(90vh - 140px);border-radius:12px;background:#000;box-shadow:0 4px 20px #0006}.media-viewer-body--pdf iframe{display:block;width:100%;height:100%;border:none;background:#fff}.media-document{width:min(820px,calc(100% - 48px));margin:24px auto;padding:34px 40px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 38px -30px hsl(var(--foreground) / .3)}.media-document--plain{min-height:calc(100% - 48px);white-space:pre-wrap;word-break:break-word;font:13px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace}.media-viewer-loading{display:flex;align-items:center;justify-content:center;gap:8px;height:100%;color:hsl(var(--muted-foreground));font-size:13px}.media-viewer-loading svg{width:17px;height:17px;animation:spin .85s linear infinite}@media (max-width: 640px){.composer-command-menu{right:0;width:auto}.media-card{width:min(272px,82vw)}.media-viewer-backdrop{padding:0}.media-viewer{width:100vw;height:100vh;border:none;border-radius:0}.media-document{width:calc(100% - 24px);margin:12px auto;padding:22px 18px}.md .image-preview-trigger{max-width:100%}}.a2ui-surface{max-width:360px;width:100%;font-size:14px}.a2ui-card{background:hsl(var(--card));border:1px solid hsl(var(--border));border-radius:8px;padding:18px;box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .18)}.a2ui-column,.a2ui-row{gap:10px}.a2ui-text{margin:0;line-height:1.5;color:hsl(var(--foreground))}.a2ui-text--h1{font-size:19px;font-weight:650;letter-spacing:0}.a2ui-text--h2{font-size:16px;font-weight:650;letter-spacing:0}.a2ui-text--h3{font-size:14px;font-weight:600}.a2ui-text--h4{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));text-transform:uppercase;letter-spacing:0}.a2ui-text--caption{font-size:12px;color:hsl(var(--muted-foreground))}.a2ui-text--body{font-size:14px}.a2ui-icon{display:inline-flex;align-items:center;justify-content:center;font-size:15px;line-height:1;color:hsl(var(--muted-foreground))}.a2ui-divider--h{height:1px;background:hsl(var(--border));margin:4px 0;width:100%}.a2ui-divider--v{width:1px;background:hsl(var(--border));align-self:stretch}.a2ui-button{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));border:1px solid transparent;border-radius:10px;padding:8px 14px;cursor:pointer;font:inherit;font-size:13px;font-weight:500;transition:background .15s,opacity .15s}.a2ui-button:hover{background:hsl(var(--accent))}.a2ui-button--primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.a2ui-button--primary:hover{background:hsl(var(--primary));opacity:.88}.a2ui-button--borderless{background:transparent;color:hsl(var(--foreground))}.a2ui-button--borderless:hover{background:hsl(var(--accent))}.a2ui-surface[data-a2ui-surface^=flight-]{max-width:520px}.a2ui-surface[data-a2ui-surface^=flight-] .a2ui-card{padding:0;overflow:hidden;background:linear-gradient(180deg,#f6fbfe,hsl(var(--card)) 42%),hsl(var(--card));border-color:#d7e0ea;box-shadow:0 1px 2px hsl(var(--foreground) / .05),0 18px 48px -28px #283d5359}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-content]{gap:16px;padding:18px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-top]{gap:12px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-brand]{min-width:0}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-brand-icon]{width:28px;height:28px;border-radius:999px;background:#006fe61a;color:#004fa3}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-title]{font-size:13px;color:#41454e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip]{flex-shrink:0;gap:6px;padding:5px 9px;border-radius:999px;background:#e3f8ed;border:1px solid hsl(151 48% 82%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip] .a2ui-icon,.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-text]{color:#126e41}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-hero]{position:relative;gap:16px;padding:18px;border-radius:8px;background:hsl(var(--background) / .88);border:1px solid hsl(210 32% 90%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination]{flex:1 1 0;min-width:0;gap:2px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{font-size:34px;line-height:1;font-weight:760;color:#191d24}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-label],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-label]{font-size:11px;font-weight:700;color:#717784}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-city],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-city]{font-size:13px;color:#545964}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{flex:0 0 auto;gap:3px;padding:0 4px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-icon]{width:34px;height:34px;border-radius:999px;background:#006fe61f;color:#0054ad}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-duration],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-aircraft]{font-size:11px;white-space:nowrap}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-times],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-details]{gap:10px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-time],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-time],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding]{flex:1 1 0;min-width:0;gap:2px;padding:11px 12px;border-radius:8px;background:#f3f4f6;border:1px solid hsl(220 13% 91%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-value]{font-size:14px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-airport],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-airport]{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding-value]{font-size:20px;line-height:1.15}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-footer]{gap:10px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-divider]{margin:0;background:#d9e0e8}@media (max-width: 520px){.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-content]{padding:14px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-hero],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-times],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-details]{flex-wrap:wrap}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{order:3;width:100%}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding]{min-width:120px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{font-size:34px}}.a2ui-fallback{background:hsl(var(--muted));border:1px solid hsl(var(--border));border-radius:10px;padding:8px 10px;font-size:12px;color:hsl(var(--muted-foreground))}.a2ui-fallback pre{overflow-x:auto;margin:6px 0 0}.boot{height:100vh;background:hsl(var(--background))}.boot-error{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:hsl(var(--foreground));font-size:14px}.boot-error p{margin:0}.boot-error button,.login-provider-error button{padding:7px 18px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--card));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer}.boot-error button:hover,.login-provider-error button:hover{background:hsl(var(--accent))}.navbar{flex:0 0 54px;min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 10px;background:transparent}.navbar-left,.navbar-right,.navbar-default,.navbar-portal-slot,.navbar-portal-actions{display:flex;align-items:center}.navbar-left{flex:1;min-width:0}.navbar-default{min-width:0}.navbar-right{flex:0 0 auto;min-width:0;gap:10px}.navbar-portal-slot,.navbar-portal-actions{min-width:0}.navbar-portal-slot:empty,.navbar-portal-actions:empty{display:none}.navbar-left:has(.navbar-portal-slot:not(:empty))>.navbar-default{display:none}.global-deploy-center{position:relative;z-index:38}.global-deploy-task{max-width:300px;min-height:32px;display:flex;align-items:center;gap:7px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background) / .82);color:hsl(var(--muted-foreground));font:inherit;font-size:12px;outline:none;white-space:nowrap;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}.global-deploy-task:hover{background:hsl(var(--background))}.global-deploy-task:focus-visible{border-color:hsl(var(--ring) / .32);box-shadow:0 0 0 2px hsl(var(--ring) / .07)}.global-deploy-task.is-idle{color:hsl(var(--muted-foreground))}.global-deploy-task.is-running{border-color:#0c77e93d;color:#1863b4}.global-deploy-task.is-success{border-color:#279b5138;color:#277c46}.global-deploy-task.is-error{border-color:hsl(var(--destructive) / .24);color:hsl(var(--destructive))}.global-deploy-task.is-cancelled{color:hsl(var(--muted-foreground))}.global-deploy-task-icon{width:14px;height:14px;flex:0 0 auto}.global-deploy-task-detail{overflow:hidden;text-overflow:ellipsis}.global-deploy-task-chevron{width:13px;height:13px;flex:0 0 auto;transition:transform .14s ease}.global-deploy-task-chevron.is-open{transform:rotate(180deg)}.global-deploy-task-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;padding:0;border:0;background:transparent}.global-deploy-popover{position:absolute;top:40px;right:0;z-index:2;width:390px;max-width:calc(100vw - 32px);overflow:hidden;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--background));box-shadow:0 14px 36px hsl(var(--foreground) / .14)}.global-deploy-popover-head{height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground));font-size:13px;font-weight:650}.global-deploy-popover-head span:last-child{min-width:20px;padding:1px 6px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.global-deploy-list{max-height:min(520px,calc(100vh - 82px));overflow-y:auto;padding:8px}.global-deploy-empty{padding:34px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.global-deploy-item{padding:12px;border:1px solid hsl(var(--border) / .8);border-radius:8px;background:hsl(var(--canvas) / .42)}.global-deploy-item+.global-deploy-item{margin-top:7px}.global-deploy-item-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.global-deploy-runtime-name{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.global-deploy-status{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:11.5px}.global-deploy-item.is-running .global-deploy-status{color:#1863b4}.global-deploy-item.is-success .global-deploy-status{color:#277c46}.global-deploy-item.is-error .global-deploy-status{color:hsl(var(--destructive))}.global-deploy-item.is-cancelled .global-deploy-status{color:hsl(var(--muted-foreground))}.global-deploy-meta{display:grid;grid-template-columns:1fr 1fr;gap:9px 14px;margin:11px 0 0}.global-deploy-meta>div{min-width:0}.global-deploy-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:10.5px}.global-deploy-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.global-deploy-message{margin:10px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.global-deploy-error{margin-top:10px;color:hsl(var(--muted-foreground));font-size:11.5px}.deploy-error-message-text{display:-webkit-box;margin:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-height:1.5;overflow-wrap:anywhere;white-space:pre-wrap}.deploy-error-message.is-expanded .deploy-error-message-text{display:block;max-height:280px;overflow:auto;-webkit-line-clamp:unset}.deploy-error-message-actions{display:flex;justify-content:flex-end;gap:2px;margin-top:6px}.deploy-error-message-actions button{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:inherit;cursor:pointer;opacity:.72}.deploy-error-message-actions button:hover{background:hsl(var(--foreground) / .07);opacity:1}.deploy-error-message-actions button:disabled{cursor:default;opacity:.5}.deploy-error-message-actions .deploy-error-retry{width:auto;gap:5px;margin-right:auto;padding:0 8px;font:inherit;font-size:11.5px;font-weight:600}.deploy-error-message-actions svg{width:14px;height:14px}.global-deploy-progress{height:3px;margin-top:10px;overflow:hidden;border-radius:999px;background:hsl(var(--foreground) / .08)}.global-deploy-progress span{display:block;height:100%;border-radius:inherit;background:#2581e4;transition:width .18s ease}.global-deploy-item-actions{display:flex;justify-content:flex-end;margin-top:9px}.global-deploy-item-actions button{min-height:27px;padding:0 9px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;cursor:pointer}.global-deploy-item-actions button:hover:not(:disabled){border-color:hsl(var(--destructive) / .3);background:hsl(var(--destructive) / .05);color:hsl(var(--destructive))}.global-deploy-item-actions button:disabled{opacity:.55;cursor:default}.navbar-title{padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.agent-dd{position:relative}.agent-dd-trigger{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:16px;font-weight:650;letter-spacing:-.01em;cursor:pointer;transition:background .12s}.agent-dd-trigger:hover{background:hsl(var(--foreground) / .05)}.agent-dd-current{max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-dd-chev{width:16px;height:16px;opacity:.6;transition:transform .2s ease}.agent-dd-chev.open{transform:rotate(180deg)}.agent-dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;min-width:240px;max-width:360px;max-height:min(560px,calc(100dvh - 84px));padding:6px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);display:flex;flex-direction:column;gap:2px;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;animation:ddpop .14s ease}@keyframes ddpop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.agent-dd-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;text-align:left;cursor:pointer;transition:background .12s}.agent-dd-row{position:relative}.agent-dd-item{width:100%}.agent-dd-item:hover{background:hsl(var(--foreground) / .05)}.agent-dd-item.active{background:hsl(var(--foreground) / .04)}.agent-dd-item-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-dd-item-dot{width:8px;height:8px;flex-shrink:0;border-radius:50%;background:#21c45d;box-shadow:0 0 0 3px #21c45d2e}.agent-dd-flyout{position:absolute;left:248px;z-index:32;width:280px;padding:12px 14px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);animation:ddpop .12s ease}.agent-dd-flyout:before{content:"";position:absolute;top:0;bottom:0;left:-12px;width:14px}.agent-dd-fly-loading{display:flex;align-items:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground))}.agent-dd-fly-name{font-size:14px;font-weight:650;letter-spacing:-.01em}.agent-dd-fly-desc{margin-top:3px;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.agent-dd-fly-field{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12.5px;color:hsl(var(--foreground))}.agent-dd-fly-field .icon{width:14px;height:14px;flex-shrink:0;color:hsl(var(--muted-foreground))}.agent-dd-fly-field--tools{align-items:flex-start}.agent-dd-fly-field--tools .icon{margin-top:3px}.agent-dd-fly-label{color:hsl(var(--muted-foreground))}.agent-dd-fly-model{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}.agent-dd-fly-chips{display:flex;flex-wrap:wrap;gap:5px}.agent-dd-chip{padding:2px 8px;border-radius:999px;background:hsl(var(--foreground) / .06);font-size:11.5px;white-space:nowrap}.account{position:relative}.account-avatar{width:32px;height:32px;flex-shrink:0;position:relative;isolation:isolate;overflow:hidden;border:none;border-radius:9px;background:radial-gradient(circle at var(--avatar-x, 32%) var(--avatar-y, 30%),hsl(var(--avatar-hue-a, 202) 100% 92%) 0 12%,hsl(var(--avatar-hue-a, 202) 95% 75% / .76) 34%,transparent 62%),radial-gradient(ellipse at 82% 78%,hsl(var(--avatar-hue-c, 185) 86% 49% / .88) 0 18%,transparent 58%),linear-gradient(142deg,hsl(var(--avatar-hue-b, 222) 94% 83%),hsl(var(--avatar-hue-b, 222) 95% 54%) 52%,hsl(var(--avatar-hue-c, 185) 74% 62%));background-size:180% 180%,160% 160%,100% 100%;background-position:20% 12%,80% 80%,center;color:#152747e0;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;cursor:pointer;text-shadow:0 1px 2px hsl(0 0% 100% / .62);box-shadow:none;animation:avatar-smoke-drift 9s ease-in-out infinite alternate;transition:filter .16s,transform .16s}.account-avatar:hover{filter:saturate(1.12) brightness(1.03);transform:scale(1.035)}.account-avatar.has-image{animation:none;text-shadow:none}.account-avatar-image{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;border-radius:inherit;object-fit:cover}@keyframes avatar-smoke-drift{0%{background-position:18% 12%,82% 84%,center}50%{background-position:58% 42%,54% 62%,center}to{background-position:82% 70%,26% 24%,center}}.account-avatar--lg{width:40px;height:40px;border-radius:11px;font-size:16px;cursor:default}.account-pop{position:absolute;top:calc(100% + 8px);right:0;z-index:31;min-width:220px;padding:12px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);animation:ddpop .12s ease}.account-head{display:flex;align-items:center;gap:10px}.account-id{min-width:0;flex:1}.account-name-row{display:flex;align-items:center;gap:6px;min-width:0}.account-name{min-width:0;flex:1;font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-sub{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-logout{display:flex;align-items:center;gap:8px;width:100%;margin-top:10px;padding:9px 10px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s}.account-logout:hover{background:hsl(var(--foreground) / .05)}.account-logout .icon{width:16px;height:16px;color:hsl(var(--muted-foreground))}.sidebar-user{position:relative;flex-shrink:0;margin-top:auto;padding:8px 10px 12px}.sidebar-user-btn{display:flex;align-items:center;gap:9px;width:100%;padding:7px 8px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;cursor:pointer;transition:background .12s}.sidebar-user-btn:hover{background:hsl(var(--foreground) / .05)}.sidebar-user-identity{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.sidebar-user-primary{min-width:0;display:flex;align-items:center;gap:6px}.sidebar-user-name{min-width:0;flex:1;text-align:left;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-user-email{min-width:0;text-align:left;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.studio-role-badge{flex-shrink:0;padding:2px 5px;border:1px solid transparent;border-radius:999px;font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap}.studio-role-badge--admin{color:#7027b4;background:#8f37e11c;border-color:#7d2cc93d}.studio-role-badge--developer{color:#976507;background:#fac70f2e;border-color:#ce9b0d4d}.studio-role-badge--user{color:#1b7e43;background:#25b15f1f;border-color:#2994543d}.sidebar.is-collapsed .sidebar-user-btn{width:36px;height:36px;justify-content:center;gap:0;padding:2px;overflow:hidden}.sidebar.is-collapsed .sidebar-user-identity{display:none}.sidebar.is-collapsed .sidebar-user-pop{left:8px;right:auto;width:220px}@media (prefers-reduced-motion: reduce){.sidebar{transition:none}}.sidebar-user-pop{position:absolute;bottom:calc(100% - 4px);top:auto;left:10px;right:10px}.skillcenter{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;padding:0}.skillcenter-regions{display:grid;padding:2px;border:1px solid hsl(var(--border));background:hsl(var(--canvas) / .62)}.skillcenter-regions button{border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.skillcenter-regions button.active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.skillcenter-regions button:focus-visible,.skillcenter-pager button:focus-visible,.skill-detail-close:focus-visible{outline:2px solid hsl(var(--ring) / .28);outline-offset:1px}.skillcenter-space-item:focus-visible,.skillcenter-skill-item:focus-visible{outline:none;border-color:transparent;background:hsl(var(--muted) / .62)}.skillcenter-regions{grid-template-columns:repeat(2,58px);border-radius:7px}.skillcenter-regions button{height:27px;border-radius:5px;font-size:11.5px}.skillcenter-browser{flex:1;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(270px,.9fr) minmax(360px,1.35fr);gap:0}.skillcenter-panel{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.skillcenter-panel+.skillcenter-panel{border-left:1px solid hsl(var(--border))}.skillcenter-panel-head{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.skillcenter-panel-head>div{min-width:0;display:flex;align-items:center;gap:8px}.skillcenter-panel-head .icon{width:17px;height:17px;color:hsl(var(--muted-foreground))}.skillcenter-panel-head h2{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:13.5px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.skillcenter-panel-head>span{flex-shrink:0;color:hsl(var(--muted-foreground));font-size:11.5px}.skillcenter-count-badge{min-width:25px;height:21px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:11px;font-weight:600;line-height:1}.skillcenter-listwrap{position:relative;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}.skillcenter-list{display:flex;flex-direction:column;gap:6px;padding:8px}.skillcenter-space-item,.skillcenter-skill-item{width:100%;min-width:0;display:flex;align-items:flex-start;gap:10px;padding:10px;border:1px solid transparent;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:background-color .12s ease,border-color .12s ease}.skillcenter-space-item:hover,.skillcenter-skill-item:hover,.skillcenter-space-item.active{border-color:transparent;background:hsl(var(--muted) / .62)}.skillcenter-symbol{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground) / .78)}.skillcenter-symbol .icon{width:18px;height:18px}.skillcenter-symbol--skill{color:#2764b4;background:#f2f7fd;border-color:#ccdbf0}.skillcenter-item-body{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}.skillcenter-item-title{min-width:0;overflow:hidden;font-size:13px;font-weight:600;line-height:18px;text-overflow:ellipsis;white-space:nowrap}.skillcenter-item-description{display:-webkit-box;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:17px;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skillcenter-item-meta{min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px;margin-top:2px}.skillcenter-status{flex-shrink:0;padding:2px 6px;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10.5px;line-height:16px}.skillcenter-status.is-positive{color:#1d7742;background:#e7f8ee}.skillcenter-status.is-progress{color:#8d5911;background:#fdf5e3}.skillcenter-status.is-danger{color:hsl(var(--destructive));background:hsl(var(--destructive) / .09)}.skillcenter-meta-text{min-width:0;max-width:170px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}.skillcenter-pager{height:44px;flex:0 0 44px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11.5px}.skillcenter-pager-actions{display:flex;align-items:center;gap:7px}.skillcenter-pager-actions>span{min-width:38px;text-align:center}.skillcenter-pager button,.skill-detail-close{display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.skillcenter-pager button{width:26px;height:26px;padding:0}.skillcenter-pager button:hover:not(:disabled),.skill-detail-close:hover{color:hsl(var(--foreground));background:hsl(var(--accent))}.skillcenter-pager button:disabled{opacity:.35;cursor:default}.skillcenter-pager button .icon{width:17px;height:17px}.skillcenter-empty,.skillcenter-loading,.skillcenter-error{min-height:130px;display:flex;align-items:center;justify-content:center;gap:8px;padding:24px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55;text-align:center;overflow-wrap:anywhere}.skillcenter-error{color:hsl(var(--destructive))}.skillcenter-loading--overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;min-height:0;background:hsl(var(--background) / .82);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.skillcenter-loading-mark{width:14px;height:14px;flex-shrink:0;border:1.5px solid hsl(var(--foreground) / .16);border-top-color:hsl(var(--foreground) / .62);border-radius:50%;animation:spin .8s linear infinite}.skill-detail-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;display:grid;place-items:center;padding:16px;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.skill-detail-dialog{width:min(760px,100%);height:min(760px,100%);min-height:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 18px 48px hsl(var(--foreground) / .16)}.skill-detail-head{flex-shrink:0;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 18px 14px;border-bottom:1px solid hsl(var(--border))}.skill-detail-heading{min-width:0;display:flex;align-items:flex-start;gap:11px}.skill-detail-heading>div{min-width:0}.skill-detail-heading h2{margin:1px 0 4px;overflow:hidden;font-size:16px;font-weight:650;line-height:22px;text-overflow:ellipsis;white-space:nowrap}.skill-detail-heading p{display:-webkit-box;margin:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:17px;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skill-detail-close{width:30px;height:30px;flex:0 0 30px;padding:0}.skill-detail-meta{flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 18px;margin:0;padding:14px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas) / .45)}.skill-detail-meta>div{min-width:0}.skill-detail-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:10.5px}.skill-detail-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;line-height:17px;text-overflow:ellipsis;white-space:nowrap}.skill-detail-content{flex:1;min-height:0;display:flex;flex-direction:column}.skill-detail-content-title{height:40px;flex:0 0 40px;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid hsl(var(--border));font-size:12px;font-weight:600}.skill-detail-content>.skillcenter-loading,.skill-detail-content>.skillcenter-error,.skill-detail-content>.skillcenter-empty{flex:1;min-height:0}.skill-detail-markdown{flex:1;min-height:0;overflow-y:auto;padding:18px 22px 28px;overflow-wrap:anywhere}@media (max-width: 760px){.skillcenter-browser{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr))}.skillcenter-panel+.skillcenter-panel{border-top:1px solid hsl(var(--border));border-left:0}.skill-detail-meta{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 560px){.skillcenter-regions{grid-template-columns:repeat(2,46px)}.skillcenter-browser{gap:8px}.skillcenter-item-meta{gap:4px 6px}.skillcenter-meta-text{max-width:132px}.skill-detail-backdrop{padding:8px}.skill-detail-dialog{border-radius:10px}.skill-detail-meta{grid-template-columns:minmax(0,1fr);gap:8px;max-height:180px;overflow-y:auto}}.addagent{flex:1;min-height:0;overflow-y:auto;display:flex;justify-content:center;align-items:flex-start;padding:8vh 16px 16px}.addagent-card{width:100%;max-width:480px}.addagent-title{margin:0 0 6px;font-size:20px;font-weight:650;letter-spacing:-.01em}.addagent-sub{margin:0 0 22px;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.addagent-field{display:block;margin-bottom:14px}.addagent-label{display:block;margin-bottom:6px;font-size:12.5px;font-weight:500;color:hsl(var(--muted-foreground))}.addagent-input{width:100%;border:1px solid hsl(var(--border));border-radius:10px;padding:10px 12px;font:inherit;font-size:14px;background:hsl(var(--background));color:hsl(var(--foreground))}.addagent-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.addagent-error{margin:4px 0 14px;padding:9px 12px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.addagent-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.addagent-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:14px;font-weight:500;cursor:pointer;transition:background .12s,opacity .12s}.addagent-btn--ghost{background:none;border-color:hsl(var(--border));color:hsl(var(--foreground))}.addagent-btn--ghost:hover{background:hsl(var(--foreground) / .05)}.addagent-btn--primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.addagent-btn--primary:hover:not(:disabled){opacity:.88}.addagent-btn:disabled{opacity:.4;cursor:default}.addagent-btn .icon{width:15px;height:15px}.search{flex:1;min-height:0;display:flex;flex-direction:column;width:100%;max-width:720px;margin:0 auto;padding:28px 16px 16px}.search-box{position:relative;display:flex;align-items:center;gap:0;padding:5px 6px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));transition:border-color .16s,box-shadow .16s}.search-box:focus-within{border-color:hsl(var(--foreground) / .3);box-shadow:0 0 0 3px hsl(var(--foreground) / .035)}.search-source-picker-wrap{position:relative;flex:0 0 auto}.search-source-picker{display:inline-flex;align-items:center;gap:5px;max-width:176px;height:34px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;cursor:pointer}.search-source-picker:hover,.search-source-picker[aria-expanded=true]{background:hsl(var(--foreground) / .045)}.search-source-picker>span{flex:0 0 auto;font-size:13px;font-weight:550}.search-source-picker>small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.search-source-chevron{width:12px;height:12px;flex:0 0 auto;color:hsl(var(--muted-foreground));transition:transform .15s ease}.search-source-chevron.open{transform:rotate(180deg)}.search-source-menu{position:absolute;z-index:30;top:calc(100% + 9px);left:-6px;display:flex;width:224px;padding:5px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .1);flex-direction:column}.search-source-menu>button{display:flex;min-width:0;padding:8px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;flex-direction:column;gap:2px}.search-source-menu>button:hover:not(:disabled),.search-source-menu>button[aria-selected=true]{background:hsl(var(--foreground) / .055)}.search-source-menu>button:disabled{color:hsl(var(--muted-foreground));cursor:default}.search-source-menu>button>span{font-size:12.5px;font-weight:550}.search-source-menu>button>small{overflow:hidden;max-width:100%;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.search-box-divider{width:1px;height:18px;margin:0 11px 0 5px;background:hsl(var(--border))}.search-input{flex:1;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px}.search-input::placeholder{color:hsl(var(--muted-foreground))}.search-input:disabled{cursor:default}.search-go{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.search-go:hover:not(:disabled){opacity:.85}.search-go:active:not(:disabled){transform:scale(.94)}.search-go:disabled{opacity:.3;cursor:default}.search-go .icon{width:17px;height:17px}.search-results{flex:1;min-height:0;overflow-y:auto;margin-top:12px;display:flex;flex-direction:column;gap:4px}.search-empty{padding:40px 8px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.search-result{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:12px 14px;border:none;border-radius:12px;background:none;color:hsl(var(--foreground));font:inherit;cursor:pointer;transition:background .12s}.search-result:hover{background:hsl(var(--foreground) / .05)}.search-result-static{cursor:default;border:1px solid transparent}.search-result-static:hover{border-color:hsl(var(--border));background:hsl(var(--foreground) / .025)}a.search-result{text-decoration:none;color:inherit}.search-result-ext{width:12px;height:12px;margin-left:4px;vertical-align:-1px;opacity:.6}.search-result-icon{width:16px;height:16px;flex-shrink:0;margin-top:2px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.search-result-body{min-width:0;flex:1}.search-result-head{display:flex;align-items:baseline;gap:10px;justify-content:space-between}.search-result-title{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-result-meta{flex-shrink:0;font-size:11.5px;color:hsl(var(--muted-foreground))}.search-result-snippet{margin-top:3px;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground));display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.search-result-snippet-expanded{-webkit-line-clamp:4;white-space:pre-wrap;overflow-wrap:anywhere}.login{position:fixed;top:10px;right:10px;bottom:10px;left:10px;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;display:flex;flex-direction:column;background:hsl(var(--panel));color:hsl(var(--foreground))}.login-top{padding:18px 24px}.login-brand{display:inline-flex;align-items:center;gap:9px;font-weight:600;font-size:15px;letter-spacing:-.01em}.login-main{flex:1;display:flex;align-items:center;justify-content:center;padding:0 24px}.login-card{width:100%;max-width:420px}.login-title{margin:0 0 14px;font-size:28px;font-weight:700;line-height:1.2;letter-spacing:-.02em}.login-sub{margin:0 0 28px;color:hsl(var(--muted-foreground));font-size:15px}.login-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:14px 18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer;transition:background .15s,border-color .15s,transform .1s}.login-btn:hover{background:hsl(var(--accent));border-color:hsl(var(--ring) / .3)}.login-btn:active{transform:scale(.99)}.login-btn .icon{width:18px;height:18px}.login-powered{margin:18px 0 0;font-size:12px;color:hsl(var(--muted-foreground))}.login-legal{margin:6px 0 0;font-size:12px;color:hsl(var(--muted-foreground))}.login-legal a{color:inherit;font-weight:600;text-decoration:underline;text-decoration-color:hsl(var(--muted-foreground) / .45);text-underline-offset:2px}.login-legal a:hover{color:hsl(var(--foreground))}.login-footer{padding:18px 24px;text-align:center;font-size:12px;color:hsl(var(--muted-foreground))}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}.login-providers{display:flex;flex-direction:column;gap:10px}.login-provider-error{display:flex;flex-direction:column;align-items:flex-start;gap:12px;color:hsl(var(--destructive));font-size:13px}.login-provider-error p{margin:0}.login-name{display:flex;align-items:center;gap:8px}.login-name-input{flex:1;border:1px solid hsl(var(--border));border-radius:14px;padding:13px 16px;font:inherit;font-size:15px;background:hsl(var(--background));color:hsl(var(--foreground))}.login-name-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.login-name-go{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s}.login-name-go .icon{width:18px;height:18px}.login-name-go:disabled{opacity:.35;cursor:default}.login-hint{margin:8px 0 0;min-height:16px;line-height:16px;font-size:12px;color:hsl(var(--destructive))}.session-loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .6);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.main{position:relative}.topo{position:absolute;top:68px;right:18px;width:220px;max-height:calc(100% - 150px);overflow-y:auto;padding:12px;background:hsl(var(--canvas));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 4px 16px #0000000a;z-index:2}.topo-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}.topo-head-title{font-size:12px;font-weight:650;letter-spacing:.02em}.topo-head-sub{font-size:11px;color:hsl(var(--muted-foreground))}.topo-tree{display:flex;flex-direction:column;gap:4px}.topo-children{display:flex;flex-direction:column;gap:4px;margin-top:4px;margin-left:10px;padding-left:8px;border-left:1px solid hsl(var(--border))}.topo-node{display:flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));font-size:12px;transition:border-color .15s ease,background .15s ease,opacity .15s ease}.topo-icon{width:14px;height:14px;flex-shrink:0;opacity:.8}.topo-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.topo-badge{flex-shrink:0;font-size:10px;padding:1px 5px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.topo-node.is-active{border-color:hsl(var(--primary));background:hsl(var(--primary) / .08);animation:topo-pulse 1.4s ease-in-out infinite}.topo-node.is-active .topo-icon{opacity:1}.topo-node.is-onpath{border-color:hsl(var(--primary) / .4);background:hsl(var(--primary) / .04)}.topo-node.is-done{opacity:.55}.topo-remote{margin:3px 0 2px 22px;font-size:10.5px;color:hsl(var(--primary));animation:topo-blink 1.2s ease-in-out infinite}@keyframes topo-blink{0%,to{opacity:1}50%{opacity:.45}}.topo-path{display:flex;flex-wrap:wrap;align-items:center;gap:1px;margin-bottom:9px;padding:6px 8px;border-radius:7px;background:hsl(var(--primary) / .05);font-size:11px;line-height:1.4}.topo-path-seg{display:inline-flex;align-items:center;min-width:0}.topo-path-sep{width:12px;height:12px;flex-shrink:0;color:hsl(var(--muted-foreground))}.topo-path-name{color:hsl(var(--muted-foreground))}.topo-path-name.is-current{color:hsl(var(--primary));font-weight:600}@keyframes topo-pulse{0%,to{box-shadow:0 0 hsl(var(--primary) / .28)}50%{box-shadow:0 0 0 4px hsl(var(--primary) / 0)}}@media (max-width: 1200px){.topo{display:none}}.quick-create{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.qc-head{text-align:center;margin-bottom:28px}.qc-title{margin:0;font-size:26px;font-weight:650;letter-spacing:-.02em}.qc-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.qc-cards{display:grid;grid-template-columns:repeat(4,220px);justify-content:center;gap:16px}@media (max-width: 1240px){.qc-cards{grid-template-columns:repeat(2,220px)}}@media (max-width: 560px){.qc-cards{grid-template-columns:minmax(0,320px)}}.qc-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:20px;text-align:left;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--card));cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s}.qc-card:hover{border-color:hsl(var(--ring) / .35);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.qc-card-arrow{position:absolute;top:18px;right:18px;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.qc-card:hover .qc-card-arrow{opacity:1;transform:translate(0)}.qc-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;margin-bottom:6px;border-radius:12px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.qc-icon svg{width:20px;height:20px}.qc-card-title{font-size:15px;font-weight:600}.qc-card-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.navbar-title{min-width:0;max-width:min(60vw,640px);overflow:hidden;padding:0;font-size:15px;font-weight:600;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.create-stub{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:hsl(var(--muted-foreground))}.create-back{align-self:flex-start;margin:12px;border:none;background:none;font:inherit;font-size:13px;color:hsl(var(--muted-foreground));cursor:pointer}.create-back:hover{color:hsl(var(--foreground))}.navbar-crumbs{display:flex;align-items:center;gap:4px;min-width:0}.navbar-crumbs>.crumb:first-child{padding-left:0}.crumb{font-size:15px;font-weight:600;letter-spacing:-.01em;padding:2px 4px;border-radius:6px;white-space:nowrap}.crumb-link{border:none;background:none;font:inherit;font-weight:500;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.crumb-link:hover{color:hsl(var(--foreground));background:hsl(var(--foreground) / .05)}.crumb-current{color:hsl(var(--foreground))}.crumb-sep{width:15px;height:15px;color:hsl(var(--muted-foreground));flex-shrink:0}.confirm-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;display:flex;align-items:center;justify-content:center;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.confirm-box{width:340px;max-width:calc(100vw - 32px);padding:20px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 16px 48px -16px hsl(var(--foreground) / .3)}.confirm-title{font-size:15px;font-weight:600;margin-bottom:6px}.confirm-text{font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground));margin-bottom:18px}.confirm-actions{display:flex;justify-content:flex-end;gap:8px}.confirm-btn{padding:7px 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s}.confirm-btn:hover{background:hsl(var(--foreground) / .05)}.confirm-btn--danger{border-color:transparent;background:hsl(var(--destructive));color:#fff}.confirm-btn--danger:hover{background:hsl(var(--destructive) / .9)} diff --git a/veadk/webui/assets/index-u-pg5XfV.js b/veadk/webui/assets/index-gtSqVSNF.js similarity index 50% rename from veadk/webui/assets/index-u-pg5XfV.js rename to veadk/webui/assets/index-gtSqVSNF.js index 27f539a1..7dbf923b 100644 --- a/veadk/webui/assets/index-u-pg5XfV.js +++ b/veadk/webui/assets/index-gtSqVSNF.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor--dxbgBhm.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); -var MP=Object.defineProperty;var DP=(e,t,n)=>t in e?MP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var cw=(e,t,n)=>DP(e,typeof t!="symbol"?t+"":t,n);function PP(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Nh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ju(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var NS={exports:{}},Bp={},SS={exports:{}},at={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-CwT7JlSU.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +var PP=Object.defineProperty;var jP=(e,t,n)=>t in e?PP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var cw=(e,t,n)=>jP(e,typeof t!="symbol"?t+"":t,n);function BP(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Ah=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var SS={exports:{}},Up={},AS={exports:{}},at={};/** * @license React * react.production.min.js * @@ -7,7 +7,7 @@ var MP=Object.defineProperty;var DP=(e,t,n)=>t in e?MP(e,t,{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 ed=Symbol.for("react.element"),jP=Symbol.for("react.portal"),BP=Symbol.for("react.fragment"),FP=Symbol.for("react.strict_mode"),UP=Symbol.for("react.profiler"),$P=Symbol.for("react.provider"),HP=Symbol.for("react.context"),zP=Symbol.for("react.forward_ref"),VP=Symbol.for("react.suspense"),KP=Symbol.for("react.memo"),YP=Symbol.for("react.lazy"),uw=Symbol.iterator;function WP(e){return e===null||typeof e!="object"?null:(e=uw&&e[uw]||e["@@iterator"],typeof e=="function"?e:null)}var AS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},CS=Object.assign,IS={};function Ol(e,t,n){this.props=e,this.context=t,this.refs=IS,this.updater=n||AS}Ol.prototype.isReactComponent={};Ol.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ol.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function RS(){}RS.prototype=Ol.prototype;function X1(e,t,n){this.props=e,this.context=t,this.refs=IS,this.updater=n||AS}var Q1=X1.prototype=new RS;Q1.constructor=X1;CS(Q1,Ol.prototype);Q1.isPureReactComponent=!0;var dw=Array.isArray,OS=Object.prototype.hasOwnProperty,Z1={current:null},LS={key:!0,ref:!0,__self:!0,__source:!0};function MS(e,t,n){var r,s={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)OS.call(t,r)&&!LS.hasOwnProperty(r)&&(s[r]=t[r]);var o=arguments.length-2;if(o===1)s.children=n;else if(1t in e?MP(e,t,{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 ZP=v,JP=Symbol.for("react.element"),e4=Symbol.for("react.fragment"),t4=Object.prototype.hasOwnProperty,n4=ZP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r4={key:!0,ref:!0,__self:!0,__source:!0};function PS(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)t4.call(t,r)&&!r4.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:JP,type:e,key:i,ref:a,props:s,_owner:n4.current}}Bp.Fragment=e4;Bp.jsx=PS;Bp.jsxs=PS;NS.exports=Bp;var c=NS.exports,H0={},jS={exports:{}},Dr={},BS={exports:{}},FS={};/** + */var e4=v,t4=Symbol.for("react.element"),n4=Symbol.for("react.fragment"),r4=Object.prototype.hasOwnProperty,s4=e4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i4={key:!0,ref:!0,__self:!0,__source:!0};function jS(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)r4.call(t,r)&&!i4.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:t4,type:e,key:i,ref:a,props:s,_owner:s4.current}}Up.Fragment=n4;Up.jsx=jS;Up.jsxs=jS;SS.exports=Up;var c=SS.exports,z0={},BS={exports:{}},Pr={},FS={exports:{}},US={};/** * @license React * scheduler.production.min.js * @@ -23,7 +23,7 @@ var MP=Object.defineProperty;var DP=(e,t,n)=>t in e?MP(e,t,{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. - */(function(e){function t(O,j){var S=O.length;O.push(j);e:for(;0>>1,V=O[H];if(0>>1;Hs(J,S))res(de,J)?(O[H]=de,O[re]=S,H=re):(O[H]=J,O[ne]=S,H=ne);else if(res(de,S))O[H]=de,O[re]=S,H=re;else break e}}return j}function s(O,j){var S=O.sortIndex-j.sortIndex;return S!==0?S:O.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,f=null,h=3,p=!1,m=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(O){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=O)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function _(O){if(b=!1,y(O),!m)if(n(l)!==null)m=!0,A(k);else{var j=n(u);j!==null&&L(_,j.startTime-O)}}function k(O,j){m=!1,b&&(b=!1,g(N),N=-1),p=!0;var S=h;try{for(y(j),f=n(l);f!==null&&(!(f.expirationTime>j)||O&&!M());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var V=H(f.expirationTime<=j);j=e.unstable_now(),typeof V=="function"?f.callback=V:f===n(l)&&r(l),y(j)}else r(l);f=n(l)}if(f!==null)var D=!0;else{var ne=n(u);ne!==null&&L(_,ne.startTime-j),D=!1}return D}finally{f=null,h=S,p=!1}}var T=!1,C=null,N=-1,R=5,I=-1;function M(){return!(e.unstable_now()-IO||125H?(O.sortIndex=S,t(u,O),n(l)===null&&O===n(u)&&(b?(g(N),N=-1):b=!0,L(_,S-H))):(O.sortIndex=V,t(l,O),m||p||(m=!0,A(k))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var j=h;return function(){var S=h;h=j;try{return O.apply(this,arguments)}finally{h=S}}}})(FS);BS.exports=FS;var s4=BS.exports;/** + */(function(e){function t(O,j){var S=O.length;O.push(j);e:for(;0>>1,V=O[H];if(0>>1;Hs(ee,S))res(de,ee)?(O[H]=de,O[re]=S,H=re):(O[H]=ee,O[ne]=S,H=ne);else if(res(de,S))O[H]=de,O[re]=S,H=re;else break e}}return j}function s(O,j){var S=O.sortIndex-j.sortIndex;return S!==0?S:O.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,f=null,h=3,p=!1,m=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(O){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=O)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function _(O){if(y=!1,b(O),!m)if(n(l)!==null)m=!0,C(N);else{var j=n(u);j!==null&&L(_,j.startTime-O)}}function N(O,j){m=!1,y&&(y=!1,g(k),k=-1),p=!0;var S=h;try{for(b(j),f=n(l);f!==null&&(!(f.expirationTime>j)||O&&!M());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var V=H(f.expirationTime<=j);j=e.unstable_now(),typeof V=="function"?f.callback=V:f===n(l)&&r(l),b(j)}else r(l);f=n(l)}if(f!==null)var D=!0;else{var ne=n(u);ne!==null&&L(_,ne.startTime-j),D=!1}return D}finally{f=null,h=S,p=!1}}var T=!1,A=null,k=-1,R=5,I=-1;function M(){return!(e.unstable_now()-IO||125H?(O.sortIndex=S,t(u,O),n(l)===null&&O===n(u)&&(y?(g(k),k=-1):y=!0,L(_,S-H))):(O.sortIndex=V,t(l,O),m||p||(m=!0,C(N))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var j=h;return function(){var S=h;h=j;try{return O.apply(this,arguments)}finally{h=S}}}})(US);FS.exports=US;var a4=FS.exports;/** * @license React * react-dom.production.min.js * @@ -31,14 +31,14 @@ var MP=Object.defineProperty;var DP=(e,t,n)=>t in e?MP(e,t,{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 i4=v,Or=s4;function me(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),z0=Object.prototype.hasOwnProperty,a4=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hw={},pw={};function o4(e){return z0.call(pw,e)?!0:z0.call(hw,e)?!1:a4.test(e)?pw[e]=!0:(hw[e]=!0,!1)}function l4(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function c4(e,t,n,r){if(t===null||typeof t>"u"||l4(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ur(e,t,n,r,s,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var $n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$n[e]=new ur(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$n[t]=new ur(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$n[e]=new ur(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$n[e]=new ur(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$n[e]=new ur(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$n[e]=new ur(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$n[e]=new ur(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$n[e]=new ur(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$n[e]=new ur(e,5,!1,e.toLowerCase(),null,!1,!1)});var eb=/[\-:]([a-z])/g;function tb(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(eb,tb);$n[t]=new ur(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(eb,tb);$n[t]=new ur(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(eb,tb);$n[t]=new ur(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$n[e]=new ur(e,1,!1,e.toLowerCase(),null,!1,!1)});$n.xlinkHref=new ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$n[e]=new ur(e,1,!1,e.toLowerCase(),null,!0,!0)});function nb(e,t,n,r){var s=$n.hasOwnProperty(t)?$n[t]:null;(s!==null?s.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V0=Object.prototype.hasOwnProperty,l4=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hw={},pw={};function c4(e){return V0.call(pw,e)?!0:V0.call(hw,e)?!1:l4.test(e)?pw[e]=!0:(hw[e]=!0,!1)}function u4(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function d4(e,t,n,r){if(t===null||typeof t>"u"||u4(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function dr(e,t,n,r,s,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var $n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$n[e]=new dr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$n[t]=new dr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$n[e]=new dr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$n[e]=new dr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$n[e]=new dr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$n[e]=new dr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$n[e]=new dr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$n[e]=new dr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$n[e]=new dr(e,5,!1,e.toLowerCase(),null,!1,!1)});var tb=/[\-:]([a-z])/g;function nb(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(tb,nb);$n[t]=new dr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(tb,nb);$n[t]=new dr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(tb,nb);$n[t]=new dr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$n[e]=new dr(e,1,!1,e.toLowerCase(),null,!1,!1)});$n.xlinkHref=new dr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$n[e]=new dr(e,1,!1,e.toLowerCase(),null,!0,!0)});function rb(e,t,n,r){var s=$n.hasOwnProperty(t)?$n[t]:null;(s!==null?s.type!==0:r||!(2o||s[a]!==i[o]){var l=` -`+s[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{tg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?vc(e):""}function u4(e){switch(e.tag){case 5:return vc(e.type);case 16:return vc("Lazy");case 13:return vc("Suspense");case 19:return vc("SuspenseList");case 0:case 2:case 15:return e=ng(e.type,!1),e;case 11:return e=ng(e.type.render,!1),e;case 1:return e=ng(e.type,!0),e;default:return""}}function W0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _o:return"Fragment";case vo:return"Portal";case V0:return"Profiler";case rb:return"StrictMode";case K0:return"Suspense";case Y0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case HS:return(e.displayName||"Context")+".Consumer";case $S:return(e._context.displayName||"Context")+".Provider";case sb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ib:return t=e.displayName||null,t!==null?t:W0(e.type)||"Memo";case vi:t=e._payload,e=e._init;try{return W0(e(t))}catch{}}return null}function d4(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return W0(t);case 8:return t===rb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ki(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function VS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function f4(e){var t=VS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wd(e){e._valueTracker||(e._valueTracker=f4(e))}function KS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=VS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Sh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function q0(e,t){var n=t.checked;return rn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ki(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function YS(e,t){t=t.checked,t!=null&&nb(e,"checked",t,!1)}function G0(e,t){YS(e,t);var n=Ki(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?X0(e,t.type,n):t.hasOwnProperty("defaultValue")&&X0(e,t.type,Ki(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function X0(e,t,n){(t!=="number"||Sh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _c=Array.isArray;function Ko(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=qd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},h4=["Webkit","ms","Moz","O"];Object.keys(Mc).forEach(function(e){h4.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mc[t]=Mc[e]})});function XS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mc.hasOwnProperty(e)&&Mc[e]?(""+t).trim():t+"px"}function QS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=XS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var p4=rn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function J0(e,t){if(t){if(p4[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function ey(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ty=null;function ab(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ny=null,Yo=null,Wo=null;function xw(e){if(e=rd(e)){if(typeof ny!="function")throw Error(me(280));var t=e.stateNode;t&&(t=zp(t),ny(e.stateNode,e.type,t))}}function ZS(e){Yo?Wo?Wo.push(e):Wo=[e]:Yo=e}function JS(){if(Yo){var e=Yo,t=Wo;if(Wo=Yo=null,xw(e),t)for(e=0;e>>=0,e===0?32:31-(k4(e)/N4|0)|0}var Gd=64,Xd=4194304;function Tc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~s;o!==0?r=Tc(o):(i&=a,i!==0&&(r=Tc(i)))}else a=n&~s,a!==0?r=Tc(a):i!==0&&(r=Tc(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function td(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-cs(t),e[t]=n}function I4(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Pc),Cw=" ",Iw=!1;function E2(e,t){switch(e){case"keyup":return s6.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function x2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var To=!1;function a6(e,t){switch(e){case"compositionend":return x2(t);case"keypress":return t.which!==32?null:(Iw=!0,Cw);case"textInput":return e=t.data,e===Cw&&Iw?null:e;default:return null}}function o6(e,t){if(To)return e==="compositionend"||!pb&&E2(e,t)?(e=y2(),qf=db=Ci=null,To=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mw(n)}}function T2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?T2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function k2(){for(var e=window,t=Sh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Sh(e.document)}return t}function mb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function g6(e){var t=k2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&T2(n.ownerDocument.documentElement,n)){if(r!==null&&mb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Dw(n,i);var a=Dw(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ko=null,ly=null,Bc=null,cy=!1;function Pw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cy||ko==null||ko!==Sh(r)||(r=ko,"selectionStart"in r&&mb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bc&&mu(Bc,r)||(Bc=r,r=Mh(ly,"onSelect"),0Ao||(e.current=my[Ao],my[Ao]=null,Ao--)}function Dt(e,t){Ao++,my[Ao]=e.current,e.current=t}var Yi={},Xn=Qi(Yi),gr=Qi(!1),Da=Yi;function il(e,t){var n=e.type.contextTypes;if(!n)return Yi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function yr(e){return e=e.childContextTypes,e!=null}function Ph(){Ft(gr),Ft(Xn)}function zw(e,t,n){if(Xn.current!==Yi)throw Error(me(168));Dt(Xn,t),Dt(gr,n)}function M2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(me(108,d4(e)||"Unknown",s));return rn({},n,r)}function jh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yi,Da=Xn.current,Dt(Xn,e),Dt(gr,gr.current),!0}function Vw(e,t,n){var r=e.stateNode;if(!r)throw Error(me(169));n?(e=M2(e,t,Da),r.__reactInternalMemoizedMergedChildContext=e,Ft(gr),Ft(Xn),Dt(Xn,e)):Ft(gr),Dt(gr,n)}var Vs=null,Vp=!1,gg=!1;function D2(e){Vs===null?Vs=[e]:Vs.push(e)}function A6(e){Vp=!0,D2(e)}function Zi(){if(!gg&&Vs!==null){gg=!0;var e=0,t=vt;try{var n=Vs;for(vt=1;e>=a,s-=a,Ys=1<<32-cs(t)+s|n<N?(R=C,C=null):R=C.sibling;var I=h(g,C,y[N],_);if(I===null){C===null&&(C=R);break}e&&C&&I.alternate===null&&t(g,C),E=i(I,E,N),T===null?k=I:T.sibling=I,T=I,C=R}if(N===y.length)return n(g,C),Yt&&ua(g,N),k;if(C===null){for(;NN?(R=C,C=null):R=C.sibling;var M=h(g,C,I.value,_);if(M===null){C===null&&(C=R);break}e&&C&&M.alternate===null&&t(g,C),E=i(M,E,N),T===null?k=M:T.sibling=M,T=M,C=R}if(I.done)return n(g,C),Yt&&ua(g,N),k;if(C===null){for(;!I.done;N++,I=y.next())I=f(g,I.value,_),I!==null&&(E=i(I,E,N),T===null?k=I:T.sibling=I,T=I);return Yt&&ua(g,N),k}for(C=r(g,C);!I.done;N++,I=y.next())I=p(C,g,N,I.value,_),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?N:I.key),E=i(I,E,N),T===null?k=I:T.sibling=I,T=I);return e&&C.forEach(function(B){return t(g,B)}),Yt&&ua(g,N),k}function w(g,E,y,_){if(typeof y=="object"&&y!==null&&y.type===_o&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Yd:e:{for(var k=y.key,T=E;T!==null;){if(T.key===k){if(k=y.type,k===_o){if(T.tag===7){n(g,T.sibling),E=s(T,y.props.children),E.return=g,g=E;break e}}else if(T.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vi&&Ww(k)===T.type){n(g,T.sibling),E=s(T,y.props),E.ref=ic(g,T,y),E.return=g,g=E;break e}n(g,T);break}else t(g,T);T=T.sibling}y.type===_o?(E=Aa(y.props.children,g.mode,_,y.key),E.return=g,g=E):(_=nh(y.type,y.key,y.props,null,g.mode,_),_.ref=ic(g,E,y),_.return=g,g=_)}return a(g);case vo:e:{for(T=y.key;E!==null;){if(E.key===T)if(E.tag===4&&E.stateNode.containerInfo===y.containerInfo&&E.stateNode.implementation===y.implementation){n(g,E.sibling),E=s(E,y.children||[]),E.return=g,g=E;break e}else{n(g,E);break}else t(g,E);E=E.sibling}E=Tg(y,g.mode,_),E.return=g,g=E}return a(g);case vi:return T=y._init,w(g,E,T(y._payload),_)}if(_c(y))return m(g,E,y,_);if(ec(y))return b(g,E,y,_);rf(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,E!==null&&E.tag===6?(n(g,E.sibling),E=s(E,y),E.return=g,g=E):(n(g,E),E=_g(y,g.mode,_),E.return=g,g=E),a(g)):n(g,E)}return w}var ol=F2(!0),U2=F2(!1),Uh=Qi(null),$h=null,Ro=null,Eb=null;function xb(){Eb=Ro=$h=null}function wb(e){var t=Uh.current;Ft(Uh),e._currentValue=t}function by(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Go(e,t){$h=e,Eb=Ro=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pr=!0),e.firstContext=null)}function Wr(e){var t=e._currentValue;if(Eb!==e)if(e={context:e,memoizedValue:t,next:null},Ro===null){if($h===null)throw Error(me(308));Ro=e,$h.dependencies={lanes:0,firstContext:e}}else Ro=Ro.next=e;return t}var xa=null;function vb(e){xa===null?xa=[e]:xa.push(e)}function $2(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,vb(t)):(n.next=s.next,s.next=n),t.interleaved=n,ai(e,r)}function ai(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _i=!1;function _b(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function H2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Zs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ji(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,ai(e,n)}return s=r.interleaved,s===null?(t.next=t,vb(r)):(t.next=s.next,s.next=t),r.interleaved=t,ai(e,n)}function Xf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lb(e,n)}}function qw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Hh(e,t,n,r){var s=e.updateQueue;_i=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?i=u:a.next=u,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;a=0,d=u=l=null,o=i;do{var h=o.lane,p=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,b=o;switch(h=t,p=n,b.tag){case 1:if(m=b.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=b.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=rn({},f,h);break e;case 2:_i=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,l=f):d=d.next=p,a|=h;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;h=o,o=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ba|=a,e.lanes=a,e.memoizedState=f}}function Gw(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bg.transition;bg.transition={};try{e(!1),t()}finally{vt=n,bg.transition=r}}function iA(){return qr().memoizedState}function O6(e,t,n){var r=Fi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},aA(e))oA(t,n);else if(n=$2(e,t,n,r),n!==null){var s=ar();us(n,e,r,s),lA(n,t,r)}}function L6(e,t,n){var r=Fi(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(aA(e))oA(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,fs(o,a)){var l=t.interleaved;l===null?(s.next=s,vb(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=$2(e,t,s,r),n!==null&&(s=ar(),us(n,e,r,s),lA(n,t,r))}}function aA(e){var t=e.alternate;return e===nn||t!==null&&t===nn}function oA(e,t){Fc=Vh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lb(e,n)}}var Kh={readContext:Wr,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useInsertionEffect:Vn,useLayoutEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useMutableSource:Vn,useSyncExternalStore:Vn,useId:Vn,unstable_isNewReconciler:!1},M6={readContext:Wr,useCallback:function(e,t){return _s().memoizedState=[e,t===void 0?null:t],e},useContext:Wr,useEffect:Qw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zf(4194308,4,eA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zf(4,2,e,t)},useMemo:function(e,t){var n=_s();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_s();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=O6.bind(null,nn,e),[r.memoizedState,e]},useRef:function(e){var t=_s();return e={current:e},t.memoizedState=e},useState:Xw,useDebugValue:Rb,useDeferredValue:function(e){return _s().memoizedState=e},useTransition:function(){var e=Xw(!1),t=e[0];return e=R6.bind(null,e[1]),_s().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nn,s=_s();if(Yt){if(n===void 0)throw Error(me(407));n=n()}else{if(n=t(),Mn===null)throw Error(me(349));ja&30||Y2(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Qw(q2.bind(null,r,i,e),[e]),r.flags|=2048,_u(9,W2.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_s(),t=Mn.identifierPrefix;if(Yt){var n=Ws,r=Ys;n=(r&~(1<<32-cs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wu++,0")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{ng=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Tc(e):""}function f4(e){switch(e.tag){case 5:return Tc(e.type);case 16:return Tc("Lazy");case 13:return Tc("Suspense");case 19:return Tc("SuspenseList");case 0:case 2:case 15:return e=rg(e.type,!1),e;case 11:return e=rg(e.type.render,!1),e;case 1:return e=rg(e.type,!0),e;default:return""}}function q0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case To:return"Fragment";case _o:return"Portal";case K0:return"Profiler";case sb:return"StrictMode";case Y0:return"Suspense";case W0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zS:return(e.displayName||"Context")+".Consumer";case HS:return(e._context.displayName||"Context")+".Provider";case ib:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ab:return t=e.displayName||null,t!==null?t:q0(e.type)||"Memo";case _i:t=e._payload,e=e._init;try{return q0(e(t))}catch{}}return null}function h4(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q0(t);case 8:return t===sb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function KS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p4(e){var t=KS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gd(e){e._valueTracker||(e._valueTracker=p4(e))}function YS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=KS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ch(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function G0(e,t){var n=t.checked;return sn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Yi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function WS(e,t){t=t.checked,t!=null&&rb(e,"checked",t,!1)}function X0(e,t){WS(e,t);var n=Yi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Q0(e,t.type,n):t.hasOwnProperty("defaultValue")&&Q0(e,t.type,Yi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Q0(e,t,n){(t!=="number"||Ch(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nc=Array.isArray;function Yo(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Xd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function du(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},m4=["Webkit","ms","Moz","O"];Object.keys(Pc).forEach(function(e){m4.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pc[t]=Pc[e]})});function QS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pc.hasOwnProperty(e)&&Pc[e]?(""+t).trim():t+"px"}function ZS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=QS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var g4=sn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ey(e,t){if(t){if(g4[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function ty(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ny=null;function ob(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ry=null,Wo=null,qo=null;function xw(e){if(e=id(e)){if(typeof ry!="function")throw Error(me(280));var t=e.stateNode;t&&(t=Kp(t),ry(e.stateNode,e.type,t))}}function JS(e){Wo?qo?qo.push(e):qo=[e]:Wo=e}function e2(){if(Wo){var e=Wo,t=qo;if(qo=Wo=null,xw(e),t)for(e=0;e>>=0,e===0?32:31-(S4(e)/A4|0)|0}var Qd=64,Zd=4194304;function kc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Lh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~s;o!==0?r=kc(o):(i&=a,i!==0&&(r=kc(i)))}else a=n&~s,a!==0?r=kc(a):i!==0&&(r=kc(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function rd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-us(t),e[t]=n}function O4(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Bc),Cw=" ",Iw=!1;function x2(e,t){switch(e){case"keyup":return a6.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function w2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var No=!1;function l6(e,t){switch(e){case"compositionend":return w2(t);case"keypress":return t.which!==32?null:(Iw=!0,Cw);case"textInput":return e=t.data,e===Cw&&Iw?null:e;default:return null}}function c6(e,t){if(No)return e==="compositionend"||!mb&&x2(e,t)?(e=b2(),Xf=fb=Ii=null,No=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mw(n)}}function N2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?N2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function k2(){for(var e=window,t=Ch();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ch(e.document)}return t}function gb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function b6(e){var t=k2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&N2(n.ownerDocument.documentElement,n)){if(r!==null&&gb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Dw(n,i);var a=Dw(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ko=null,cy=null,Uc=null,uy=!1;function Pw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uy||ko==null||ko!==Ch(r)||(r=ko,"selectionStart"in r&&gb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Uc&&yu(Uc,r)||(Uc=r,r=Ph(cy,"onSelect"),0Co||(e.current=gy[Co],gy[Co]=null,Co--)}function Pt(e,t){Co++,gy[Co]=e.current,e.current=t}var Wi={},Qn=Zi(Wi),br=Zi(!1),Pa=Wi;function al(e,t){var n=e.type.contextTypes;if(!n)return Wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Er(e){return e=e.childContextTypes,e!=null}function Bh(){Ut(br),Ut(Qn)}function zw(e,t,n){if(Qn.current!==Wi)throw Error(me(168));Pt(Qn,t),Pt(br,n)}function D2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(me(108,h4(e)||"Unknown",s));return sn({},n,r)}function Fh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wi,Pa=Qn.current,Pt(Qn,e),Pt(br,br.current),!0}function Vw(e,t,n){var r=e.stateNode;if(!r)throw Error(me(169));n?(e=D2(e,t,Pa),r.__reactInternalMemoizedMergedChildContext=e,Ut(br),Ut(Qn),Pt(Qn,e)):Ut(br),Pt(br,n)}var Ws=null,Yp=!1,yg=!1;function P2(e){Ws===null?Ws=[e]:Ws.push(e)}function I6(e){Yp=!0,P2(e)}function Ji(){if(!yg&&Ws!==null){yg=!0;var e=0,t=xt;try{var n=Ws;for(xt=1;e>=a,s-=a,Gs=1<<32-us(t)+s|n<k?(R=A,A=null):R=A.sibling;var I=h(g,A,b[k],_);if(I===null){A===null&&(A=R);break}e&&A&&I.alternate===null&&t(g,A),E=i(I,E,k),T===null?N=I:T.sibling=I,T=I,A=R}if(k===b.length)return n(g,A),qt&&da(g,k),N;if(A===null){for(;kk?(R=A,A=null):R=A.sibling;var M=h(g,A,I.value,_);if(M===null){A===null&&(A=R);break}e&&A&&M.alternate===null&&t(g,A),E=i(M,E,k),T===null?N=M:T.sibling=M,T=M,A=R}if(I.done)return n(g,A),qt&&da(g,k),N;if(A===null){for(;!I.done;k++,I=b.next())I=f(g,I.value,_),I!==null&&(E=i(I,E,k),T===null?N=I:T.sibling=I,T=I);return qt&&da(g,k),N}for(A=r(g,A);!I.done;k++,I=b.next())I=p(A,g,k,I.value,_),I!==null&&(e&&I.alternate!==null&&A.delete(I.key===null?k:I.key),E=i(I,E,k),T===null?N=I:T.sibling=I,T=I);return e&&A.forEach(function(B){return t(g,B)}),qt&&da(g,k),N}function w(g,E,b,_){if(typeof b=="object"&&b!==null&&b.type===To&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case qd:e:{for(var N=b.key,T=E;T!==null;){if(T.key===N){if(N=b.type,N===To){if(T.tag===7){n(g,T.sibling),E=s(T,b.props.children),E.return=g,g=E;break e}}else if(T.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===_i&&Ww(N)===T.type){n(g,T.sibling),E=s(T,b.props),E.ref=oc(g,T,b),E.return=g,g=E;break e}n(g,T);break}else t(g,T);T=T.sibling}b.type===To?(E=Ca(b.props.children,g.mode,_,b.key),E.return=g,g=E):(_=sh(b.type,b.key,b.props,null,g.mode,_),_.ref=oc(g,E,b),_.return=g,g=_)}return a(g);case _o:e:{for(T=b.key;E!==null;){if(E.key===T)if(E.tag===4&&E.stateNode.containerInfo===b.containerInfo&&E.stateNode.implementation===b.implementation){n(g,E.sibling),E=s(E,b.children||[]),E.return=g,g=E;break e}else{n(g,E);break}else t(g,E);E=E.sibling}E=Ng(b,g.mode,_),E.return=g,g=E}return a(g);case _i:return T=b._init,w(g,E,T(b._payload),_)}if(Nc(b))return m(g,E,b,_);if(nc(b))return y(g,E,b,_);af(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,E!==null&&E.tag===6?(n(g,E.sibling),E=s(E,b),E.return=g,g=E):(n(g,E),E=Tg(b,g.mode,_),E.return=g,g=E),a(g)):n(g,E)}return w}var ll=U2(!0),$2=U2(!1),Hh=Zi(null),zh=null,Oo=null,xb=null;function wb(){xb=Oo=zh=null}function vb(e){var t=Hh.current;Ut(Hh),e._currentValue=t}function Ey(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Xo(e,t){zh=e,xb=Oo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gr=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if(xb!==e)if(e={context:e,memoizedValue:t,next:null},Oo===null){if(zh===null)throw Error(me(308));Oo=e,zh.dependencies={lanes:0,firstContext:e}}else Oo=Oo.next=e;return t}var wa=null;function _b(e){wa===null?wa=[e]:wa.push(e)}function H2(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,_b(t)):(n.next=s.next,s.next=n),t.interleaved=n,oi(e,r)}function oi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ti=!1;function Tb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function z2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ti(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ht&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,oi(e,n)}return s=r.interleaved,s===null?(t.next=t,_b(r)):(t.next=s.next,s.next=t),r.interleaved=t,oi(e,n)}function Zf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cb(e,n)}}function qw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vh(e,t,n,r){var s=e.updateQueue;Ti=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?i=u:a.next=u,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;a=0,d=u=l=null,o=i;do{var h=o.lane,p=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,y=o;switch(h=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=sn({},f,h);break e;case 2:Ti=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,l=f):d=d.next=p,a|=h;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;h=o,o=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Fa|=a,e.lanes=a,e.memoizedState=f}}function Gw(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Eg.transition;Eg.transition={};try{e(!1),t()}finally{xt=n,Eg.transition=r}}function aA(){return Gr().memoizedState}function M6(e,t,n){var r=Ui(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},oA(e))lA(t,n);else if(n=H2(e,t,n,r),n!==null){var s=lr();ds(n,e,r,s),cA(n,t,r)}}function D6(e,t,n){var r=Ui(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(oA(e))lA(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,ps(o,a)){var l=t.interleaved;l===null?(s.next=s,_b(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=H2(e,t,s,r),n!==null&&(s=lr(),ds(n,e,r,s),cA(n,t,r))}}function oA(e){var t=e.alternate;return e===rn||t!==null&&t===rn}function lA(e,t){$c=Yh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cb(e,n)}}var Wh={readContext:qr,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useInsertionEffect:Vn,useLayoutEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useMutableSource:Vn,useSyncExternalStore:Vn,useId:Vn,unstable_isNewReconciler:!1},P6={readContext:qr,useCallback:function(e,t){return Ns().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:Qw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,eh(4194308,4,tA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return eh(4194308,4,e,t)},useInsertionEffect:function(e,t){return eh(4,2,e,t)},useMemo:function(e,t){var n=Ns();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ns();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=M6.bind(null,rn,e),[r.memoizedState,e]},useRef:function(e){var t=Ns();return e={current:e},t.memoizedState=e},useState:Xw,useDebugValue:Ob,useDeferredValue:function(e){return Ns().memoizedState=e},useTransition:function(){var e=Xw(!1),t=e[0];return e=L6.bind(null,e[1]),Ns().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=rn,s=Ns();if(qt){if(n===void 0)throw Error(me(407));n=n()}else{if(n=t(),Mn===null)throw Error(me(349));Ba&30||W2(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Qw(G2.bind(null,r,i,e),[e]),r.flags|=2048,Nu(9,q2.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ns(),t=Mn.identifierPrefix;if(qt){var n=Xs,r=Gs;n=(r&~(1<<32-us(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_u++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Ss]=t,e[bu]=r,bA(e,t,!1,!1),t.stateNode=e;e:{switch(a=ey(n,r),n){case"dialog":Bt("cancel",e),Bt("close",e),s=r;break;case"iframe":case"object":case"embed":Bt("load",e),s=r;break;case"video":case"audio":for(s=0;sul&&(t.flags|=128,r=!0,ac(i,!1),t.lanes=4194304)}else{if(!r)if(e=zh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Yt)return Kn(t),null}else 2*un()-i.renderingStartTime>ul&&n!==1073741824&&(t.flags|=128,r=!0,ac(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=un(),t.sibling=null,n=en.current,Dt(en,r?n&1|2:n&1),t):(Kn(t),null);case 22:case 23:return jb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Nr&1073741824&&(Kn(t),t.subtreeFlags&6&&(t.flags|=8192)):Kn(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function H6(e,t){switch(yb(t),t.tag){case 1:return yr(t.type)&&Ph(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ll(),Ft(gr),Ft(Xn),Nb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return kb(t),null;case 13:if(Ft(en),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ft(en),null;case 4:return ll(),null;case 10:return wb(t.type._context),null;case 22:case 23:return jb(),null;case 24:return null;default:return null}}var af=!1,Wn=!1,z6=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function Oo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){an(e,t,r)}else n.current=null}function Sy(e,t,n){try{n()}catch(r){an(e,t,r)}}var lv=!1;function V6(e,t){if(uy=Oh,e=k2(),mb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(o=a+s),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===s&&(o=a),h===i&&++d===r&&(l=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(dy={focusedElem:e,selectionRange:n},Oh=!1,Ae=t;Ae!==null;)if(t=Ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ae=e;else for(;Ae!==null;){t=Ae;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var b=m.memoizedProps,w=m.memoizedState,g=t.stateNode,E=g.getSnapshotBeforeUpdate(t.elementType===t.type?b:ns(t.type,b),w);g.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(_){an(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Ae=e;break}Ae=t.return}return m=lv,lv=!1,m}function Uc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Sy(t,n,i)}s=s.next}while(s!==r)}}function Wp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ay(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wA(e){var t=e.alternate;t!==null&&(e.alternate=null,wA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ss],delete t[bu],delete t[py],delete t[N6],delete t[S6])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function vA(e){return e.tag===5||e.tag===3||e.tag===4}function cv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dh));else if(r!==4&&(e=e.child,e!==null))for(Cy(e,t,n),e=e.sibling;e!==null;)Cy(e,t,n),e=e.sibling}function Iy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Iy(e,t,n),e=e.sibling;e!==null;)Iy(e,t,n),e=e.sibling}var Bn=null,rs=!1;function mi(e,t,n){for(n=n.child;n!==null;)_A(e,t,n),n=n.sibling}function _A(e,t,n){if(As&&typeof As.onCommitFiberUnmount=="function")try{As.onCommitFiberUnmount(Fp,n)}catch{}switch(n.tag){case 5:Wn||Oo(n,t);case 6:var r=Bn,s=rs;Bn=null,mi(e,t,n),Bn=r,rs=s,Bn!==null&&(rs?(e=Bn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Bn.removeChild(n.stateNode));break;case 18:Bn!==null&&(rs?(e=Bn,n=n.stateNode,e.nodeType===8?mg(e.parentNode,n):e.nodeType===1&&mg(e,n),hu(e)):mg(Bn,n.stateNode));break;case 4:r=Bn,s=rs,Bn=n.stateNode.containerInfo,rs=!0,mi(e,t,n),Bn=r,rs=s;break;case 0:case 11:case 14:case 15:if(!Wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Sy(n,t,a),s=s.next}while(s!==r)}mi(e,t,n);break;case 1:if(!Wn&&(Oo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){an(n,t,o)}mi(e,t,n);break;case 21:mi(e,t,n);break;case 22:n.mode&1?(Wn=(r=Wn)||n.memoizedState!==null,mi(e,t,n),Wn=r):mi(e,t,n);break;default:mi(e,t,n)}}function uv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new z6),t.forEach(function(r){var s=J6.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Jr(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=un()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Y6(r/1960))-r,10e?16:e,Ii===null)var r=!1;else{if(e=Ii,Ii=null,qh=0,pt&6)throw Error(me(331));var s=pt;for(pt|=4,Ae=e.current;Ae!==null;){var i=Ae,a=i.child;if(Ae.flags&16){var o=i.deletions;if(o!==null){for(var l=0;lun()-Db?Sa(e,0):Mb|=n),br(e,t)}function RA(e,t){t===0&&(e.mode&1?(t=Xd,Xd<<=1,!(Xd&130023424)&&(Xd=4194304)):t=1);var n=ar();e=ai(e,t),e!==null&&(td(e,t,n),br(e,n))}function Z6(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),RA(e,n)}function J6(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(me(314))}r!==null&&r.delete(t),RA(e,n)}var OA;OA=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gr.current)pr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pr=!1,U6(e,t,n);pr=!!(e.flags&131072)}else pr=!1,Yt&&t.flags&1048576&&P2(t,Fh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Jf(e,t),e=t.pendingProps;var s=il(t,Xn.current);Go(t,n),s=Ab(null,t,r,e,s,n);var i=Cb();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yr(r)?(i=!0,jh(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,_b(t),s.updater=Yp,t.stateNode=s,s._reactInternals=t,xy(t,r,e,n),t=_y(null,t,r,!0,i,n)):(t.tag=0,Yt&&i&&gb(t),rr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Jf(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=t5(r),e=ns(r,e),s){case 0:t=vy(null,t,r,e,n);break e;case 1:t=iv(null,t,r,e,n);break e;case 11:t=rv(null,t,r,e,n);break e;case 14:t=sv(null,t,r,ns(r.type,e),n);break e}throw Error(me(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ns(r,s),vy(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ns(r,s),iv(e,t,r,s,n);case 3:e:{if(mA(t),e===null)throw Error(me(387));r=t.pendingProps,i=t.memoizedState,s=i.element,H2(e,t),Hh(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=cl(Error(me(423)),t),t=av(e,t,r,n,s);break e}else if(r!==s){s=cl(Error(me(424)),t),t=av(e,t,r,n,s);break e}else for(Ar=Pi(t.stateNode.containerInfo.firstChild),Cr=t,Yt=!0,is=null,n=U2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(al(),r===s){t=oi(e,t,n);break e}rr(e,t,r,n)}t=t.child}return t;case 5:return z2(t),e===null&&yy(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,fy(r,s)?a=null:i!==null&&fy(r,i)&&(t.flags|=32),pA(e,t),rr(e,t,a,n),t.child;case 6:return e===null&&yy(t),null;case 13:return gA(e,t,n);case 4:return Tb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ol(t,null,r,n):rr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ns(r,s),rv(e,t,r,s,n);case 7:return rr(e,t,t.pendingProps,n),t.child;case 8:return rr(e,t,t.pendingProps.children,n),t.child;case 12:return rr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,Dt(Uh,r._currentValue),r._currentValue=a,i!==null)if(fs(i.value,a)){if(i.children===s.children&&!gr.current){t=oi(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Zs(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),by(i.return,n,t),o.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(me(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),by(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}rr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Go(t,n),s=Wr(s),r=r(s),t.flags|=1,rr(e,t,r,n),t.child;case 14:return r=t.type,s=ns(r,t.pendingProps),s=ns(r.type,s),sv(e,t,r,s,n);case 15:return fA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ns(r,s),Jf(e,t),t.tag=1,yr(r)?(e=!0,jh(t)):e=!1,Go(t,n),cA(t,r,s),xy(t,r,s,n),_y(null,t,r,!0,e,n);case 19:return yA(e,t,n);case 22:return hA(e,t,n)}throw Error(me(156,t.tag))};function LA(e,t){return a2(e,t)}function e5(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vr(e,t,n,r){return new e5(e,t,n,r)}function Fb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function t5(e){if(typeof e=="function")return Fb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sb)return 11;if(e===ib)return 14}return 2}function Ui(e,t){var n=e.alternate;return n===null?(n=Vr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function nh(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Fb(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case _o:return Aa(n.children,s,i,t);case rb:a=8,s|=8;break;case V0:return e=Vr(12,n,t,s|2),e.elementType=V0,e.lanes=i,e;case K0:return e=Vr(13,n,t,s),e.elementType=K0,e.lanes=i,e;case Y0:return e=Vr(19,n,t,s),e.elementType=Y0,e.lanes=i,e;case zS:return Gp(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $S:a=10;break e;case HS:a=9;break e;case sb:a=11;break e;case ib:a=14;break e;case vi:a=16,r=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=Vr(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Aa(e,t,n,r){return e=Vr(7,e,r,t),e.lanes=n,e}function Gp(e,t,n,r){return e=Vr(22,e,r,t),e.elementType=zS,e.lanes=n,e.stateNode={isHidden:!1},e}function _g(e,t,n){return e=Vr(6,e,null,t),e.lanes=n,e}function Tg(e,t,n){return t=Vr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function n5(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sg(0),this.expirationTimes=sg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sg(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ub(e,t,n,r,s,i,a,o,l){return e=new n5(e,t,n,o,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Vr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_b(i),e}function r5(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jA)}catch(e){console.error(e)}}jA(),jS.exports=Dr;var Ua=jS.exports,bv=Ua;H0.createRoot=bv.createRoot,H0.hydrateRoot=bv.hydrateRoot;const Vb=v.createContext({});function em(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const tm=v.createContext(null),ku=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class l5 extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function c5({children:e,isPresent:t}){const n=v.useId(),r=v.useRef(null),s=v.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=v.useContext(ku);return v.useInsertionEffect(()=>{const{width:a,height:o,top:l,left:u}=s.current;if(t||!r.current||!a||!o)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return i&&(d.nonce=i),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+i.stack}return{value:e,source:t,stack:s,digest:null}}function vg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function vy(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var F6=typeof WeakMap=="function"?WeakMap:Map;function dA(e,t,n){n=ti(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gh||(Gh=!0,Oy=r),vy(e,t)},n}function fA(e,t,n){n=ti(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){vy(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){vy(e,t),typeof r!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function ev(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new F6;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=J6.bind(null,e,t,n),t.then(e,e))}function tv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function nv(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ti(-1,1),t.tag=2,Bi(n,t,1))),n.lanes|=1),e)}var U6=di.ReactCurrentOwner,gr=!1;function ir(e,t,n,r){t.child=e===null?$2(t,null,n,r):ll(t,e.child,n,r)}function rv(e,t,n,r,s){n=n.render;var i=t.ref;return Xo(t,s),r=Cb(e,t,n,r,i,s),n=Ib(),e!==null&&!gr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,li(e,t,s)):(qt&&n&&yb(t),t.flags|=1,ir(e,t,r,s),t.child)}function sv(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Ub(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,hA(e,t,i,r,s)):(e=sh(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:yu,n(a,r)&&e.ref===t.ref)return li(e,t,s)}return t.flags|=1,e=$i(i,r),e.ref=t.ref,e.return=t,t.child=e}function hA(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(yu(i,r)&&e.ref===t.ref)if(gr=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(gr=!0);else return t.lanes=e.lanes,li(e,t,s)}return _y(e,t,n,r,s)}function pA(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pt(Mo,Sr),Sr|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pt(Mo,Sr),Sr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pt(Mo,Sr),Sr|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pt(Mo,Sr),Sr|=r;return ir(e,t,s,n),t.child}function mA(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function _y(e,t,n,r,s){var i=Er(n)?Pa:Qn.current;return i=al(t,i),Xo(t,s),n=Cb(e,t,n,r,i,s),r=Ib(),e!==null&&!gr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,li(e,t,s)):(qt&&r&&yb(t),t.flags|=1,ir(e,t,n,s),t.child)}function iv(e,t,n,r,s){if(Er(n)){var i=!0;Fh(t)}else i=!1;if(Xo(t,s),t.stateNode===null)th(e,t),uA(t,n,r),wy(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=qr(u):(u=Er(n)?Pa:Qn.current,u=al(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==u)&&Jw(t,a,r,u),Ti=!1;var h=t.memoizedState;a.state=h,Vh(t,r,a,s),l=t.memoizedState,o!==r||h!==l||br.current||Ti?(typeof d=="function"&&(xy(t,n,d,r),l=t.memoizedState),(o=Ti||Zw(t,n,o,r,h,l,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,z2(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:rs(t.type,o),a.props=u,f=t.pendingProps,h=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=qr(l):(l=Er(n)?Pa:Qn.current,l=al(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||h!==l)&&Jw(t,a,r,l),Ti=!1,h=t.memoizedState,a.state=h,Vh(t,r,a,s);var m=t.memoizedState;o!==f||h!==m||br.current||Ti?(typeof p=="function"&&(xy(t,n,p,r),m=t.memoizedState),(u=Ti||Zw(t,n,u,r,h,m,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,m,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,m,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Ty(e,t,n,r,i,s)}function Ty(e,t,n,r,s,i){mA(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&Vw(t,n,!1),li(e,t,i);r=t.stateNode,U6.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=ll(t,e.child,null,i),t.child=ll(t,null,o,i)):ir(e,t,o,i),t.memoizedState=r.state,s&&Vw(t,n,!0),t.child}function gA(e){var t=e.stateNode;t.pendingContext?zw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zw(e,t.context,!1),Nb(e,t.containerInfo)}function av(e,t,n,r,s){return ol(),Eb(s),t.flags|=256,ir(e,t,n,r),t.child}var Ny={dehydrated:null,treeContext:null,retryLane:0};function ky(e){return{baseLanes:e,cachePool:null,transitions:null}}function yA(e,t,n){var r=t.pendingProps,s=tn.current,i=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(s&2)!==0),o?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Pt(tn,s&1),e===null)return by(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Qp(a,r,0,null),e=Ca(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ky(n),t.memoizedState=Ny,e):Lb(t,a));if(s=e.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return $6(e,t,a,r,o,s,n);if(i){i=r.fallback,a=t.mode,s=e.child,o=s.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=$i(s,l),r.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=$i(o,i):(i=Ca(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?ky(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Ny,r}return i=e.child,e=i.sibling,r=$i(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Lb(e,t){return t=Qp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function of(e,t,n,r){return r!==null&&Eb(r),ll(t,e.child,null,n),e=Lb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $6(e,t,n,r,s,i,a){if(n)return t.flags&256?(t.flags&=-257,r=vg(Error(me(422))),of(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Qp({mode:"visible",children:r.children},s,0,null),i=Ca(i,s,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ll(t,e.child,null,a),t.child.memoizedState=ky(a),t.memoizedState=Ny,i);if(!(t.mode&1))return of(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var o=r.dgst;return r=o,i=Error(me(419)),r=vg(i,r,void 0),of(e,t,a,r)}if(o=(a&e.childLanes)!==0,gr||o){if(r=Mn,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,oi(e,s),ds(r,e,s,-1))}return Fb(),r=vg(Error(me(421))),of(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=e5.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Cr=ji(s.nextSibling),Ir=t,qt=!0,as=null,e!==null&&(Ur[$r++]=Gs,Ur[$r++]=Xs,Ur[$r++]=ja,Gs=e.id,Xs=e.overflow,ja=t),t=Lb(t,r.children),t.flags|=4096,t)}function ov(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ey(e.return,t,n)}function _g(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function bA(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(ir(e,t,r.children,n),r=tn.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ov(e,n,t);else if(e.tag===19)ov(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Pt(tn,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Kh(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),_g(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Kh(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}_g(t,!0,n,null,i);break;case"together":_g(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function th(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function li(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Fa|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(me(153));if(t.child!==null){for(e=t.child,n=$i(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$i(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function H6(e,t,n){switch(t.tag){case 3:gA(t),ol();break;case 5:V2(t);break;case 1:Er(t.type)&&Fh(t);break;case 4:Nb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Pt(Hh,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pt(tn,tn.current&1),t.flags|=128,null):n&t.child.childLanes?yA(e,t,n):(Pt(tn,tn.current&1),e=li(e,t,n),e!==null?e.sibling:null);Pt(tn,tn.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return bA(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Pt(tn,tn.current),r)break;return null;case 22:case 23:return t.lanes=0,pA(e,t,n)}return li(e,t,n)}var EA,Sy,xA,wA;EA=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Sy=function(){};xA=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,va(Rs.current);var i=null;switch(n){case"input":s=G0(e,s),r=G0(e,r),i=[];break;case"select":s=sn({},s,{value:void 0}),r=sn({},r,{value:void 0}),i=[];break;case"textarea":s=Z0(e,s),r=Z0(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=jh)}ey(n,r);var a;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var o=s[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(uu.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(o=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(uu.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ft("scroll",e),i||o===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};wA=function(e,t,n,r){n!==r&&(t.flags|=4)};function lc(e,t){if(!qt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Kn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function z6(e,t,n){var r=t.pendingProps;switch(bb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kn(t),null;case 1:return Er(t.type)&&Bh(),Kn(t),null;case 3:return r=t.stateNode,cl(),Ut(br),Ut(Qn),Sb(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(sf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,as!==null&&(Dy(as),as=null))),Sy(e,t),Kn(t),null;case 5:kb(t);var s=va(vu.current);if(n=t.type,e!==null&&t.stateNode!=null)xA(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(me(166));return Kn(t),null}if(e=va(Rs.current),sf(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Cs]=t,r[xu]=i,e=(t.mode&1)!==0,n){case"dialog":Ft("cancel",r),Ft("close",r);break;case"iframe":case"object":case"embed":Ft("load",r);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Cs]=t,e[xu]=r,EA(e,t,!1,!1),t.stateNode=e;e:{switch(a=ty(n,r),n){case"dialog":Ft("cancel",e),Ft("close",e),s=r;break;case"iframe":case"object":case"embed":Ft("load",e),s=r;break;case"video":case"audio":for(s=0;sdl&&(t.flags|=128,r=!0,lc(i,!1),t.lanes=4194304)}else{if(!r)if(e=Kh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!qt)return Kn(t),null}else 2*dn()-i.renderingStartTime>dl&&n!==1073741824&&(t.flags|=128,r=!0,lc(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=dn(),t.sibling=null,n=tn.current,Pt(tn,r?n&1|2:n&1),t):(Kn(t),null);case 22:case 23:return Bb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Sr&1073741824&&(Kn(t),t.subtreeFlags&6&&(t.flags|=8192)):Kn(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function V6(e,t){switch(bb(t),t.tag){case 1:return Er(t.type)&&Bh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cl(),Ut(br),Ut(Qn),Sb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return kb(t),null;case 13:if(Ut(tn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ut(tn),null;case 4:return cl(),null;case 10:return vb(t.type._context),null;case 22:case 23:return Bb(),null;case 24:return null;default:return null}}var lf=!1,Wn=!1,K6=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function Lo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ln(e,t,r)}else n.current=null}function Ay(e,t,n){try{n()}catch(r){ln(e,t,r)}}var lv=!1;function Y6(e,t){if(dy=Mh,e=k2(),gb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(o=a+s),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===s&&(o=a),h===i&&++d===r&&(l=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(fy={focusedElem:e,selectionRange:n},Mh=!1,Ae=t;Ae!==null;)if(t=Ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ae=e;else for(;Ae!==null;){t=Ae;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,w=m.memoizedState,g=t.stateNode,E=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:rs(t.type,y),w);g.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(_){ln(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Ae=e;break}Ae=t.return}return m=lv,lv=!1,m}function Hc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Ay(t,n,i)}s=s.next}while(s!==r)}}function Gp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Cy(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vA(e){var t=e.alternate;t!==null&&(e.alternate=null,vA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cs],delete t[xu],delete t[my],delete t[A6],delete t[C6])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function _A(e){return e.tag===5||e.tag===3||e.tag===4}function cv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_A(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Iy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=jh));else if(r!==4&&(e=e.child,e!==null))for(Iy(e,t,n),e=e.sibling;e!==null;)Iy(e,t,n),e=e.sibling}function Ry(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ry(e,t,n),e=e.sibling;e!==null;)Ry(e,t,n),e=e.sibling}var Bn=null,ss=!1;function gi(e,t,n){for(n=n.child;n!==null;)TA(e,t,n),n=n.sibling}function TA(e,t,n){if(Is&&typeof Is.onCommitFiberUnmount=="function")try{Is.onCommitFiberUnmount($p,n)}catch{}switch(n.tag){case 5:Wn||Lo(n,t);case 6:var r=Bn,s=ss;Bn=null,gi(e,t,n),Bn=r,ss=s,Bn!==null&&(ss?(e=Bn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Bn.removeChild(n.stateNode));break;case 18:Bn!==null&&(ss?(e=Bn,n=n.stateNode,e.nodeType===8?gg(e.parentNode,n):e.nodeType===1&&gg(e,n),mu(e)):gg(Bn,n.stateNode));break;case 4:r=Bn,s=ss,Bn=n.stateNode.containerInfo,ss=!0,gi(e,t,n),Bn=r,ss=s;break;case 0:case 11:case 14:case 15:if(!Wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Ay(n,t,a),s=s.next}while(s!==r)}gi(e,t,n);break;case 1:if(!Wn&&(Lo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ln(n,t,o)}gi(e,t,n);break;case 21:gi(e,t,n);break;case 22:n.mode&1?(Wn=(r=Wn)||n.memoizedState!==null,gi(e,t,n),Wn=r):gi(e,t,n);break;default:gi(e,t,n)}}function uv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new K6),t.forEach(function(r){var s=t5.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function es(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=dn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*q6(r/1960))-r,10e?16:e,Ri===null)var r=!1;else{if(e=Ri,Ri=null,Xh=0,ht&6)throw Error(me(331));var s=ht;for(ht|=4,Ae=e.current;Ae!==null;){var i=Ae,a=i.child;if(Ae.flags&16){var o=i.deletions;if(o!==null){for(var l=0;ldn()-Pb?Aa(e,0):Db|=n),xr(e,t)}function OA(e,t){t===0&&(e.mode&1?(t=Zd,Zd<<=1,!(Zd&130023424)&&(Zd=4194304)):t=1);var n=lr();e=oi(e,t),e!==null&&(rd(e,t,n),xr(e,n))}function e5(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),OA(e,n)}function t5(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(me(314))}r!==null&&r.delete(t),OA(e,n)}var LA;LA=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||br.current)gr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return gr=!1,H6(e,t,n);gr=!!(e.flags&131072)}else gr=!1,qt&&t.flags&1048576&&j2(t,$h,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;th(e,t),e=t.pendingProps;var s=al(t,Qn.current);Xo(t,n),s=Cb(null,t,r,e,s,n);var i=Ib();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Er(r)?(i=!0,Fh(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Tb(t),s.updater=qp,t.stateNode=s,s._reactInternals=t,wy(t,r,e,n),t=Ty(null,t,r,!0,i,n)):(t.tag=0,qt&&i&&yb(t),ir(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(th(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=r5(r),e=rs(r,e),s){case 0:t=_y(null,t,r,e,n);break e;case 1:t=iv(null,t,r,e,n);break e;case 11:t=rv(null,t,r,e,n);break e;case 14:t=sv(null,t,r,rs(r.type,e),n);break e}throw Error(me(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),_y(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),iv(e,t,r,s,n);case 3:e:{if(gA(t),e===null)throw Error(me(387));r=t.pendingProps,i=t.memoizedState,s=i.element,z2(e,t),Vh(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=ul(Error(me(423)),t),t=av(e,t,r,n,s);break e}else if(r!==s){s=ul(Error(me(424)),t),t=av(e,t,r,n,s);break e}else for(Cr=ji(t.stateNode.containerInfo.firstChild),Ir=t,qt=!0,as=null,n=$2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ol(),r===s){t=li(e,t,n);break e}ir(e,t,r,n)}t=t.child}return t;case 5:return V2(t),e===null&&by(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,hy(r,s)?a=null:i!==null&&hy(r,i)&&(t.flags|=32),mA(e,t),ir(e,t,a,n),t.child;case 6:return e===null&&by(t),null;case 13:return yA(e,t,n);case 4:return Nb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ll(t,null,r,n):ir(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),rv(e,t,r,s,n);case 7:return ir(e,t,t.pendingProps,n),t.child;case 8:return ir(e,t,t.pendingProps.children,n),t.child;case 12:return ir(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,Pt(Hh,r._currentValue),r._currentValue=a,i!==null)if(ps(i.value,a)){if(i.children===s.children&&!br.current){t=li(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=ti(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ey(i.return,n,t),o.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(me(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ey(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}ir(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Xo(t,n),s=qr(s),r=r(s),t.flags|=1,ir(e,t,r,n),t.child;case 14:return r=t.type,s=rs(r,t.pendingProps),s=rs(r.type,s),sv(e,t,r,s,n);case 15:return hA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),th(e,t),t.tag=1,Er(r)?(e=!0,Fh(t)):e=!1,Xo(t,n),uA(t,r,s),wy(t,r,s,n),Ty(null,t,r,!0,e,n);case 19:return bA(e,t,n);case 22:return pA(e,t,n)}throw Error(me(156,t.tag))};function MA(e,t){return o2(e,t)}function n5(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,n,r){return new n5(e,t,n,r)}function Ub(e){return e=e.prototype,!(!e||!e.isReactComponent)}function r5(e){if(typeof e=="function")return Ub(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ib)return 11;if(e===ab)return 14}return 2}function $i(e,t){var n=e.alternate;return n===null?(n=Kr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function sh(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Ub(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case To:return Ca(n.children,s,i,t);case sb:a=8,s|=8;break;case K0:return e=Kr(12,n,t,s|2),e.elementType=K0,e.lanes=i,e;case Y0:return e=Kr(13,n,t,s),e.elementType=Y0,e.lanes=i,e;case W0:return e=Kr(19,n,t,s),e.elementType=W0,e.lanes=i,e;case VS:return Qp(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case HS:a=10;break e;case zS:a=9;break e;case ib:a=11;break e;case ab:a=14;break e;case _i:a=16,r=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=Kr(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Ca(e,t,n,r){return e=Kr(7,e,r,t),e.lanes=n,e}function Qp(e,t,n,r){return e=Kr(22,e,r,t),e.elementType=VS,e.lanes=n,e.stateNode={isHidden:!1},e}function Tg(e,t,n){return e=Kr(6,e,null,t),e.lanes=n,e}function Ng(e,t,n){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function s5(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ig(0),this.expirationTimes=ig(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ig(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function $b(e,t,n,r,s,i,a,o,l){return e=new s5(e,t,n,o,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Kr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tb(i),e}function i5(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(BA)}catch(e){console.error(e)}}BA(),BS.exports=Pr;var $a=BS.exports,bv=$a;z0.createRoot=bv.createRoot,z0.hydrateRoot=bv.hydrateRoot;const Kb=v.createContext({});function nm(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const rm=v.createContext(null),Su=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class u5 extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function d5({children:e,isPresent:t}){const n=v.useId(),r=v.useRef(null),s=v.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=v.useContext(Su);return v.useInsertionEffect(()=>{const{width:a,height:o,top:l,left:u}=s.current;if(t||!r.current||!a||!o)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return i&&(d.nonce=i),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${a}px !important; @@ -46,152 +46,152 @@ Error generating stack: `+i.message+` top: ${l}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),c.jsx(l5,{isPresent:t,childRef:r,sizeRef:s,children:v.cloneElement(e,{ref:r})})}const u5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const o=em(d5),l=v.useId(),u=v.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=v.useMemo(()=>({id:l,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(o.set(f,!1),()=>o.delete(f))}),i?[Math.random(),u]:[n,u]);return v.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),v.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),a==="popLayout"&&(e=c.jsx(c5,{isPresent:n,children:e})),c.jsx(tm.Provider,{value:d,children:e})};function d5(){return new Map}function BA(e=!0){const t=v.useContext(tm);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=v.useId();v.useEffect(()=>{e&&s(i)},[e]);const a=v.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const cf=e=>e.key||"";function Ev(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Kb=typeof window<"u",FA=Kb?v.useLayoutEffect:v.useEffect,$i=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[o,l]=BA(a),u=v.useMemo(()=>Ev(e),[e]),d=a&&!o?[]:u.map(cf),f=v.useRef(!0),h=v.useRef(u),p=em(()=>new Map),[m,b]=v.useState(u),[w,g]=v.useState(u);FA(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=cf(_),T=a&&!o?!1:u===w||d.includes(k),C=()=>{if(p.has(k))p.set(k,!0);else return;let N=!0;p.forEach(R=>{R||(N=!1)}),N&&(y==null||y(),g(h.current),a&&(l==null||l()),r&&r())};return c.jsx(u5,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:T?void 0:C,children:_},k)})})},Ir=e=>e;let UA=Ir;const f5={useManualTiming:!1};function h5(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&i.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(a=u,r){s=!0;return}r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,s&&(s=!1,l.process(u))}};return l}const uf=["read","resolveKeyframes","update","preRender","render","postRender"],p5=40;function $A(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=uf.reduce((g,E)=>(g[E]=h5(i),g),{}),{read:o,resolveKeyframes:l,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const g=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(g-s.timestamp,p5),1),s.timestamp=g,s.isProcessing=!0,o.process(s),l.process(s),u.process(s),d.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:uf.reduce((g,E)=>{const y=a[E];return g[E]=(_,k=!1,T=!1)=>(n||m(),y.schedule(_,k,T)),g},{}),cancel:g=>{for(let E=0;Exv[e].some(n=>!!t[n])};function m5(e){for(const t in e)dl[t]={...dl[t],...e[t]}}const g5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Qh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||g5.has(e)}let zA=e=>!Qh(e);function VA(e){e&&(zA=t=>t.startsWith("on")?!Qh(t):e(t))}try{VA(require("@emotion/is-prop-valid").default)}catch{}function y5(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(zA(s)||n===!0&&Qh(s)||!t&&!Qh(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function b5({children:e,isValidProp:t,...n}){t&&VA(t),n={...v.useContext(ku),...n},n.isStatic=em(()=>n.isStatic);const r=v.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return c.jsx(ku.Provider,{value:r,children:e})}function E5(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const nm=v.createContext({});function Nu(e){return typeof e=="string"||Array.isArray(e)}function rm(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Yb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wb=["initial",...Yb];function sm(e){return rm(e.animate)||Wb.some(t=>Nu(e[t]))}function KA(e){return!!(sm(e)||e.variants)}function x5(e,t){if(sm(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Nu(n)?n:void 0,animate:Nu(r)?r:void 0}}return e.inherit!==!1?t:{}}function w5(e){const{initial:t,animate:n}=x5(e,v.useContext(nm));return v.useMemo(()=>({initial:t,animate:n}),[wv(t),wv(n)])}function wv(e){return Array.isArray(e)?e.join(" "):e}const v5=Symbol.for("motionComponentSymbol");function Mo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _5(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Mo(n)&&(n.current=r))},[t])}const qb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),T5="framerAppearId",YA="data-"+qb(T5),{schedule:Gb}=$A(queueMicrotask,!1),WA=v.createContext({});function k5(e,t,n,r,s){var i,a;const{visualElement:o}=v.useContext(nm),l=v.useContext(HA),u=v.useContext(tm),d=v.useContext(ku).reducedMotion,f=v.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=v.useContext(WA);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&N5(f.current,n,s,p);const m=v.useRef(!1);v.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const b=n[YA],w=v.useRef(!!b&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,b))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,b)));return FA(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Gb.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,b)}),w.current=!1))}),h}function N5(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:qA(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||o&&Mo(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function qA(e){if(e)return e.options.allowProjection!==!1?e.projection:qA(e.parent)}function S5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&m5(e);function o(u,d){let f;const h={...v.useContext(ku),...u,layoutId:A5(u)},{isStatic:p}=h,m=w5(u),b=r(u,p);if(!p&&Kb){C5();const w=I5(h);f=w.MeasureLayout,m.visualElement=k5(s,b,h,t,w.ProjectionNode)}return c.jsxs(nm.Provider,{value:m,children:[f&&m.visualElement?c.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,_5(b,m.visualElement,d),b,p,m.visualElement)]})}o.displayName=`motion.${typeof s=="string"?s:`create(${(a=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&a!==void 0?a:""})`}`;const l=v.forwardRef(o);return l[v5]=s,l}function A5({layoutId:e}){const t=v.useContext(Vb).id;return t&&e!==void 0?t+"-"+e:e}function C5(e,t){v.useContext(HA).strict}function I5(e){const{drag:t,layout:n}=dl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const R5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Xb(e){return typeof e!="string"||e.includes("-")?!1:!!(R5.indexOf(e)>-1||/[A-Z]/u.test(e))}function vv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Qb(e,t,n,r){if(typeof t=="function"){const[s,i]=vv(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=vv(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Dy=e=>Array.isArray(e),O5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),L5=e=>Dy(e)?e[e.length-1]||0:e,qn=e=>!!(e&&e.getVelocity);function rh(e){const t=qn(e)?e.get():e;return O5(t)?t.toValue():t}function M5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:D5(r,s,i,e),renderState:t()};return n&&(a.onMount=o=>n({props:r,current:o,...a}),a.onUpdate=o=>n(o)),a}const GA=e=>(t,n)=>{const r=v.useContext(nm),s=v.useContext(tm),i=()=>M5(e,t,r,s);return n?i():em(i)};function D5(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=rh(i[h]);let{initial:a,animate:o}=e;const l=sm(e),u=KA(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?o:a;if(f&&typeof f!="boolean"&&!rm(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),QA=XA("--"),P5=XA("var(--"),Zb=e=>P5(e)?j5.test(e.split("/*")[0].trim()):!1,j5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ZA=(e,t)=>t&&typeof e=="number"?t.transform(e):e,li=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Su={...Pl,transform:e=>li(0,1,e)},df={...Pl,default:1},id=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ei=id("deg"),Is=id("%"),ze=id("px"),B5=id("vh"),F5=id("vw"),_v={...Is,parse:e=>Is.parse(e)/100,transform:e=>Is.transform(e*100)},U5={borderWidth:ze,borderTopWidth:ze,borderRightWidth:ze,borderBottomWidth:ze,borderLeftWidth:ze,borderRadius:ze,radius:ze,borderTopLeftRadius:ze,borderTopRightRadius:ze,borderBottomRightRadius:ze,borderBottomLeftRadius:ze,width:ze,maxWidth:ze,height:ze,maxHeight:ze,top:ze,right:ze,bottom:ze,left:ze,padding:ze,paddingTop:ze,paddingRight:ze,paddingBottom:ze,paddingLeft:ze,margin:ze,marginTop:ze,marginRight:ze,marginBottom:ze,marginLeft:ze,backgroundPositionX:ze,backgroundPositionY:ze},$5={rotate:Ei,rotateX:Ei,rotateY:Ei,rotateZ:Ei,scale:df,scaleX:df,scaleY:df,scaleZ:df,skew:Ei,skewX:Ei,skewY:Ei,distance:ze,translateX:ze,translateY:ze,translateZ:ze,x:ze,y:ze,z:ze,perspective:ze,transformPerspective:ze,opacity:Su,originX:_v,originY:_v,originZ:ze},Tv={...Pl,transform:Math.round},Jb={...U5,...$5,zIndex:Tv,size:ze,fillOpacity:Su,strokeOpacity:Su,numOctaves:Tv},H5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},z5=Dl.length;function V5(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),JA=()=>({...nE(),attrs:{}}),rE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function eC(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const tC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function nC(e,t,n,r){eC(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(tC.has(s)?s:qb(s),t.attrs[s])}const Zh={};function G5(e){Object.assign(Zh,e)}function rC(e,{layout:t,layoutId:n}){return Ja.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Zh[e]||e==="opacity")}function sE(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(qn(s[a])||t.style&&qn(t.style[a])||rC(a,e)||((r=n==null?void 0:n.getValue(a))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[a]=s[a]);return i}function sC(e,t,n){const r=sE(e,t,n);for(const s in e)if(qn(e[s])||qn(t[s])){const i=Dl.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function X5(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Nv=["x","y","width","height","cx","cy","r"],Q5={useVisualState:GA({scrapeMotionValuesFromProps:sC,createRenderState:JA,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const o in s)if(Ja.has(o)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let o=0;o{X5(n,r),Ut.render(()=>{tE(r,s,rE(n.tagName),e.transformTemplate),nC(n,r)})})}})},Z5={useVisualState:GA({scrapeMotionValuesFromProps:sE,createRenderState:nE})};function iC(e,t,n){for(const r in t)!qn(t[r])&&!rC(r,n)&&(e[r]=t[r])}function J5({transformTemplate:e},t){return v.useMemo(()=>{const n=nE();return eE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ej(e,t){const n=e.style||{},r={};return iC(r,n,e),Object.assign(r,J5(e,t)),r}function tj(e,t){const n={},r=ej(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function nj(e,t,n,r){const s=v.useMemo(()=>{const i=JA();return tE(i,t,rE(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};iC(i,e.style,e),s.style={...i,...s.style}}return s}function rj(e=!1){return(n,r,s,{latestValues:i},a)=>{const l=(Xb(n)?nj:tj)(r,i,a,n),u=y5(r,typeof n=="string",e),d=n!==v.Fragment?{...u,...l,ref:s}:{},{children:f}=r,h=v.useMemo(()=>qn(f)?f.get():f,[f]);return v.createElement(n,{...d,children:h})}}function sj(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...Xb(r)?Q5:Z5,preloadedFeatures:e,useRender:rj(s),createVisualElement:t,Component:r};return S5(a)}}function aC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(sh===void 0&&Rs.set(Fn.isProcessing||f5.useManualTiming?Fn.timestamp:performance.now()),sh),set:e=>{sh=e,queueMicrotask(ij)}};function aE(e,t){e.indexOf(t)===-1&&e.push(t)}function oE(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class lE{constructor(){this.subscriptions=[]}add(t){return aE(this.subscriptions,t),()=>oE(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class oj{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Rs.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Rs.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=aj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new lE);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ut.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Rs.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sv);return lC(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Au(e,t){return new oj(e,t)}function lj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Au(n))}function cj(e,t){const n=im(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const o=L5(i[a]);lj(e,a,o)}}function uj(e){return!!(qn(e)&&e.add)}function Py(e,t){const n=e.getValue("willChange");if(uj(n))return n.add(t)}function cC(e){return e.props[YA]}function cE(e){let t;return()=>(t===void 0&&(t=e()),t)}const dj=cE(()=>window.ScrollTimeline!==void 0);class fj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r{if(dj()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class hj extends fj{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Js=e=>e*1e3,ei=e=>e/1e3;function uE(e){return typeof e=="function"}function Av(e,t){e.timeline=t,e.onfinish=null}const dE=e=>Array.isArray(e)&&typeof e[0]=="number",pj={linearEasing:void 0};function mj(e,t){const n=cE(e);return()=>{var r;return(r=pj[t])!==null&&r!==void 0?r:n()}}const Jh=mj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),fl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},uC=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Nc([0,.65,.55,1]),circOut:Nc([.55,0,1,.45]),backIn:Nc([.31,.01,.66,-.59]),backOut:Nc([.33,1.53,.69,.99])};function fC(e,t){if(e)return typeof e=="function"&&Jh()?uC(e,t):dE(e)?Nc(e):Array.isArray(e)?e.map(n=>fC(n,t)||jy.easeOut):jy[e]}const hC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,gj=1e-7,yj=12;function bj(e,t,n,r,s){let i,a,o=0;do a=t+(n-t)/2,i=hC(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>gj&&++obj(i,0,1,e,n);return i=>i===0||i===1?i:hC(s(i),t,r)}const pC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mC=e=>t=>1-e(1-t),gC=ad(.33,1.53,.69,.99),fE=mC(gC),yC=pC(fE),bC=e=>(e*=2)<1?.5*fE(e):.5*(2-Math.pow(2,-10*(e-1))),hE=e=>1-Math.sin(Math.acos(e)),EC=mC(hE),xC=pC(hE),wC=e=>/^0[^.\s]+$/u.test(e);function Ej(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||wC(e):!0}const zc=e=>Math.round(e*1e5)/1e5,pE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xj(e){return e==null}const wj=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mE=(e,t)=>n=>!!(typeof n=="string"&&wj.test(n)&&n.startsWith(e)||t&&!xj(n)&&Object.prototype.hasOwnProperty.call(n,t)),vC=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,o]=r.match(pE);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},vj=e=>li(0,255,e),Ng={...Pl,transform:e=>Math.round(vj(e))},va={test:mE("rgb","red"),parse:vC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ng.transform(e)+", "+Ng.transform(t)+", "+Ng.transform(n)+", "+zc(Su.transform(r))+")"};function _j(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const By={test:mE("#"),parse:_j,transform:va.transform},Do={test:mE("hsl","hue"),parse:vC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Is.transform(zc(t))+", "+Is.transform(zc(n))+", "+zc(Su.transform(r))+")"},Yn={test:e=>va.test(e)||By.test(e)||Do.test(e),parse:e=>va.test(e)?va.parse(e):Do.test(e)?Do.parse(e):By.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?va.transform(e):Do.transform(e)},Tj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kj(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(pE))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Tj))===null||n===void 0?void 0:n.length)||0)>0}const _C="number",TC="color",Nj="var",Sj="var(",Cv="${}",Aj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Cu(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=t.replace(Aj,l=>(Yn.test(l)?(r.color.push(i),s.push(TC),n.push(Yn.parse(l))):l.startsWith(Sj)?(r.var.push(i),s.push(Nj),n.push(l)):(r.number.push(i),s.push(_C),n.push(parseFloat(l))),++i,Cv)).split(Cv);return{values:n,split:o,indexes:r,types:s}}function kC(e){return Cu(e).values}function NC(e){const{split:t,types:n}=Cu(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function Ij(e){const t=kC(e);return NC(e)(t.map(Cj))}const qi={test:kj,parse:kC,createTransformer:NC,getAnimatableNone:Ij},Rj=new Set(["brightness","contrast","saturate","opacity"]);function Oj(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(pE)||[];if(!r)return e;const s=n.replace(r,"");let i=Rj.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Lj=/\b([a-z-]*)\(.*?\)/gu,Fy={...qi,getAnimatableNone:e=>{const t=e.match(Lj);return t?t.map(Oj).join(" "):e}},Mj={...Jb,color:Yn,backgroundColor:Yn,outlineColor:Yn,fill:Yn,stroke:Yn,borderColor:Yn,borderTopColor:Yn,borderRightColor:Yn,borderBottomColor:Yn,borderLeftColor:Yn,filter:Fy,WebkitFilter:Fy},gE=e=>Mj[e];function SC(e,t){let n=gE(e);return n!==Fy&&(n=qi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Dj=new Set(["auto","none","0"]);function Pj(e,t,n){let r=0,s;for(;re===Pl||e===ze,Rv=(e,t)=>parseFloat(e.split(", ")[t]),Ov=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Rv(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Rv(i[1],e):0}},jj=new Set(["x","y","z"]),Bj=Dl.filter(e=>!jj.has(e));function Fj(e){const t=[];return Bj.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const hl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ov(4,13),y:Ov(5,14)};hl.translateX=hl.x;hl.translateY=hl.y;const Ca=new Set;let Uy=!1,$y=!1;function AC(){if($y){const e=Array.from(Ca).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Fj(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var o;(o=r.getValue(i))===null||o===void 0||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}$y=!1,Uy=!1,Ca.forEach(e=>e.complete()),Ca.clear()}function CC(){Ca.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($y=!0)})}function Uj(){CC(),AC()}class yE{constructor(t,n,r,s,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ca.add(this),Uy||(Uy=!0,Ut.read(CC),Ut.resolveKeyframes(AC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$j=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hj(e){const t=$j.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function RC(e,t,n=1){const[r,s]=Hj(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return IC(a)?parseFloat(a):a}return Zb(s)?RC(s,t,n+1):s}const OC=e=>t=>t.test(e),zj={test:e=>e==="auto",parse:e=>e},LC=[Pl,ze,Is,Ei,F5,B5,zj],Lv=e=>LC.find(OC(e));class MC extends yE{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Mv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qi.test(e)||e==="0")&&!e.startsWith("url("));function Vj(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function am(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Yj),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Wj=40;class DC{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Rs.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Wj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Uj(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Rs.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:o,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Kj(t,r,s,i))if(a)this.options.duration=0;else{l&&l(am(t,this.options,n)),o&&o(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Hy=2e4;function PC(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=Hy?1/0:t}const tn=(e,t,n)=>e+(t-e)*n;function Sg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qj({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,a=0;if(!t)s=i=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=Sg(l,o,e+1/3),i=Sg(l,o,e),a=Sg(l,o,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function ep(e,t){return n=>n>0?t:e}const Ag=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Gj=[By,va,Do],Xj=e=>Gj.find(t=>t.test(e));function Dv(e){const t=Xj(e);if(!t)return!1;let n=t.parse(e);return t===Do&&(n=qj(n)),n}const Pv=(e,t)=>{const n=Dv(e),r=Dv(t);if(!n||!r)return ep(e,t);const s={...n};return i=>(s.red=Ag(n.red,r.red,i),s.green=Ag(n.green,r.green,i),s.blue=Ag(n.blue,r.blue,i),s.alpha=tn(n.alpha,r.alpha,i),va.transform(s))},Qj=(e,t)=>n=>t(e(n)),od=(...e)=>e.reduce(Qj),zy=new Set(["none","hidden"]);function Zj(e,t){return zy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Jj(e,t){return n=>tn(e,t,n)}function bE(e){return typeof e=="number"?Jj:typeof e=="string"?Zb(e)?ep:Yn.test(e)?Pv:nB:Array.isArray(e)?jC:typeof e=="object"?Yn.test(e)?Pv:eB:ep}function jC(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>bE(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function tB(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=qi.createTransformer(t),r=Cu(e),s=Cu(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?zy.has(e)&&!s.values.length||zy.has(t)&&!r.values.length?Zj(e,t):od(jC(tB(r,s),s.values),n):ep(e,t)};function BC(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?tn(e,t,n):bE(e)(e,t)}const rB=5;function FC(e,t,n){const r=Math.max(t-rB,0);return lC(n-e(r),t-r)}const sn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Cg=.001;function sB({duration:e=sn.duration,bounce:t=sn.bounce,velocity:n=sn.velocity,mass:r=sn.mass}){let s,i,a=1-t;a=li(sn.minDamping,sn.maxDamping,a),e=li(sn.minDuration,sn.maxDuration,ei(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=Vy(u,a),m=Math.exp(-f);return Cg-h/p*m},i=u=>{const f=u*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(u,2)*e,m=Math.exp(-f),b=Vy(Math.pow(u,2),a);return(-s(u)+Cg>0?-1:1)*((h-p)*m)/b}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Cg+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,l=aB(s,i,o);if(e=Js(e),isNaN(l))return{stiffness:sn.stiffness,damping:sn.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const iB=12;function aB(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function cB(e){let t={velocity:sn.velocity,stiffness:sn.stiffness,damping:sn.damping,mass:sn.mass,isResolvedFromDuration:!1,...e};if(!jv(e,lB)&&jv(e,oB))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*li(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:sn.mass,stiffness:s,damping:i}}else{const n=sB(e);t={...t,...n,mass:sn.mass},t.isResolvedFromDuration=!0}return t}function UC(e=sn.visualDuration,t=sn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=cB({...n,velocity:-ei(n.velocity||0)}),m=h||0,b=u/(2*Math.sqrt(l*d)),w=a-i,g=ei(Math.sqrt(l/d)),E=Math.abs(w)<5;r||(r=E?sn.restSpeed.granular:sn.restSpeed.default),s||(s=E?sn.restDelta.granular:sn.restDelta.default);let y;if(b<1){const k=Vy(g,b);y=T=>{const C=Math.exp(-b*g*T);return a-C*((m+b*g*w)/k*Math.sin(k*T)+w*Math.cos(k*T))}}else if(b===1)y=k=>a-Math.exp(-g*k)*(w+(m+g*w)*k);else{const k=g*Math.sqrt(b*b-1);y=T=>{const C=Math.exp(-b*g*T),N=Math.min(k*T,300);return a-C*((m+b*g*w)*Math.sinh(N)+k*w*Math.cosh(N))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const T=y(k);if(p)o.done=k>=f;else{let C=0;b<1&&(C=k===0?Js(m):FC(y,k,T));const N=Math.abs(C)<=r,R=Math.abs(a-T)<=s;o.done=N&&R}return o.value=o.done?a:T,o},toString:()=>{const k=Math.min(PC(_),Hy),T=uC(C=>_.next(k*C).value,k,30);return k+"ms "+T}};return _}function Bv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=N=>o!==void 0&&Nl,m=N=>o===void 0?l:l===void 0||Math.abs(o-N)-b*Math.exp(-N/r),y=N=>g+E(N),_=N=>{const R=E(N),I=y(N);h.done=Math.abs(R)<=u,h.value=h.done?g:I};let k,T;const C=N=>{p(h.value)&&(k=N,T=UC({keyframes:[h.value,m(h.value)],velocity:FC(y,N,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:N=>{let R=!1;return!T&&k===void 0&&(R=!0,_(N),C(N)),k!==void 0&&N>=k?T.next(N-k):(!R&&_(N),h)}}}const uB=ad(.42,0,1,1),dB=ad(0,0,.58,1),$C=ad(.42,0,.58,1),fB=e=>Array.isArray(e)&&typeof e[0]!="number",hB={linear:Ir,easeIn:uB,easeInOut:$C,easeOut:dB,circIn:hE,circInOut:xC,circOut:EC,backIn:fE,backInOut:yC,backOut:gC,anticipate:bC},Fv=e=>{if(dE(e)){UA(e.length===4);const[t,n,r,s]=e;return ad(t,n,r,s)}else if(typeof e=="string")return hB[e];return e};function pB(e,t,n){const r=[],s=n||BC,i=e.length-1;for(let a=0;at[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=pB(t,r,s),l=o.length,u=d=>{if(a&&d1)for(;fu(li(e[0],e[i-1],d)):u}function gB(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=fl(0,t,r);e.push(tn(n,1,s))}}function yB(e){const t=[0];return gB(t,e.length-1),t}function bB(e,t){return e.map(n=>n*t)}function EB(e,t){return e.map(()=>t||$C).splice(0,e.length-1)}function tp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=fB(r)?r.map(Fv):Fv(r),i={done:!1,value:t[0]},a=bB(n&&n.length===t.length?n:yB(t),e),o=mB(a,t,{ease:Array.isArray(s)?s:EB(t,s)});return{calculatedDuration:e,next:l=>(i.value=o(l),i.done=l>=e,i)}}const xB=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ut.update(t,!0),stop:()=>Wi(t),now:()=>Fn.isProcessing?Fn.timestamp:Rs.now()}},wB={decay:Bv,inertia:Bv,tween:tp,keyframes:tp,spring:UC},vB=e=>e/100;class EE extends DC{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,a=(s==null?void 0:s.KeyframeResolver)||yE,o=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new a(i,o,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=this.options,o=uE(n)?n:wB[n]||tp;let l,u;o!==tp&&typeof t[0]!="number"&&(l=od(vB,BC(t[0],t[1])),t=[0,100]);const d=o({...this.options,keyframes:t});i==="mirror"&&(u=o({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=PC(d));const{calculatedDuration:f}=d,h=f+s,p=h*(r+1)-s;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:N}=this.options;return{done:!0,value:N[N.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:p,repeatType:m,repeatDelay:b,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),E=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let y=this.currentTime,_=i;if(p){const N=Math.min(this.currentTime,d)/f;let R=Math.floor(N),I=N%1;!I&&N>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,b&&(I-=b/f)):m==="mirror"&&(_=a)),y=li(0,1,I)*f}const k=E?{done:!1,value:l[0]}:_.next(y);o&&(k.value=o(k.value));let{done:T}=k;!E&&u!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return C&&s!==void 0&&(k.value=am(l,this.options,s)),w&&w(k.value),C&&this.finish(),k}get duration(){const{resolved:t}=this;return t?ei(t.calculatedDuration):0}get time(){return ei(this.currentTime)}set time(t){t=Js(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ei(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=xB,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const _B=new Set(["opacity","clipPath","filter","transform"]);function TB(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:o="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const d=fC(o,s);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"})}const kB=cE(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),np=10,NB=2e4;function SB(e){return uE(e.type)||e.type==="spring"||!dC(e.ease)}function AB(e,t){const n=new EE({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&ithis.onKeyframesResolved(a,o),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:o,name:l,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof i=="string"&&Jh()&&CB(i)&&(i=HC[i]),SB(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...b}=this.options,w=AB(t,b);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=TB(o.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Av(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(am(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:s,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ei(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ei(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Js(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Ir;const{animation:r}=n;Av(r,t)}return Ir}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:a,times:o}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...p}=this.options,m=new EE({...p,keyframes:r,duration:s,type:i,ease:a,times:o,isGenerator:!0}),b=Js(this.time);u.setWithVelocity(m.sample(b-np).value,m.sample(b).value,np)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:a,type:o}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return kB()&&r&&_B.has(r)&&!l&&!u&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}}const IB={type:"spring",stiffness:500,damping:25,restSpeed:10},RB=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),OB={type:"keyframes",duration:.8},LB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},MB=(e,{keyframes:t})=>t.length>2?OB:Ja.has(e)?e.startsWith("scale")?RB(t[1]):IB:LB;function DB({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:o,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const xE=(e,t,n,r={},s,i)=>a=>{const o=iE(r,e)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Js(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:s};DB(o)||(d={...d,...MB(e,d)}),d.duration&&(d.duration=Js(d.duration)),d.repeatDelay&&(d.repeatDelay=Js(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!i&&t.get()!==void 0){const h=am(d.keyframes,o);if(h!==void 0)return Ut.update(()=>{d.onUpdate(h),d.onComplete()}),new hj([])}return!i&&Uv.supports(d)?new Uv(d):new EE(d)};function PB({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function zC(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const u=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),p=l[f];if(p===void 0||d&&PB(d,f))continue;const m={delay:n,...iE(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const g=cC(e);if(g){const E=window.MotionHandoffAnimation(g,f,Ut);E!==null&&(m.startTime=E,b=!0)}}Py(e,f),h.start(xE(f,h,p,e.shouldReduceMotion&&oC.has(f)?{type:!1}:m,e,b));const w=h.animation;w&&u.push(w)}return o&&Promise.all(u).then(()=>{Ut.update(()=>{o&&cj(e,o)})}),u}function Ky(e,t,n={}){var r;const s=im(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const a=s?()=>Promise.all(zC(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return jB(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function jB(e,t,n=0,r=0,s=1,i){const a=[],o=(e.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(e.variantChildren).sort(BB).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(Ky(u,t,{...i,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function BB(e,t){return e.sortNodePosition(t)}function FB(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Ky(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Ky(e,t,n);else{const s=typeof t=="function"?im(e,t,n.custom):t;r=Promise.all(zC(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const UB=Wb.length;function VC(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?VC(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>FB(e,n,r)))}function VB(e){let t=zB(e),n=$v(),r=!0;const s=l=>(u,d)=>{var f;const h=im(e,d,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...b}=h;u={...u,...b,...m}}return u};function i(l){t=l(e)}function a(l){const{props:u}=e,d=VC(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;wm&&_,R=!1;const I=Array.isArray(y)?y:[y];let M=I.reduce(s(g),{});k===!1&&(M={});const{prevResolvedValues:B={}}=E,Y={...B,...M},P=L=>{N=!0,h.has(L)&&(R=!0,h.delete(L)),E.needsAnimating[L]=!0;const O=e.getValue(L);O&&(O.liveStyle=!1)};for(const L in Y){const O=M[L],j=B[L];if(p.hasOwnProperty(L))continue;let S=!1;Dy(O)&&Dy(j)?S=!aC(O,j):S=O!==j,S?O!=null?P(L):h.add(L):O!==void 0&&h.has(L)?P(L):E.protectedKeys[L]=!0}E.prevProp=y,E.prevResolvedValues=M,E.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(N=!1),N&&(!(T&&C)||R)&&f.push(...I.map(L=>({animation:L,options:{type:g}})))}if(h.size){const w={};h.forEach(g=>{const E=e.getBaseTarget(g),y=e.getValue(g);y&&(y.liveStyle=!0),w[g]=E??null}),f.push({animation:w})}let b=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(f):Promise.resolve()}function o(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=a(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:o,setAnimateFunction:i,getState:()=>n,reset:()=>{n=$v(),r=!0}}}function KB(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!aC(t,e):!1}function oa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $v(){return{animate:oa(!0),whileInView:oa(),whileHover:oa(),whileTap:oa(),whileDrag:oa(),whileFocus:oa(),exit:oa()}}class Ji{constructor(t){this.isMounted=!1,this.node=t}update(){}}class YB extends Ji{constructor(t){super(t),t.animationState||(t.animationState=VB(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();rm(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let WB=0;class qB extends Ji{constructor(){super(...arguments),this.id=WB++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const GB={animation:{Feature:YB},exit:{Feature:qB}},ts={x:!1,y:!1};function KC(){return ts.x||ts.y}function XB(e){return e==="x"||e==="y"?ts[e]?null:(ts[e]=!0,()=>{ts[e]=!1}):ts.x||ts.y?null:(ts.x=ts.y=!0,()=>{ts.x=ts.y=!1})}const wE=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Iu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ld(e){return{point:{x:e.pageX,y:e.pageY}}}const QB=e=>t=>wE(t)&&e(t,ld(t));function Vc(e,t,n,r){return Iu(e,t,QB(n),r)}const Hv=(e,t)=>Math.abs(e-t);function ZB(e,t){const n=Hv(e.x,t.x),r=Hv(e.y,t.y);return Math.sqrt(n**2+r**2)}class YC{constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Rg(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=ZB(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:b}=Fn;this.history.push({...m,timestamp:b});const{onStart:w,onMove:g}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Ig(h,this.transformPagePoint),Ut.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Rg(f.type==="pointercancel"?this.lastMoveEventInfo:Ig(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!wE(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=ld(t),o=Ig(a,this.transformPagePoint),{point:l}=o,{timestamp:u}=Fn;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Rg(o,this.history)),this.removeListeners=od(Vc(this.contextWindow,"pointermove",this.handlePointerMove),Vc(this.contextWindow,"pointerup",this.handlePointerUp),Vc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Wi(this.updatePoint)}}function Ig(e,t){return t?{point:t(e.point)}:e}function zv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Rg({point:e},t){return{point:e,delta:zv(e,WC(t)),offset:zv(e,JB(t)),velocity:e8(t,.1)}}function JB(e){return e[0]}function WC(e){return e[e.length-1]}function e8(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=WC(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Js(t)));)n--;if(!r)return{x:0,y:0};const i=ei(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const qC=1e-4,t8=1-qC,n8=1+qC,GC=.01,r8=0-GC,s8=0+GC;function Lr(e){return e.max-e.min}function i8(e,t,n){return Math.abs(e-t)<=n}function Vv(e,t,n,r=.5){e.origin=r,e.originPoint=tn(t.min,t.max,e.origin),e.scale=Lr(n)/Lr(t),e.translate=tn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=t8&&e.scale<=n8||isNaN(e.scale))&&(e.scale=1),(e.translate>=r8&&e.translate<=s8||isNaN(e.translate))&&(e.translate=0)}function Kc(e,t,n,r){Vv(e.x,t.x,n.x,r?r.originX:void 0),Vv(e.y,t.y,n.y,r?r.originY:void 0)}function Kv(e,t,n){e.min=n.min+t.min,e.max=e.min+Lr(t)}function a8(e,t,n){Kv(e.x,t.x,n.x),Kv(e.y,t.y,n.y)}function Yv(e,t,n){e.min=t.min-n.min,e.max=e.min+Lr(t)}function Yc(e,t,n){Yv(e.x,t.x,n.x),Yv(e.y,t.y,n.y)}function o8(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?tn(n,e,r.max):Math.min(e,n)),e}function Wv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function l8(e,{top:t,left:n,bottom:r,right:s}){return{x:Wv(e.x,n,s),y:Wv(e.y,t,r)}}function qv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=fl(t.min,t.max-r,e.min):r>s&&(n=fl(e.min,e.max-s,t.min)),li(0,1,n)}function d8(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yy=.35;function f8(e=Yy){return e===!1?e=0:e===!0&&(e=Yy),{x:Gv(e,"left","right"),y:Gv(e,"top","bottom")}}function Gv(e,t,n){return{min:Xv(e,t),max:Xv(e,n)}}function Xv(e,t){return typeof e=="number"?e:e[t]||0}const Qv=()=>({translate:0,scale:1,origin:0,originPoint:0}),Po=()=>({x:Qv(),y:Qv()}),Zv=()=>({min:0,max:0}),cn=()=>({x:Zv(),y:Zv()});function Br(e){return[e("x"),e("y")]}function XC({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function h8({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function p8(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Og(e){return e===void 0||e===1}function Wy({scale:e,scaleX:t,scaleY:n}){return!Og(e)||!Og(t)||!Og(n)}function fa(e){return Wy(e)||QC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function QC(e){return Jv(e.x)||Jv(e.y)}function Jv(e){return e&&e!=="0%"}function rp(e,t,n){const r=e-n,s=t*r;return n+s}function e_(e,t,n,r,s){return s!==void 0&&(e=rp(e,s,r)),rp(e,n,r)+t}function qy(e,t=0,n=1,r,s){e.min=e_(e.min,t,n,r,s),e.max=e_(e.max,t,n,r,s)}function ZC(e,{x:t,y:n}){qy(e.x,t.translate,t.scale,t.originPoint),qy(e.y,n.translate,n.scale,n.originPoint)}const t_=.999999999999,n_=1.0000000000001;function m8(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let o=0;ot_&&(t.x=1),t.yt_&&(t.y=1)}function jo(e,t){e.min=e.min+t,e.max=e.max+t}function r_(e,t,n,r,s=.5){const i=tn(e.min,e.max,s);qy(e,t,n,i,r)}function Bo(e,t){r_(e.x,t.x,t.scaleX,t.scale,t.originX),r_(e.y,t.y,t.scaleY,t.scale,t.originY)}function JC(e,t){return XC(p8(e.getBoundingClientRect(),t))}function g8(e,t,n){const r=JC(e,n),{scroll:s}=t;return s&&(jo(r.x,s.offset.x),jo(r.y,s.offset.y)),r}const eI=({current:e})=>e?e.ownerDocument.defaultView:null,y8=new WeakMap;class b8{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=cn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ld(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=XB(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Br(w=>{let g=this.getAxisMotionValue(w).get()||0;if(Is.test(g)){const{projection:E}=this.visualElement;if(E&&E.layout){const y=E.layout.layoutBox[w];y&&(g=Lr(y)*(parseFloat(g)/100))}}this.originPoint[w]=g}),m&&Ut.postRender(()=>m(d,f)),Py(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=E8(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),b&&b(d,f)},o=(d,f)=>this.stop(d,f),l=()=>Br(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new YC(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:eI(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&Ut.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!ff(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=o8(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&Mo(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=l8(s.layoutBox,n):this.constraints=!1,this.elastic=f8(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Br(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=d8(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Mo(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=g8(r,s.root,this.visualElement.getTransformPagePoint());let a=c8(s.layout.layoutBox,i);if(n){const o=n(h8(a));this.hasMutatedConstraints=!!o,o&&(a=XC(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Br(d=>{if(!ff(d,n,this.currentDirection))return;let f=l&&l[d]||{};a&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Py(this.visualElement,t),r.start(xE(t,r,0,n,this.visualElement,!1))}stopAnimation(){Br(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Br(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Br(n=>{const{drag:r}=this.getProps();if(!ff(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[n];i.set(t[n]-tn(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Mo(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Br(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();s[a]=u8({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Br(a=>{if(!ff(a,t,null))return;const o=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];o.set(tn(l,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;y8.set(this.visualElement,this);const t=this.visualElement.current,n=Vc(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Mo(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Ut.read(r);const a=Iu(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Br(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=Yy,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function ff(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function E8(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class x8 extends Ji{constructor(t){super(t),this.removeGroupControls=Ir,this.removeListeners=Ir,this.controls=new b8(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ir}unmount(){this.removeGroupControls(),this.removeListeners()}}const s_=e=>(t,n)=>{e&&Ut.postRender(()=>e(t,n))};class w8 extends Ji{constructor(){super(...arguments),this.removePointerDownListener=Ir}onPointerDown(t){this.session=new YC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eI(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:s_(t),onStart:s_(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&Ut.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Vc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ih={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ze.test(e))e=parseFloat(e);else return e;const n=i_(e,t.target.x),r=i_(e,t.target.y);return`${n}% ${r}%`}},v8={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=qi.parse(e);if(s.length>5)return r;const i=qi.createTransformer(e),a=typeof s[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;s[0+a]/=o,s[1+a]/=l;const u=tn(o,l,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class _8 extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;G5(T8),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),ih.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,s||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||Ut.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Gb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function tI(e){const[t,n]=BA(),r=v.useContext(Vb);return c.jsx(_8,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(WA),isPresent:t,safeToRemove:n})}const T8={borderRadius:{...lc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lc,borderTopRightRadius:lc,borderBottomLeftRadius:lc,borderBottomRightRadius:lc,boxShadow:v8};function k8(e,t,n){const r=qn(e)?e:Au(e);return r.start(xE("",r,t,n)),r.animation}function N8(e){return e instanceof SVGElement&&e.tagName!=="svg"}const S8=(e,t)=>e.depth-t.depth;class A8{constructor(){this.children=[],this.isDirty=!1}add(t){aE(this.children,t),this.isDirty=!0}remove(t){oE(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(S8),this.isDirty=!1,this.children.forEach(t)}}function C8(e,t){const n=Rs.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Wi(r),e(i-t))};return Ut.read(r,!0),()=>Wi(r)}const nI=["TopLeft","TopRight","BottomLeft","BottomRight"],I8=nI.length,a_=e=>typeof e=="string"?parseFloat(e):e,o_=e=>typeof e=="number"||ze.test(e);function R8(e,t,n,r,s,i){s?(e.opacity=tn(0,n.opacity!==void 0?n.opacity:1,O8(r)),e.opacityExit=tn(t.opacity!==void 0?t.opacity:1,0,L8(r))):i&&(e.opacity=tn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(fl(e,t,r))}function c_(e,t){e.min=t.min,e.max=t.max}function jr(e,t){c_(e.x,t.x),c_(e.y,t.y)}function u_(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function d_(e,t,n,r,s){return e-=t,e=rp(e,1/n,r),s!==void 0&&(e=rp(e,1/s,r)),e}function M8(e,t=0,n=1,r=.5,s,i=e,a=e){if(Is.test(t)&&(t=parseFloat(t),t=tn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=tn(i.min,i.max,r);e===i&&(o-=t),e.min=d_(e.min,t,n,o,s),e.max=d_(e.max,t,n,o,s)}function f_(e,t,[n,r,s],i,a){M8(e,t[n],t[r],t[s],t.scale,i,a)}const D8=["x","scaleX","originX"],P8=["y","scaleY","originY"];function h_(e,t,n,r){f_(e.x,t,D8,n?n.x:void 0,r?r.x:void 0),f_(e.y,t,P8,n?n.y:void 0,r?r.y:void 0)}function p_(e){return e.translate===0&&e.scale===1}function sI(e){return p_(e.x)&&p_(e.y)}function m_(e,t){return e.min===t.min&&e.max===t.max}function j8(e,t){return m_(e.x,t.x)&&m_(e.y,t.y)}function g_(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function iI(e,t){return g_(e.x,t.x)&&g_(e.y,t.y)}function y_(e){return Lr(e.x)/Lr(e.y)}function b_(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class B8{constructor(){this.members=[]}add(t){aE(this.members,t),t.scheduleRender()}remove(t){if(oE(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function F8(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const ha={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Sc=typeof window<"u"&&window.MotionDebug!==void 0,Lg=["","X","Y","Z"],U8={visibility:"hidden"},E_=1e3;let $8=0;function Mg(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function aI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=cC(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ut,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&aI(r)}function oI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},o=t==null?void 0:t()){this.id=$8++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Sc&&(ha.totalNodes=ha.resolvedTargetDeltas=ha.recalculatedProjection=0),this.nodes.forEach(V8),this.nodes.forEach(G8),this.nodes.forEach(X8),this.nodes.forEach(K8),Sc&&window.MotionDebug.record(ha)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=C8(h,250),ih.hasAnimatedSinceResize&&(ih.hasAnimatedSinceResize=!1,this.nodes.forEach(w_))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||t9,{onLayoutAnimationStart:w,onLayoutAnimationComplete:g}=d.getProps(),E=!this.targetLayout||!iI(this.targetLayout,m)||p,y=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||h&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,y);const _={...iE(b,"layout"),onPlay:w,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||w_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Wi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Q8),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&aI(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const k=_/1e3;v_(f.x,a.x,k),v_(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),J8(this.relativeTarget,this.relativeTargetOrigin,h,k),y&&j8(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=cn()),jr(y,this.relativeTarget)),b&&(this.animationValues=d,R8(d,u,this.latestValues,k,E,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Wi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ut.update(()=>{ih.hasAnimatedSinceResize=!0,this.currentAnimation=k8(0,E_,{...a,onUpdate:o=>{this.mixTargetDelta(o),a.onUpdate&&a.onUpdate(o)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(E_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:d}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&lI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||cn();const f=Lr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const h=Lr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+h}jr(o,l),Bo(o,d),Kc(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new B8),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&Mg("z",a,u,this.animationValues);for(let d=0;d{var o;return(o=a.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(x_),this.root.sharedNodes.clear()}}}function H8(e){e.updateLayout()}function z8(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;i==="size"?Br(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Lr(h);h.min=r[f].min,h.max=h.min+p}):lI(i,n.layoutBox,r)&&Br(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Lr(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=Po();Kc(o,r,n.layoutBox);const l=Po();a?Kc(l,e.applyTransform(s,!0),n.measuredBox):Kc(l,r,n.layoutBox);const u=!sI(o);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=cn();Yc(m,n.layoutBox,h.layoutBox);const b=cn();Yc(b,r,p.layoutBox),iI(m,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function V8(e){Sc&&ha.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function K8(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Y8(e){e.clearSnapshot()}function x_(e){e.clearMeasurements()}function W8(e){e.isLayoutDirty=!1}function q8(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function w_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function G8(e){e.resolveTargetDelta()}function X8(e){e.calcProjection()}function Q8(e){e.resetSkewAndRotation()}function Z8(e){e.removeLeadSnapshot()}function v_(e,t,n){e.translate=tn(t.translate,0,n),e.scale=tn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function __(e,t,n,r){e.min=tn(t.min,n.min,r),e.max=tn(t.max,n.max,r)}function J8(e,t,n,r){__(e.x,t.x,n.x,r),__(e.y,t.y,n.y,r)}function e9(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const t9={duration:.45,ease:[.4,0,.1,1]},T_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),k_=T_("applewebkit/")&&!T_("chrome/")?Math.round:Ir;function N_(e){e.min=k_(e.min),e.max=k_(e.max)}function n9(e){N_(e.x),N_(e.y)}function lI(e,t,n){return e==="position"||e==="preserve-aspect"&&!i8(y_(t),y_(n),.2)}function r9(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const s9=oI({attachResizeListener:(e,t)=>Iu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Dg={current:void 0},cI=oI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Dg.current){const e=new s9({});e.mount(window),e.setOptions({layoutScroll:!0}),Dg.current=e}return Dg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),i9={pan:{Feature:w8},drag:{Feature:x8,ProjectionNode:cI,MeasureLayout:tI}};function a9(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const i=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function uI(e,t){const n=a9(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function S_(e){return t=>{t.pointerType==="touch"||KC()||e(t)}}function o9(e,t,n={}){const[r,s,i]=uI(e,n),a=S_(o=>{const{target:l}=o,u=t(o);if(typeof u!="function"||!l)return;const d=S_(f=>{u(f),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,s)});return r.forEach(o=>{o.addEventListener("pointerenter",a,s)}),i}function A_(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Ut.postRender(()=>i(t,ld(t)))}class l9 extends Ji{mount(){const{current:t}=this.node;t&&(this.unmount=o9(t,n=>(A_(this.node,n,"Start"),r=>A_(this.node,r,"End"))))}unmount(){}}class c9 extends Ji{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=od(Iu(this.node.current,"focus",()=>this.onFocus()),Iu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dI=(e,t)=>t?e===t?!0:dI(e,t.parentElement):!1,u9=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function d9(e){return u9.has(e.tagName)||e.tabIndex!==-1}const Ac=new WeakSet;function C_(e){return t=>{t.key==="Enter"&&e(t)}}function Pg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const f9=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=C_(()=>{if(Ac.has(n))return;Pg(n,"down");const s=C_(()=>{Pg(n,"up")}),i=()=>Pg(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function I_(e){return wE(e)&&!KC()}function h9(e,t,n={}){const[r,s,i]=uI(e,n),a=o=>{const l=o.currentTarget;if(!I_(o)||Ac.has(l))return;Ac.add(l);const u=t(o),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!I_(p)||!Ac.has(l))&&(Ac.delete(l),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||dI(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(o=>{!d9(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,s),o.addEventListener("focus",u=>f9(u,s),s)}),i}function R_(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Ut.postRender(()=>i(t,ld(t)))}class p9 extends Ji{mount(){const{current:t}=this.node;t&&(this.unmount=h9(t,n=>(R_(this.node,n,"Start"),(r,{success:s})=>R_(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Gy=new WeakMap,jg=new WeakMap,m9=e=>{const t=Gy.get(e.target);t&&t(e)},g9=e=>{e.forEach(m9)};function y9({root:e,...t}){const n=e||document;jg.has(n)||jg.set(n,{});const r=jg.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(g9,{root:e,...t})),r[s]}function b9(e,t,n){const r=y9(t);return Gy.set(e,n),r.observe(e),()=>{Gy.delete(e),r.unobserve(e)}}const E9={some:0,all:1};class x9 extends Ji{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:E9[s]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(l)};return b9(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(w9(t,n))&&this.startObserver()}unmount(){}}function w9({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const v9={inView:{Feature:x9},tap:{Feature:p9},focus:{Feature:c9},hover:{Feature:l9}},_9={layout:{ProjectionNode:cI,MeasureLayout:tI}},Xy={current:null},fI={current:!1};function T9(){if(fI.current=!0,!!Kb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xy.current=e.matches;e.addListener(t),t()}else Xy.current=!1}const k9=[...LC,Yn,qi],N9=e=>k9.find(OC(e)),O_=new WeakMap;function S9(e,t,n){for(const r in t){const s=t[r],i=n[r];if(qn(s))e.addValue(r,s);else if(qn(i))e.addValue(r,Au(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Au(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const L_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class A9{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Rs.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),fI.current||T9(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Xy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){O_.delete(this.current),this.projection&&this.projection.unmount(),Wi(this.notifyUpdate),Wi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ja.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Ut.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in dl){const n=dl[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):cn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Au(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(IC(s)||wC(s))?s=parseFloat(s):!N9(s)&&qi.test(n)&&(s=SC(t,n)),this.setBaseTarget(t,qn(s)?s.get():s)),qn(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const a=Qb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(s=a[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!qn(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new lE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class hI extends A9{constructor(){super(...arguments),this.KeyframeResolver=MC}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;qn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function C9(e){return window.getComputedStyle(e)}class I9 extends hI{constructor(){super(...arguments),this.type="html",this.renderInstance=eC}readValueFromInstance(t,n){if(Ja.has(n)){const r=gE(n);return r&&r.default||0}else{const r=C9(t),s=(QA(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return JC(t,n)}build(t,n,r){eE(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return sE(t,n,r)}}class R9 extends hI{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=cn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ja.has(n)){const r=gE(n);return r&&r.default||0}return n=tC.has(n)?n:qb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return sC(t,n,r)}build(t,n,r){tE(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){nC(t,n,r,s)}mount(t){this.isSVGTag=rE(t.tagName),super.mount(t)}}const O9=(e,t)=>Xb(e)?new R9(t):new I9(t,{allowProjection:e!==v.Fragment}),L9=sj({...GB,...v9,...i9,..._9},O9),Wt=E5(L9);function vn(){return vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?v.useEffect:v.useLayoutEffect;function go(e,t,n){var r=v.useRef(t);r.current=t,v.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var M9=["container"];function D9(e){var t=e.container,n=t===void 0?document.body:t,r=om(e,M9);return Ua.createPortal(et.createElement("div",vn({},r)),n)}function P9(e){return et.createElement("svg",vn({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function j9(e){return et.createElement("svg",vn({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function B9(e){return et.createElement("svg",vn({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function F9(){return v.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function D_(e){var t=e.touches[0],n=t.clientX,r=t.clientY;if(e.touches.length>=2){var s=e.touches[1],i=s.clientX,a=s.clientY;return[(n+i)/2,(r+a)/2,Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2))]}return[n,r,0]}var Ti=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,o=e;return i<=r?(s=1,o=0):e>0&&a-e<=0?(s=2,o=a):e<0&&a+e<=0&&(s=3,o=-a),[s,o]};function Bg(e,t,n,r,s,i,a,o,l,u){a===void 0&&(a=innerWidth/2),o===void 0&&(o=innerHeight/2),l===void 0&&(l=0),u===void 0&&(u=0);var d=Ti(e,i,n,innerWidth)[0],f=Ti(t,i,r,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-i/s*(a-(h+e))-h+(r/n>=3&&n*i===innerWidth?0:d?l/2:l),y:o-i/s*(o-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:o}}function Jy(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function Fg(e,t,n){var r=Jy(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,o=s,l=i,u=e/t*i,d=t/e*s;return e=i?o=u:e>=s&&ts/i?l=d:t/e>=3&&!r[2]?a=((l=d)-i)/2:o=u,{width:o,height:l,x:0,y:a,pause:!0}}function pf(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,o=v.useRef(e);o.current=e;var l=v.useRef(0),u=v.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=v.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){l.current=p,d(),o.current.apply(null,h)}var b=l.current,w=p-b;if(b===0&&(r&&m(),l.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){l=requestAnimationFrame(u)}}var $9={T:0,L:0,W:0,H:0,FIT:void 0},mI=function(){var e=v.useRef(!1);return v.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},H9=["className"];function z9(e){var t=e.className,n=t===void 0?"":t,r=om(e,H9);return et.createElement("div",vn({className:"PhotoView__Spinner "+n},r),et.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},et.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),et.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var V9=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function K9(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,o=e.brokenElement,l=om(e,V9),u=mI();return t&&!r?et.createElement(et.Fragment,null,et.createElement("img",vn({className:"PhotoView__Photo"+(s?" "+s:""),src:t,onLoad:function(d){var f=d.target;u.current&&i({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&i({broken:!0})},draggable:!1,alt:""},l)),!n&&(a?et.createElement("span",{className:"PhotoView__icon"},a):et.createElement(z9,{className:"PhotoView__icon"}))):o?et.createElement("span",{className:"PhotoView__icon"},typeof o=="function"?o({src:t}):o):null}var Y9={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function W9(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,o=a===void 0?0:a,l=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,b=e.loadingElement,w=e.brokenElement,g=e.onPhotoTap,E=e.onMaskTap,y=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,T=e.isActive,C=e.expose,N=sp(Y9),R=N[0],I=N[1],M=v.useRef(0),B=mI(),Y=R.naturalWidth,P=Y===void 0?i:Y,U=R.naturalHeight,A=U===void 0?o:U,L=R.width,O=L===void 0?i:L,j=R.height,S=j===void 0?o:j,H=R.loaded,V=H===void 0?!n:H,D=R.broken,ne=R.x,J=R.y,re=R.touched,de=R.stopRaf,G=R.maskTouched,W=R.rotate,ae=R.scale,he=R.CX,Z=R.CY,ce=R.lastX,Ce=R.lastY,Ee=R.lastCX,ge=R.lastCY,Me=R.lastScale,ve=R.touchTime,$e=R.touchLength,Re=R.pause,oe=R.reach,_t=Ia({onScale:function(ue){return we(hf(ue))},onRotate:function(ue){W!==ue&&(C({rotate:ue}),I(vn({rotate:ue},Fg(P,A,ue))))}});function we(ue,Le,Qe){ae!==ue&&(C({scale:ue}),I(vn({scale:ue},Bg(ne,J,O,S,ae,ue,Le,Qe),ue<=1&&{x:0,y:0})))}var Tt=pf(function(ue,Le,Qe){if(Qe===void 0&&(Qe=0),(re||G)&&T){var on=Jy(W,O,S),ln=on[0],ie=on[1];if(Qe===0&&M.current===0){var _e=Math.abs(ue-he)<=20,ye=Math.abs(Le-Z)<=20;if(_e&&ye)return void I({lastCX:ue,lastCY:Le});M.current=_e?Le>Z?3:2:1}var Pe,He=ue-Ee,qe=Le-ge;if(Qe===0){var yt=Ti(He+ce,ae,ln,innerWidth)[0],Rt=Ti(qe+Ce,ae,ie,innerHeight);Pe=function(mn,gn,Ht,kn){return gn&&mn===1||kn==="x"?"x":Ht&&mn>1||kn==="y"?"y":void 0}(M.current,yt,Rt[0],oe),Pe!==void 0&&y(Pe,ue,Le,ae)}if(Pe==="x"||G)return void I({reach:"x"});var Ot=hf(ae+(Qe-$e)/100/2*ae,P/O,.2);C({scale:Ot}),I(vn({touchLength:Qe,reach:Pe,scale:Ot},Bg(ne,J,O,S,ae,Ot,ue,Le,He,qe)))}},{maxWait:8});function ct(ue){return!de&&!re&&(B.current&&I(vn({},ue,{pause:u})),B.current)}var K,X,le,ke,Oe,ut,We,ot,Xt=(Oe=function(ue){return ct({x:ue})},ut=function(ue){return ct({y:ue})},We=function(ue){return B.current&&(C({scale:ue}),I({scale:ue})),!re&&B.current},ot=Ia({X:function(ue){return Oe(ue)},Y:function(ue){return ut(ue)},S:function(ue){return We(ue)}}),function(ue,Le,Qe,on,ln,ie,_e,ye,Pe,He,qe){var yt=Jy(He,ln,ie),Rt=yt[0],Ot=yt[1],mn=Ti(ue,ye,Rt,innerWidth),gn=mn[0],Ht=mn[1],kn=Ti(Le,ye,Ot,innerHeight),Jn=kn[0],wr=kn[1],Dn=Date.now()-qe;if(Dn>=200||ye!==_e||Math.abs(Pe-_e)>1){var Hn=Bg(ue,Le,ln,ie,_e,ye),er=Hn.x,vr=Hn.y,zt=gn?Ht:er!==ue?er:null,Nn=Jn?wr:vr!==Le?vr:null;return zt!==null&&ya(ue,zt,ot.X),Nn!==null&&ya(Le,Nn,ot.Y),void(ye!==_e&&ya(_e,ye,ot.S))}var Pn=(ue-Qe)/Dn,tr=(Le-on)/Dn,zn=Math.sqrt(Math.pow(Pn,2)+Math.pow(tr,2)),Sn=!1,st=!1;(function(An,jt){var Qt,Cn=An,jn=0,xn=0,te=function(je){Qt||(Qt=je);var Et=je-Qt,ht=Math.sign(An),Zt=-.001*ht,xt=Math.sign(-Cn)*Math.pow(Cn,2)*2e-4,In=Cn*Et+(Zt+xt)*Math.pow(Et,2)/2;jn+=In,Qt=je,ht*(Cn+=(Zt+xt)*Et)<=0?Ie():jt(jn)?Ne():Ie()};function Ne(){xn=requestAnimationFrame(te)}function Ie(){cancelAnimationFrame(xn)}Ne()})(zn,function(An){var jt=ue+An*(Pn/zn),Qt=Le+An*(tr/zn),Cn=Ti(jt,_e,Rt,innerWidth),jn=Cn[0],xn=Cn[1],te=Ti(Qt,_e,Ot,innerHeight),Ne=te[0],Ie=te[1];if(jn&&!Sn&&(Sn=!0,gn?ya(jt,xn,ot.X):P_(xn,jt+(jt-xn),ot.X)),Ne&&!st&&(st=!0,Jn?ya(Qt,Ie,ot.Y):P_(Ie,Qt+(Qt-Ie),ot.Y)),Sn&&st)return!1;var je=Sn||ot.X(xn),Et=st||ot.Y(Ie);return je&&Et})}),It=(K=g,X=function(ue,Le){oe||we(ae!==1?1:Math.max(2,P/O),ue,Le)},le=v.useRef(0),ke=pf(function(){le.current=0,K.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var ue=[].slice.call(arguments);le.current+=1,ke.apply(void 0,ue),le.current>=2&&(ke.cancel(),le.current=0,X.apply(void 0,ue))});function Ge(ue,Le){if(M.current=0,(re||G)&&T){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Qe=hf(ae,P/O);if(Xt(ne,J,ce,Ce,O,S,ae,Qe,Me,W,ve),_(ue,Le),he===ue&&Z===Le){if(re)return void It(ue,Le);G&&E(ue,Le)}}}function bt(ue,Le,Qe){Qe===void 0&&(Qe=0),I({touched:!0,CX:ue,CY:Le,lastCX:ue,lastCY:Le,lastX:ne,lastY:J,lastScale:ae,touchLength:Qe,touchTime:Date.now()})}function $t(ue){I({maskTouched:!0,CX:ue.clientX,CY:ue.clientY,lastX:ne,lastY:J})}go(Hs?void 0:"mousemove",function(ue){ue.preventDefault(),Tt(ue.clientX,ue.clientY)}),go(Hs?void 0:"mouseup",function(ue){Ge(ue.clientX,ue.clientY)}),go(Hs?"touchmove":void 0,function(ue){ue.preventDefault();var Le=D_(ue);Tt.apply(void 0,Le)},{passive:!1}),go(Hs?"touchend":void 0,function(ue){var Le=ue.changedTouches[0];Ge(Le.clientX,Le.clientY)},{passive:!1}),go("resize",pf(function(){V&&!re&&(I(Fg(P,A,W)),k())},{maxWait:8})),Zy(function(){T&&C(vn({scale:ae,rotate:W},_t))},[T]);var Tn=function(ue,Le,Qe,on,ln,ie,_e,ye,Pe,He){var qe=function(er,vr,zt,Nn,Pn){var tr=v.useRef(!1),zn=sp({lead:!0,scale:zt}),Sn=zn[0],st=Sn.lead,An=Sn.scale,jt=zn[1],Qt=pf(function(Cn){try{return Pn(!0),jt({lead:!1,scale:Cn}),Promise.resolve()}catch(jn){return Promise.reject(jn)}},{wait:Nn});return Zy(function(){tr.current?(Pn(!1),jt({lead:!0}),Qt(zt)):tr.current=!0},[zt]),st?[er*An,vr*An,zt/An]:[er*zt,vr*zt,1]}(ie,_e,ye,Pe,He),yt=qe[0],Rt=qe[1],Ot=qe[2],mn=function(er,vr,zt,Nn,Pn){var tr=v.useState($9),zn=tr[0],Sn=tr[1],st=v.useState(0),An=st[0],jt=st[1],Qt=v.useRef(),Cn=Ia({OK:function(){return er&&jt(4)}});function jn(xn){Pn(!1),jt(xn)}return v.useEffect(function(){if(Qt.current||(Qt.current=Date.now()),zt){if(function(xn,te){var Ne=xn&&xn.current;if(Ne&&Ne.nodeType===1){var Ie=Ne.getBoundingClientRect();te({T:Ie.top,L:Ie.left,W:Ie.width,H:Ie.height,FIT:Ne.tagName==="IMG"?getComputedStyle(Ne).objectFit:void 0})}}(vr,Sn),er)return Date.now()-Qt.current<250?(jt(1),requestAnimationFrame(function(){jt(2),requestAnimationFrame(function(){return jn(3)})}),void setTimeout(Cn.OK,Nn)):void jt(4);jn(5)}},[er,zt]),[An,zn]}(ue,Le,Qe,Pe,He),gn=mn[0],Ht=mn[1],kn=Ht.W,Jn=Ht.FIT,wr=innerWidth/2,Dn=innerHeight/2,Hn=gn<3||gn>4;return[Hn?kn?Ht.L:wr:on+(wr-ie*ye/2),Hn?kn?Ht.T:Dn:ln+(Dn-_e*ye/2),yt,Hn&&Jn?yt*(Ht.H/kn):Rt,gn===0?Ot:Hn?kn/(ie*ye)||.01:Ot,Hn?Jn?1:0:1,gn,Jn]}(u,l,V,ne,J,O,S,ae,d,function(ue){return I({pause:ue})}),Ue=Tn[4],rt=Tn[6],tt="transform "+d+"ms "+f,gt={className:p,onMouseDown:Hs?void 0:function(ue){ue.stopPropagation(),ue.button===0&&bt(ue.clientX,ue.clientY,0)},onTouchStart:Hs?function(ue){ue.stopPropagation(),bt.apply(void 0,D_(ue))}:void 0,onWheel:function(ue){if(!oe){var Le=hf(ae-ue.deltaY/100/2,P/O);I({stopRaf:!0}),we(Le,ue.clientX,ue.clientY)}},style:{width:Tn[2]+"px",height:Tn[3]+"px",opacity:Tn[5],objectFit:rt===4?void 0:Tn[7],transform:W?"rotate("+W+"deg)":void 0,transition:rt>2?tt+", opacity "+d+"ms ease, height "+(rt<4?d/2:rt>4?d:0)+"ms "+f:void 0}};return et.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Hs&&T?$t:void 0,onTouchStart:Hs&&T?function(ue){return $t(ue.touches[0])}:void 0},et.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Ue+", 0, 0, "+Ue+", "+Tn[0]+", "+Tn[1]+")",transition:re||Re?void 0:tt,willChange:T?"transform":void 0}},n?et.createElement(K9,vn({src:n,loaded:V,broken:D},gt,{onPhotoLoad:function(ue){I(vn({},ue,ue.loaded&&Fg(ue.naturalWidth||0,ue.naturalHeight||0,W)))},loadingElement:b,brokenElement:w})):r&&r({attrs:gt,scale:Ue,rotate:W})))}var j_={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function q9(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,o=a===void 0||a,l=e.maskOpacity,u=l===void 0?1:l,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,b=e.toolbarRender,w=e.className,g=e.maskClassName,E=e.photoClassName,y=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,T=e.images,C=e.index,N=C===void 0?0:C,R=e.onIndexChange,I=e.visible,M=e.onClose,B=e.afterClose,Y=e.portalContainer,P=sp(j_),U=P[0],A=P[1],L=v.useState(0),O=L[0],j=L[1],S=U.x,H=U.touched,V=U.pause,D=U.lastCX,ne=U.lastCY,J=U.bg,re=J===void 0?u:J,de=U.lastBg,G=U.overlay,W=U.minimal,ae=U.scale,he=U.rotate,Z=U.onScale,ce=U.onRotate,Ce=e.hasOwnProperty("index"),Ee=Ce?N:O,ge=Ce?R:j,Me=v.useRef(Ee),ve=T.length,$e=T[Ee],Re=typeof n=="boolean"?n:ve>n,oe=function(Ue,rt){var tt=v.useReducer(function(Qe){return!Qe},!1)[1],gt=v.useRef(0),ue=function(Qe){var on=v.useRef(Qe);function ln(ie){on.current=ie}return v.useMemo(function(){(function(ie){Ue?(ie(Ue),gt.current=1):gt.current=2})(ln)},[Qe]),[on.current,ln]}(Ue),Le=ue[1];return[ue[0],gt.current,function(){tt(),gt.current===2&&(Le(!1),rt&&rt()),gt.current=0}]}(I,B),_t=oe[0],we=oe[1],Tt=oe[2];Zy(function(){if(_t)return A({pause:!0,x:Ee*-(innerWidth+co)}),void(Me.current=Ee);A(j_)},[_t]);var ct=Ia({close:function(Ue){ce&&ce(0),A({overlay:!0,lastBg:re}),M(Ue)},changeIndex:function(Ue,rt){rt===void 0&&(rt=!1);var tt=Re?Me.current+(Ue-Ee):Ue,gt=ve-1,ue=Qy(tt,0,gt),Le=Re?tt:ue,Qe=innerWidth+co;A({touched:!1,lastCX:void 0,lastCY:void 0,x:-Qe*Le,pause:rt}),Me.current=Le,ge&&ge(Re?Ue<0?gt:Ue>gt?0:Ue:ue)}}),K=ct.close,X=ct.changeIndex;function le(Ue){return Ue?K():A({overlay:!G})}function ke(){A({x:-(innerWidth+co)*Ee,lastCX:void 0,lastCY:void 0,pause:!0}),Me.current=Ee}function Oe(Ue,rt,tt,gt){Ue==="x"?function(ue){if(D!==void 0){var Le=ue-D,Qe=Le;!Re&&(Ee===0&&Le>0||Ee===ve-1&&Le<0)&&(Qe=Le/2),A({touched:!0,lastCX:D,x:-(innerWidth+co)*Me.current+Qe,pause:!1})}else A({touched:!0,lastCX:ue,x:S,pause:!1})}(rt):Ue==="y"&&function(ue,Le){if(ne!==void 0){var Qe=u===null?null:Qy(u,.01,u-Math.abs(ue-ne)/100/4);A({touched:!0,lastCY:ne,bg:Le===1?Qe:u,minimal:Le===1})}else A({touched:!0,lastCY:ue,bg:re,minimal:!0})}(tt,gt)}function ut(Ue,rt){var tt=Ue-(D??Ue),gt=rt-(ne??rt),ue=!1;if(tt<-40)X(Ee+1);else if(tt>40)X(Ee-1);else{var Le=-(innerWidth+co)*Me.current;Math.abs(gt)>100&&W&&f&&(ue=!0,K()),A({touched:!1,x:Le,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!ue||G})}}go("keydown",function(Ue){if(I)switch(Ue.key){case"ArrowLeft":X(Ee-1,!0);break;case"ArrowRight":X(Ee+1,!0);break;case"Escape":K()}});var We=function(Ue,rt,tt){return v.useMemo(function(){var gt=Ue.length;return tt?Ue.concat(Ue).concat(Ue).slice(gt+rt-1,gt+rt+2):Ue.slice(Math.max(rt-1,0),Math.min(rt+2,gt+1))},[Ue,rt,tt])}(T,Ee,Re);if(!_t)return null;var ot=G&&!we,Xt=I?re:de,It=Z&&ce&&{images:T,index:Ee,visible:I,onClose:K,onIndexChange:X,overlayVisible:ot,overlay:$e&&$e.overlay,scale:ae,rotate:he,onScale:Z,onRotate:ce},Ge=r?r(we):400,bt=s?s(we):M_,$t=r?r(3):600,Tn=s?s(3):M_;return et.createElement(D9,{className:"PhotoView-Portal"+(ot?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(Ue){return Ue.stopPropagation()},container:Y},I&&et.createElement(F9,null),et.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(we===1?" PhotoView-Slider__fadeIn":we===2?" PhotoView-Slider__fadeOut":""),style:{background:Xt?"rgba(0, 0, 0, "+Xt+")":void 0,transitionTimingFunction:bt,transitionDuration:(H?0:Ge)+"ms",animationDuration:Ge+"ms"},onAnimationEnd:Tt}),p&&et.createElement("div",{className:"PhotoView-Slider__BannerWrap"},et.createElement("div",{className:"PhotoView-Slider__Counter"},Ee+1," / ",ve),et.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&It&&b(It),et.createElement(P9,{className:"PhotoView-Slider__toolbarIcon",onClick:K}))),We.map(function(Ue,rt){var tt=Re||Ee!==0?Me.current-1+rt:Ee+rt;return et.createElement(W9,{key:Re?Ue.key+"/"+Ue.src+"/"+tt:Ue.key,item:Ue,speed:Ge,easing:bt,visible:I,onReachMove:Oe,onReachUp:ut,onPhotoTap:function(){return le(i)},onMaskTap:function(){return le(o)},wrapClassName:y,className:E,style:{left:(innerWidth+co)*tt+"px",transform:"translate3d("+S+"px, 0px, 0)",transition:H||V?void 0:"transform "+$t+"ms "+Tn},loadingElement:_,brokenElement:k,onPhotoResize:ke,isActive:Me.current===tt,expose:A})}),!Hs&&p&&et.createElement(et.Fragment,null,(Re||Ee!==0)&&et.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return X(Ee-1,!0)}},et.createElement(j9,null)),(Re||Ee+1-1){var g=u.slice();return g.splice(w,1,b),void o({images:g})}o(function(E){return{images:E.images.concat(b)}})},remove:function(b){o(function(w){var g=w.images.filter(function(E){return E.key!==b});return{images:g,index:Math.min(g.length-1,f)}})},show:function(b){var w=u.findIndex(function(g){return g.key===b});o({visible:!0,index:w}),r&&r(!0,w,a)}}),p=Ia({close:function(){o({visible:!1}),r&&r(!1,f,a)},changeIndex:function(b){o({index:b}),n&&n(b,a)}}),m=v.useMemo(function(){return vn({},a,h)},[a,h]);return et.createElement(pI.Provider,{value:m},t,et.createElement(q9,vn({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var gI=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,o=e.height,l=e.triggers,u=l===void 0?["onClick"]:l,d=e.children,f=v.useContext(pI),h=(t=function(){return f.nextId()},(n=v.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=v.useRef(null);v.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),v.useEffect(function(){return function(){f.remove(h)}},[]);var m=Ia({render:function(w){return s&&s(w)},show:function(w,g){f.show(h),function(E,y){if(d){var _=d.props[E];_&&_(y)}}(w,g)}}),b=v.useMemo(function(){var w={};return u.forEach(function(g){w[g]=m.show.bind(null,g)}),w},[]);return v.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:o})},[r]),d?v.Children.only(v.cloneElement(d,vn({},b,{ref:p}))):null};/** + `),()=>{document.head.removeChild(d)}},[t]),c.jsx(u5,{isPresent:t,childRef:r,sizeRef:s,children:v.cloneElement(e,{ref:r})})}const f5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const o=nm(h5),l=v.useId(),u=v.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=v.useMemo(()=>({id:l,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(o.set(f,!1),()=>o.delete(f))}),i?[Math.random(),u]:[n,u]);return v.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),v.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),a==="popLayout"&&(e=c.jsx(d5,{isPresent:n,children:e})),c.jsx(rm.Provider,{value:d,children:e})};function h5(){return new Map}function FA(e=!0){const t=v.useContext(rm);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=v.useId();v.useEffect(()=>{e&&s(i)},[e]);const a=v.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const df=e=>e.key||"";function Ev(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Yb=typeof window<"u",UA=Yb?v.useLayoutEffect:v.useEffect,Hi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[o,l]=FA(a),u=v.useMemo(()=>Ev(e),[e]),d=a&&!o?[]:u.map(df),f=v.useRef(!0),h=v.useRef(u),p=nm(()=>new Map),[m,y]=v.useState(u),[w,g]=v.useState(u);UA(()=>{f.current=!1,h.current=u;for(let _=0;_{const N=df(_),T=a&&!o?!1:u===w||d.includes(N),A=()=>{if(p.has(N))p.set(N,!0);else return;let k=!0;p.forEach(R=>{R||(k=!1)}),k&&(b==null||b(),g(h.current),a&&(l==null||l()),r&&r())};return c.jsx(f5,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:T?void 0:A,children:_},N)})})},Rr=e=>e;let $A=Rr;const p5={useManualTiming:!1};function m5(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&i.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(a=u,r){s=!0;return}r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,s&&(s=!1,l.process(u))}};return l}const ff=["read","resolveKeyframes","update","preRender","render","postRender"],g5=40;function HA(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=ff.reduce((g,E)=>(g[E]=m5(i),g),{}),{read:o,resolveKeyframes:l,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const g=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(g-s.timestamp,g5),1),s.timestamp=g,s.isProcessing=!0,o.process(s),l.process(s),u.process(s),d.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:ff.reduce((g,E)=>{const b=a[E];return g[E]=(_,N=!1,T=!1)=>(n||m(),b.schedule(_,N,T)),g},{}),cancel:g=>{for(let E=0;Exv[e].some(n=>!!t[n])};function y5(e){for(const t in e)fl[t]={...fl[t],...e[t]}}const b5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Jh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||b5.has(e)}let VA=e=>!Jh(e);function KA(e){e&&(VA=t=>t.startsWith("on")?!Jh(t):e(t))}try{KA(require("@emotion/is-prop-valid").default)}catch{}function E5(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(VA(s)||n===!0&&Jh(s)||!t&&!Jh(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function x5({children:e,isValidProp:t,...n}){t&&KA(t),n={...v.useContext(Su),...n},n.isStatic=nm(()=>n.isStatic);const r=v.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return c.jsx(Su.Provider,{value:r,children:e})}function w5(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const sm=v.createContext({});function Au(e){return typeof e=="string"||Array.isArray(e)}function im(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Wb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qb=["initial",...Wb];function am(e){return im(e.animate)||qb.some(t=>Au(e[t]))}function YA(e){return!!(am(e)||e.variants)}function v5(e,t){if(am(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Au(n)?n:void 0,animate:Au(r)?r:void 0}}return e.inherit!==!1?t:{}}function _5(e){const{initial:t,animate:n}=v5(e,v.useContext(sm));return v.useMemo(()=>({initial:t,animate:n}),[wv(t),wv(n)])}function wv(e){return Array.isArray(e)?e.join(" "):e}const T5=Symbol.for("motionComponentSymbol");function Do(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function N5(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Do(n)&&(n.current=r))},[t])}const Gb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),k5="framerAppearId",WA="data-"+Gb(k5),{schedule:Xb}=HA(queueMicrotask,!1),qA=v.createContext({});function S5(e,t,n,r,s){var i,a;const{visualElement:o}=v.useContext(sm),l=v.useContext(zA),u=v.useContext(rm),d=v.useContext(Su).reducedMotion,f=v.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=v.useContext(qA);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&A5(f.current,n,s,p);const m=v.useRef(!1);v.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const y=n[WA],w=v.useRef(!!y&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,y)));return UA(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Xb.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),w.current=!1))}),h}function A5(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:GA(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||o&&Do(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function GA(e){if(e)return e.options.allowProjection!==!1?e.projection:GA(e.parent)}function C5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&y5(e);function o(u,d){let f;const h={...v.useContext(Su),...u,layoutId:I5(u)},{isStatic:p}=h,m=_5(u),y=r(u,p);if(!p&&Yb){R5();const w=O5(h);f=w.MeasureLayout,m.visualElement=S5(s,y,h,t,w.ProjectionNode)}return c.jsxs(sm.Provider,{value:m,children:[f&&m.visualElement?c.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,N5(y,m.visualElement,d),y,p,m.visualElement)]})}o.displayName=`motion.${typeof s=="string"?s:`create(${(a=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&a!==void 0?a:""})`}`;const l=v.forwardRef(o);return l[T5]=s,l}function I5({layoutId:e}){const t=v.useContext(Kb).id;return t&&e!==void 0?t+"-"+e:e}function R5(e,t){v.useContext(zA).strict}function O5(e){const{drag:t,layout:n}=fl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const L5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Qb(e){return typeof e!="string"||e.includes("-")?!1:!!(L5.indexOf(e)>-1||/[A-Z]/u.test(e))}function vv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Zb(e,t,n,r){if(typeof t=="function"){const[s,i]=vv(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=vv(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Py=e=>Array.isArray(e),M5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),D5=e=>Py(e)?e[e.length-1]||0:e,qn=e=>!!(e&&e.getVelocity);function ih(e){const t=qn(e)?e.get():e;return M5(t)?t.toValue():t}function P5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:j5(r,s,i,e),renderState:t()};return n&&(a.onMount=o=>n({props:r,current:o,...a}),a.onUpdate=o=>n(o)),a}const XA=e=>(t,n)=>{const r=v.useContext(sm),s=v.useContext(rm),i=()=>P5(e,t,r,s);return n?i():nm(i)};function j5(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=ih(i[h]);let{initial:a,animate:o}=e;const l=am(e),u=YA(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?o:a;if(f&&typeof f!="boolean"&&!im(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),ZA=QA("--"),B5=QA("var(--"),Jb=e=>B5(e)?F5.test(e.split("/*")[0].trim()):!1,F5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,JA=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ci=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Cu={...jl,transform:e=>ci(0,1,e)},hf={...jl,default:1},od=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xi=od("deg"),Os=od("%"),ze=od("px"),U5=od("vh"),$5=od("vw"),_v={...Os,parse:e=>Os.parse(e)/100,transform:e=>Os.transform(e*100)},H5={borderWidth:ze,borderTopWidth:ze,borderRightWidth:ze,borderBottomWidth:ze,borderLeftWidth:ze,borderRadius:ze,radius:ze,borderTopLeftRadius:ze,borderTopRightRadius:ze,borderBottomRightRadius:ze,borderBottomLeftRadius:ze,width:ze,maxWidth:ze,height:ze,maxHeight:ze,top:ze,right:ze,bottom:ze,left:ze,padding:ze,paddingTop:ze,paddingRight:ze,paddingBottom:ze,paddingLeft:ze,margin:ze,marginTop:ze,marginRight:ze,marginBottom:ze,marginLeft:ze,backgroundPositionX:ze,backgroundPositionY:ze},z5={rotate:xi,rotateX:xi,rotateY:xi,rotateZ:xi,scale:hf,scaleX:hf,scaleY:hf,scaleZ:hf,skew:xi,skewX:xi,skewY:xi,distance:ze,translateX:ze,translateY:ze,translateZ:ze,x:ze,y:ze,z:ze,perspective:ze,transformPerspective:ze,opacity:Cu,originX:_v,originY:_v,originZ:ze},Tv={...jl,transform:Math.round},eE={...H5,...z5,zIndex:Tv,size:ze,fillOpacity:Cu,strokeOpacity:Cu,numOctaves:Tv},V5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},K5=Pl.length;function Y5(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),eC=()=>({...rE(),attrs:{}}),sE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function tC(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function rC(e,t,n,r){tC(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Gb(s),t.attrs[s])}const ep={};function Q5(e){Object.assign(ep,e)}function sC(e,{layout:t,layoutId:n}){return eo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ep[e]||e==="opacity")}function iE(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(qn(s[a])||t.style&&qn(t.style[a])||sC(a,e)||((r=n==null?void 0:n.getValue(a))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[a]=s[a]);return i}function iC(e,t,n){const r=iE(e,t,n);for(const s in e)if(qn(e[s])||qn(t[s])){const i=Pl.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function Z5(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const kv=["x","y","width","height","cx","cy","r"],J5={useVisualState:XA({scrapeMotionValuesFromProps:iC,createRenderState:eC,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const o in s)if(eo.has(o)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let o=0;o{Z5(n,r),$t.render(()=>{nE(r,s,sE(n.tagName),e.transformTemplate),rC(n,r)})})}})},ej={useVisualState:XA({scrapeMotionValuesFromProps:iE,createRenderState:rE})};function aC(e,t,n){for(const r in t)!qn(t[r])&&!sC(r,n)&&(e[r]=t[r])}function tj({transformTemplate:e},t){return v.useMemo(()=>{const n=rE();return tE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nj(e,t){const n=e.style||{},r={};return aC(r,n,e),Object.assign(r,tj(e,t)),r}function rj(e,t){const n={},r=nj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function sj(e,t,n,r){const s=v.useMemo(()=>{const i=eC();return nE(i,t,sE(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};aC(i,e.style,e),s.style={...i,...s.style}}return s}function ij(e=!1){return(n,r,s,{latestValues:i},a)=>{const l=(Qb(n)?sj:rj)(r,i,a,n),u=E5(r,typeof n=="string",e),d=n!==v.Fragment?{...u,...l,ref:s}:{},{children:f}=r,h=v.useMemo(()=>qn(f)?f.get():f,[f]);return v.createElement(n,{...d,children:h})}}function aj(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...Qb(r)?J5:ej,preloadedFeatures:e,useRender:ij(s),createVisualElement:t,Component:r};return C5(a)}}function oC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(ah===void 0&&Ls.set(Fn.isProcessing||p5.useManualTiming?Fn.timestamp:performance.now()),ah),set:e=>{ah=e,queueMicrotask(oj)}};function oE(e,t){e.indexOf(t)===-1&&e.push(t)}function lE(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class cE{constructor(){this.subscriptions=[]}add(t){return oE(this.subscriptions,t),()=>lE(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class cj{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ls.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ls.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new cE);const r=this.events[t].add(n);return t==="change"?()=>{r(),$t.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ls.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sv);return cC(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Iu(e,t){return new cj(e,t)}function uj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Iu(n))}function dj(e,t){const n=om(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const o=D5(i[a]);uj(e,a,o)}}function fj(e){return!!(qn(e)&&e.add)}function jy(e,t){const n=e.getValue("willChange");if(fj(n))return n.add(t)}function uC(e){return e.props[WA]}function uE(e){let t;return()=>(t===void 0&&(t=e()),t)}const hj=uE(()=>window.ScrollTimeline!==void 0);class pj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r{if(hj()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mj extends pj{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const ni=e=>e*1e3,ri=e=>e/1e3;function dE(e){return typeof e=="function"}function Av(e,t){e.timeline=t,e.onfinish=null}const fE=e=>Array.isArray(e)&&typeof e[0]=="number",gj={linearEasing:void 0};function yj(e,t){const n=uE(e);return()=>{var r;return(r=gj[t])!==null&&r!==void 0?r:n()}}const tp=yj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),hl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},dC=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i`cubic-bezier(${e}, ${t}, ${n}, ${r})`,By={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ac([0,.65,.55,1]),circOut:Ac([.55,0,1,.45]),backIn:Ac([.31,.01,.66,-.59]),backOut:Ac([.33,1.53,.69,.99])};function hC(e,t){if(e)return typeof e=="function"&&tp()?dC(e,t):fE(e)?Ac(e):Array.isArray(e)?e.map(n=>hC(n,t)||By.easeOut):By[e]}const pC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bj=1e-7,Ej=12;function xj(e,t,n,r,s){let i,a,o=0;do a=t+(n-t)/2,i=pC(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>bj&&++oxj(i,0,1,e,n);return i=>i===0||i===1?i:pC(s(i),t,r)}const mC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,gC=e=>t=>1-e(1-t),yC=ld(.33,1.53,.69,.99),hE=gC(yC),bC=mC(hE),EC=e=>(e*=2)<1?.5*hE(e):.5*(2-Math.pow(2,-10*(e-1))),pE=e=>1-Math.sin(Math.acos(e)),xC=gC(pE),wC=mC(pE),vC=e=>/^0[^.\s]+$/u.test(e);function wj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||vC(e):!0}const Kc=e=>Math.round(e*1e5)/1e5,mE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vj(e){return e==null}const _j=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gE=(e,t)=>n=>!!(typeof n=="string"&&_j.test(n)&&n.startsWith(e)||t&&!vj(n)&&Object.prototype.hasOwnProperty.call(n,t)),_C=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,o]=r.match(mE);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},Tj=e=>ci(0,255,e),Sg={...jl,transform:e=>Math.round(Tj(e))},_a={test:gE("rgb","red"),parse:_C("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Sg.transform(e)+", "+Sg.transform(t)+", "+Sg.transform(n)+", "+Kc(Cu.transform(r))+")"};function Nj(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Fy={test:gE("#"),parse:Nj,transform:_a.transform},Po={test:gE("hsl","hue"),parse:_C("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Os.transform(Kc(t))+", "+Os.transform(Kc(n))+", "+Kc(Cu.transform(r))+")"},Yn={test:e=>_a.test(e)||Fy.test(e)||Po.test(e),parse:e=>_a.test(e)?_a.parse(e):Po.test(e)?Po.parse(e):Fy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?_a.transform(e):Po.transform(e)},kj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Sj(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(mE))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(kj))===null||n===void 0?void 0:n.length)||0)>0}const TC="number",NC="color",Aj="var",Cj="var(",Cv="${}",Ij=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ru(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=t.replace(Ij,l=>(Yn.test(l)?(r.color.push(i),s.push(NC),n.push(Yn.parse(l))):l.startsWith(Cj)?(r.var.push(i),s.push(Aj),n.push(l)):(r.number.push(i),s.push(TC),n.push(parseFloat(l))),++i,Cv)).split(Cv);return{values:n,split:o,indexes:r,types:s}}function kC(e){return Ru(e).values}function SC(e){const{split:t,types:n}=Ru(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function Oj(e){const t=kC(e);return SC(e)(t.map(Rj))}const Gi={test:Sj,parse:kC,createTransformer:SC,getAnimatableNone:Oj},Lj=new Set(["brightness","contrast","saturate","opacity"]);function Mj(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(mE)||[];if(!r)return e;const s=n.replace(r,"");let i=Lj.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Dj=/\b([a-z-]*)\(.*?\)/gu,Uy={...Gi,getAnimatableNone:e=>{const t=e.match(Dj);return t?t.map(Mj).join(" "):e}},Pj={...eE,color:Yn,backgroundColor:Yn,outlineColor:Yn,fill:Yn,stroke:Yn,borderColor:Yn,borderTopColor:Yn,borderRightColor:Yn,borderBottomColor:Yn,borderLeftColor:Yn,filter:Uy,WebkitFilter:Uy},yE=e=>Pj[e];function AC(e,t){let n=yE(e);return n!==Uy&&(n=Gi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const jj=new Set(["auto","none","0"]);function Bj(e,t,n){let r=0,s;for(;re===jl||e===ze,Rv=(e,t)=>parseFloat(e.split(", ")[t]),Ov=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Rv(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Rv(i[1],e):0}},Fj=new Set(["x","y","z"]),Uj=Pl.filter(e=>!Fj.has(e));function $j(e){const t=[];return Uj.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const pl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ov(4,13),y:Ov(5,14)};pl.translateX=pl.x;pl.translateY=pl.y;const Ia=new Set;let $y=!1,Hy=!1;function CC(){if(Hy){const e=Array.from(Ia).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=$j(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var o;(o=r.getValue(i))===null||o===void 0||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hy=!1,$y=!1,Ia.forEach(e=>e.complete()),Ia.clear()}function IC(){Ia.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hy=!0)})}function Hj(){IC(),CC()}class bE{constructor(t,n,r,s,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ia.add(this),$y||($y=!0,$t.read(IC),$t.resolveKeyframes(CC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),zj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vj(e){const t=zj.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function OC(e,t,n=1){const[r,s]=Vj(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return RC(a)?parseFloat(a):a}return Jb(s)?OC(s,t,n+1):s}const LC=e=>t=>t.test(e),Kj={test:e=>e==="auto",parse:e=>e},MC=[jl,ze,Os,xi,$5,U5,Kj],Lv=e=>MC.find(LC(e));class DC extends bE{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Mv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gi.test(e)||e==="0")&&!e.startsWith("url("));function Yj(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function lm(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(qj),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Gj=40;class PC{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ls.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Gj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Hj(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ls.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:o,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Wj(t,r,s,i))if(a)this.options.duration=0;else{l&&l(lm(t,this.options,n)),o&&o(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const zy=2e4;function jC(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=zy?1/0:t}const nn=(e,t,n)=>e+(t-e)*n;function Ag(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xj({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,a=0;if(!t)s=i=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=Ag(l,o,e+1/3),i=Ag(l,o,e),a=Ag(l,o,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function np(e,t){return n=>n>0?t:e}const Cg=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Qj=[Fy,_a,Po],Zj=e=>Qj.find(t=>t.test(e));function Dv(e){const t=Zj(e);if(!t)return!1;let n=t.parse(e);return t===Po&&(n=Xj(n)),n}const Pv=(e,t)=>{const n=Dv(e),r=Dv(t);if(!n||!r)return np(e,t);const s={...n};return i=>(s.red=Cg(n.red,r.red,i),s.green=Cg(n.green,r.green,i),s.blue=Cg(n.blue,r.blue,i),s.alpha=nn(n.alpha,r.alpha,i),_a.transform(s))},Jj=(e,t)=>n=>t(e(n)),cd=(...e)=>e.reduce(Jj),Vy=new Set(["none","hidden"]);function eB(e,t){return Vy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tB(e,t){return n=>nn(e,t,n)}function EE(e){return typeof e=="number"?tB:typeof e=="string"?Jb(e)?np:Yn.test(e)?Pv:sB:Array.isArray(e)?BC:typeof e=="object"?Yn.test(e)?Pv:nB:np}function BC(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>EE(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function rB(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=Gi.createTransformer(t),r=Ru(e),s=Ru(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Vy.has(e)&&!s.values.length||Vy.has(t)&&!r.values.length?eB(e,t):cd(BC(rB(r,s),s.values),n):np(e,t)};function FC(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?nn(e,t,n):EE(e)(e,t)}const iB=5;function UC(e,t,n){const r=Math.max(t-iB,0);return cC(n-e(r),t-r)}const on={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ig=.001;function aB({duration:e=on.duration,bounce:t=on.bounce,velocity:n=on.velocity,mass:r=on.mass}){let s,i,a=1-t;a=ci(on.minDamping,on.maxDamping,a),e=ci(on.minDuration,on.maxDuration,ri(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=Ky(u,a),m=Math.exp(-f);return Ig-h/p*m},i=u=>{const f=u*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(u,2)*e,m=Math.exp(-f),y=Ky(Math.pow(u,2),a);return(-s(u)+Ig>0?-1:1)*((h-p)*m)/y}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Ig+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,l=lB(s,i,o);if(e=ni(e),isNaN(l))return{stiffness:on.stiffness,damping:on.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const oB=12;function lB(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function dB(e){let t={velocity:on.velocity,stiffness:on.stiffness,damping:on.damping,mass:on.mass,isResolvedFromDuration:!1,...e};if(!jv(e,uB)&&jv(e,cB))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ci(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:on.mass,stiffness:s,damping:i}}else{const n=aB(e);t={...t,...n,mass:on.mass},t.isResolvedFromDuration=!0}return t}function $C(e=on.visualDuration,t=on.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=dB({...n,velocity:-ri(n.velocity||0)}),m=h||0,y=u/(2*Math.sqrt(l*d)),w=a-i,g=ri(Math.sqrt(l/d)),E=Math.abs(w)<5;r||(r=E?on.restSpeed.granular:on.restSpeed.default),s||(s=E?on.restDelta.granular:on.restDelta.default);let b;if(y<1){const N=Ky(g,y);b=T=>{const A=Math.exp(-y*g*T);return a-A*((m+y*g*w)/N*Math.sin(N*T)+w*Math.cos(N*T))}}else if(y===1)b=N=>a-Math.exp(-g*N)*(w+(m+g*w)*N);else{const N=g*Math.sqrt(y*y-1);b=T=>{const A=Math.exp(-y*g*T),k=Math.min(N*T,300);return a-A*((m+y*g*w)*Math.sinh(k)+N*w*Math.cosh(k))/N}}const _={calculatedDuration:p&&f||null,next:N=>{const T=b(N);if(p)o.done=N>=f;else{let A=0;y<1&&(A=N===0?ni(m):UC(b,N,T));const k=Math.abs(A)<=r,R=Math.abs(a-T)<=s;o.done=k&&R}return o.value=o.done?a:T,o},toString:()=>{const N=Math.min(jC(_),zy),T=dC(A=>_.next(N*A).value,N,30);return N+"ms "+T}};return _}function Bv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=k=>o!==void 0&&kl,m=k=>o===void 0?l:l===void 0||Math.abs(o-k)-y*Math.exp(-k/r),b=k=>g+E(k),_=k=>{const R=E(k),I=b(k);h.done=Math.abs(R)<=u,h.value=h.done?g:I};let N,T;const A=k=>{p(h.value)&&(N=k,T=$C({keyframes:[h.value,m(h.value)],velocity:UC(b,k,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:k=>{let R=!1;return!T&&N===void 0&&(R=!0,_(k),A(k)),N!==void 0&&k>=N?T.next(k-N):(!R&&_(k),h)}}}const fB=ld(.42,0,1,1),hB=ld(0,0,.58,1),HC=ld(.42,0,.58,1),pB=e=>Array.isArray(e)&&typeof e[0]!="number",mB={linear:Rr,easeIn:fB,easeInOut:HC,easeOut:hB,circIn:pE,circInOut:wC,circOut:xC,backIn:hE,backInOut:bC,backOut:yC,anticipate:EC},Fv=e=>{if(fE(e)){$A(e.length===4);const[t,n,r,s]=e;return ld(t,n,r,s)}else if(typeof e=="string")return mB[e];return e};function gB(e,t,n){const r=[],s=n||FC,i=e.length-1;for(let a=0;at[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=gB(t,r,s),l=o.length,u=d=>{if(a&&d1)for(;fu(ci(e[0],e[i-1],d)):u}function bB(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=hl(0,t,r);e.push(nn(n,1,s))}}function EB(e){const t=[0];return bB(t,e.length-1),t}function xB(e,t){return e.map(n=>n*t)}function wB(e,t){return e.map(()=>t||HC).splice(0,e.length-1)}function rp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=pB(r)?r.map(Fv):Fv(r),i={done:!1,value:t[0]},a=xB(n&&n.length===t.length?n:EB(t),e),o=yB(a,t,{ease:Array.isArray(s)?s:wB(t,s)});return{calculatedDuration:e,next:l=>(i.value=o(l),i.done=l>=e,i)}}const vB=e=>{const t=({timestamp:n})=>e(n);return{start:()=>$t.update(t,!0),stop:()=>qi(t),now:()=>Fn.isProcessing?Fn.timestamp:Ls.now()}},_B={decay:Bv,inertia:Bv,tween:rp,keyframes:rp,spring:$C},TB=e=>e/100;class xE extends PC{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,a=(s==null?void 0:s.KeyframeResolver)||bE,o=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new a(i,o,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=this.options,o=dE(n)?n:_B[n]||rp;let l,u;o!==rp&&typeof t[0]!="number"&&(l=cd(TB,FC(t[0],t[1])),t=[0,100]);const d=o({...this.options,keyframes:t});i==="mirror"&&(u=o({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=jC(d));const{calculatedDuration:f}=d,h=f+s,p=h*(r+1)-s;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:p,repeatType:m,repeatDelay:y,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),E=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,_=i;if(p){const k=Math.min(this.currentTime,d)/f;let R=Math.floor(k),I=k%1;!I&&k>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,y&&(I-=y/f)):m==="mirror"&&(_=a)),b=ci(0,1,I)*f}const N=E?{done:!1,value:l[0]}:_.next(b);o&&(N.value=o(N.value));let{done:T}=N;!E&&u!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return A&&s!==void 0&&(N.value=lm(l,this.options,s)),w&&w(N.value),A&&this.finish(),N}get duration(){const{resolved:t}=this;return t?ri(t.calculatedDuration):0}get time(){return ri(this.currentTime)}set time(t){t=ni(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ri(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vB,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const NB=new Set(["opacity","clipPath","filter","transform"]);function kB(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:o="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const d=hC(o,s);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"})}const SB=uE(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),sp=10,AB=2e4;function CB(e){return dE(e.type)||e.type==="spring"||!fC(e.ease)}function IB(e,t){const n=new xE({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&ithis.onKeyframesResolved(a,o),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:o,name:l,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof i=="string"&&tp()&&RB(i)&&(i=zC[i]),CB(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...y}=this.options,w=IB(t,y);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=kB(o.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Av(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(lm(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:s,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ri(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ri(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ni(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Rr;const{animation:r}=n;Av(r,t)}return Rr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:a,times:o}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...p}=this.options,m=new xE({...p,keyframes:r,duration:s,type:i,ease:a,times:o,isGenerator:!0}),y=ni(this.time);u.setWithVelocity(m.sample(y-sp).value,m.sample(y).value,sp)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:a,type:o}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return SB()&&r&&NB.has(r)&&!l&&!u&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}}const OB={type:"spring",stiffness:500,damping:25,restSpeed:10},LB=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MB={type:"keyframes",duration:.8},DB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PB=(e,{keyframes:t})=>t.length>2?MB:eo.has(e)?e.startsWith("scale")?LB(t[1]):OB:DB;function jB({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:o,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const wE=(e,t,n,r={},s,i)=>a=>{const o=aE(r,e)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-ni(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:s};jB(o)||(d={...d,...PB(e,d)}),d.duration&&(d.duration=ni(d.duration)),d.repeatDelay&&(d.repeatDelay=ni(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!i&&t.get()!==void 0){const h=lm(d.keyframes,o);if(h!==void 0)return $t.update(()=>{d.onUpdate(h),d.onComplete()}),new mj([])}return!i&&Uv.supports(d)?new Uv(d):new xE(d)};function BB({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function VC(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const u=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),p=l[f];if(p===void 0||d&&BB(d,f))continue;const m={delay:n,...aE(a||{},f)};let y=!1;if(window.MotionHandoffAnimation){const g=uC(e);if(g){const E=window.MotionHandoffAnimation(g,f,$t);E!==null&&(m.startTime=E,y=!0)}}jy(e,f),h.start(wE(f,h,p,e.shouldReduceMotion&&lC.has(f)?{type:!1}:m,e,y));const w=h.animation;w&&u.push(w)}return o&&Promise.all(u).then(()=>{$t.update(()=>{o&&dj(e,o)})}),u}function Yy(e,t,n={}){var r;const s=om(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const a=s?()=>Promise.all(VC(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return FB(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function FB(e,t,n=0,r=0,s=1,i){const a=[],o=(e.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(e.variantChildren).sort(UB).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(Yy(u,t,{...i,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function UB(e,t){return e.sortNodePosition(t)}function $B(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Yy(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Yy(e,t,n);else{const s=typeof t=="function"?om(e,t,n.custom):t;r=Promise.all(VC(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const HB=qb.length;function KC(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?KC(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>$B(e,n,r)))}function YB(e){let t=KB(e),n=$v(),r=!0;const s=l=>(u,d)=>{var f;const h=om(e,d,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...y}=h;u={...u,...y,...m}}return u};function i(l){t=l(e)}function a(l){const{props:u}=e,d=KC(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;wm&&_,R=!1;const I=Array.isArray(b)?b:[b];let M=I.reduce(s(g),{});N===!1&&(M={});const{prevResolvedValues:B={}}=E,Y={...B,...M},P=L=>{k=!0,h.has(L)&&(R=!0,h.delete(L)),E.needsAnimating[L]=!0;const O=e.getValue(L);O&&(O.liveStyle=!1)};for(const L in Y){const O=M[L],j=B[L];if(p.hasOwnProperty(L))continue;let S=!1;Py(O)&&Py(j)?S=!oC(O,j):S=O!==j,S?O!=null?P(L):h.add(L):O!==void 0&&h.has(L)?P(L):E.protectedKeys[L]=!0}E.prevProp=b,E.prevResolvedValues=M,E.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(k=!1),k&&(!(T&&A)||R)&&f.push(...I.map(L=>({animation:L,options:{type:g}})))}if(h.size){const w={};h.forEach(g=>{const E=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),w[g]=E??null}),f.push({animation:w})}let y=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function o(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=a(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:o,setAnimateFunction:i,getState:()=>n,reset:()=>{n=$v(),r=!0}}}function WB(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!oC(t,e):!1}function la(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $v(){return{animate:la(!0),whileInView:la(),whileHover:la(),whileTap:la(),whileDrag:la(),whileFocus:la(),exit:la()}}class ea{constructor(t){this.isMounted=!1,this.node=t}update(){}}class qB extends ea{constructor(t){super(t),t.animationState||(t.animationState=YB(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();im(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let GB=0;class XB extends ea{constructor(){super(...arguments),this.id=GB++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const QB={animation:{Feature:qB},exit:{Feature:XB}},ns={x:!1,y:!1};function YC(){return ns.x||ns.y}function ZB(e){return e==="x"||e==="y"?ns[e]?null:(ns[e]=!0,()=>{ns[e]=!1}):ns.x||ns.y?null:(ns.x=ns.y=!0,()=>{ns.x=ns.y=!1})}const vE=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Ou(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ud(e){return{point:{x:e.pageX,y:e.pageY}}}const JB=e=>t=>vE(t)&&e(t,ud(t));function Yc(e,t,n,r){return Ou(e,t,JB(n),r)}const Hv=(e,t)=>Math.abs(e-t);function e8(e,t){const n=Hv(e.x,t.x),r=Hv(e.y,t.y);return Math.sqrt(n**2+r**2)}class WC{constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Og(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=e8(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:y}=Fn;this.history.push({...m,timestamp:y});const{onStart:w,onMove:g}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Rg(h,this.transformPagePoint),$t.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Og(f.type==="pointercancel"?this.lastMoveEventInfo:Rg(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!vE(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=ud(t),o=Rg(a,this.transformPagePoint),{point:l}=o,{timestamp:u}=Fn;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Og(o,this.history)),this.removeListeners=cd(Yc(this.contextWindow,"pointermove",this.handlePointerMove),Yc(this.contextWindow,"pointerup",this.handlePointerUp),Yc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qi(this.updatePoint)}}function Rg(e,t){return t?{point:t(e.point)}:e}function zv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Og({point:e},t){return{point:e,delta:zv(e,qC(t)),offset:zv(e,t8(t)),velocity:n8(t,.1)}}function t8(e){return e[0]}function qC(e){return e[e.length-1]}function n8(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=qC(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>ni(t)));)n--;if(!r)return{x:0,y:0};const i=ri(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const GC=1e-4,r8=1-GC,s8=1+GC,XC=.01,i8=0-XC,a8=0+XC;function Mr(e){return e.max-e.min}function o8(e,t,n){return Math.abs(e-t)<=n}function Vv(e,t,n,r=.5){e.origin=r,e.originPoint=nn(t.min,t.max,e.origin),e.scale=Mr(n)/Mr(t),e.translate=nn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=r8&&e.scale<=s8||isNaN(e.scale))&&(e.scale=1),(e.translate>=i8&&e.translate<=a8||isNaN(e.translate))&&(e.translate=0)}function Wc(e,t,n,r){Vv(e.x,t.x,n.x,r?r.originX:void 0),Vv(e.y,t.y,n.y,r?r.originY:void 0)}function Kv(e,t,n){e.min=n.min+t.min,e.max=e.min+Mr(t)}function l8(e,t,n){Kv(e.x,t.x,n.x),Kv(e.y,t.y,n.y)}function Yv(e,t,n){e.min=t.min-n.min,e.max=e.min+Mr(t)}function qc(e,t,n){Yv(e.x,t.x,n.x),Yv(e.y,t.y,n.y)}function c8(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?nn(n,e,r.max):Math.min(e,n)),e}function Wv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function u8(e,{top:t,left:n,bottom:r,right:s}){return{x:Wv(e.x,n,s),y:Wv(e.y,t,r)}}function qv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=hl(t.min,t.max-r,e.min):r>s&&(n=hl(e.min,e.max-s,t.min)),ci(0,1,n)}function h8(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Wy=.35;function p8(e=Wy){return e===!1?e=0:e===!0&&(e=Wy),{x:Gv(e,"left","right"),y:Gv(e,"top","bottom")}}function Gv(e,t,n){return{min:Xv(e,t),max:Xv(e,n)}}function Xv(e,t){return typeof e=="number"?e:e[t]||0}const Qv=()=>({translate:0,scale:1,origin:0,originPoint:0}),jo=()=>({x:Qv(),y:Qv()}),Zv=()=>({min:0,max:0}),un=()=>({x:Zv(),y:Zv()});function Fr(e){return[e("x"),e("y")]}function QC({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function m8({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function g8(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Lg(e){return e===void 0||e===1}function qy({scale:e,scaleX:t,scaleY:n}){return!Lg(e)||!Lg(t)||!Lg(n)}function ha(e){return qy(e)||ZC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ZC(e){return Jv(e.x)||Jv(e.y)}function Jv(e){return e&&e!=="0%"}function ip(e,t,n){const r=e-n,s=t*r;return n+s}function e_(e,t,n,r,s){return s!==void 0&&(e=ip(e,s,r)),ip(e,n,r)+t}function Gy(e,t=0,n=1,r,s){e.min=e_(e.min,t,n,r,s),e.max=e_(e.max,t,n,r,s)}function JC(e,{x:t,y:n}){Gy(e.x,t.translate,t.scale,t.originPoint),Gy(e.y,n.translate,n.scale,n.originPoint)}const t_=.999999999999,n_=1.0000000000001;function y8(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let o=0;ot_&&(t.x=1),t.yt_&&(t.y=1)}function Bo(e,t){e.min=e.min+t,e.max=e.max+t}function r_(e,t,n,r,s=.5){const i=nn(e.min,e.max,s);Gy(e,t,n,i,r)}function Fo(e,t){r_(e.x,t.x,t.scaleX,t.scale,t.originX),r_(e.y,t.y,t.scaleY,t.scale,t.originY)}function eI(e,t){return QC(g8(e.getBoundingClientRect(),t))}function b8(e,t,n){const r=eI(e,n),{scroll:s}=t;return s&&(Bo(r.x,s.offset.x),Bo(r.y,s.offset.y)),r}const tI=({current:e})=>e?e.ownerDocument.defaultView:null,E8=new WeakMap;class x8{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=un(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ud(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ZB(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fr(w=>{let g=this.getAxisMotionValue(w).get()||0;if(Os.test(g)){const{projection:E}=this.visualElement;if(E&&E.layout){const b=E.layout.layoutBox[w];b&&(g=Mr(b)*(parseFloat(g)/100))}}this.originPoint[w]=g}),m&&$t.postRender(()=>m(d,f)),jy(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=w8(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),l=()=>Fr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new WC(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:tI(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&$t.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!pf(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=c8(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&Do(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=u8(s.layoutBox,n):this.constraints=!1,this.elastic=p8(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Fr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=h8(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Do(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=b8(r,s.root,this.visualElement.getTransformPagePoint());let a=d8(s.layout.layoutBox,i);if(n){const o=n(m8(a));this.hasMutatedConstraints=!!o,o&&(a=QC(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Fr(d=>{if(!pf(d,n,this.currentDirection))return;let f=l&&l[d]||{};a&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return jy(this.visualElement,t),r.start(wE(t,r,0,n,this.visualElement,!1))}stopAnimation(){Fr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Fr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Fr(n=>{const{drag:r}=this.getProps();if(!pf(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[n];i.set(t[n]-nn(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Do(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Fr(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();s[a]=f8({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Fr(a=>{if(!pf(a,t,null))return;const o=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];o.set(nn(l,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;E8.set(this.visualElement,this);const t=this.visualElement.current,n=Yc(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Do(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),$t.read(r);const a=Ou(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Fr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=Wy,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function pf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function w8(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class v8 extends ea{constructor(t){super(t),this.removeGroupControls=Rr,this.removeListeners=Rr,this.controls=new x8(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rr}unmount(){this.removeGroupControls(),this.removeListeners()}}const s_=e=>(t,n)=>{e&&$t.postRender(()=>e(t,n))};class _8 extends ea{constructor(){super(...arguments),this.removePointerDownListener=Rr}onPointerDown(t){this.session=new WC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tI(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:s_(t),onStart:s_(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&$t.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Yc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ze.test(e))e=parseFloat(e);else return e;const n=i_(e,t.target.x),r=i_(e,t.target.y);return`${n}% ${r}%`}},T8={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Gi.parse(e);if(s.length>5)return r;const i=Gi.createTransformer(e),a=typeof s[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;s[0+a]/=o,s[1+a]/=l;const u=nn(o,l,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class N8 extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Q5(k8),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),oh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,s||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||$t.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Xb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nI(e){const[t,n]=FA(),r=v.useContext(Kb);return c.jsx(N8,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(qA),isPresent:t,safeToRemove:n})}const k8={borderRadius:{...uc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uc,borderTopRightRadius:uc,borderBottomLeftRadius:uc,borderBottomRightRadius:uc,boxShadow:T8};function S8(e,t,n){const r=qn(e)?e:Iu(e);return r.start(wE("",r,t,n)),r.animation}function A8(e){return e instanceof SVGElement&&e.tagName!=="svg"}const C8=(e,t)=>e.depth-t.depth;class I8{constructor(){this.children=[],this.isDirty=!1}add(t){oE(this.children,t),this.isDirty=!0}remove(t){lE(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(C8),this.isDirty=!1,this.children.forEach(t)}}function R8(e,t){const n=Ls.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(qi(r),e(i-t))};return $t.read(r,!0),()=>qi(r)}const rI=["TopLeft","TopRight","BottomLeft","BottomRight"],O8=rI.length,a_=e=>typeof e=="string"?parseFloat(e):e,o_=e=>typeof e=="number"||ze.test(e);function L8(e,t,n,r,s,i){s?(e.opacity=nn(0,n.opacity!==void 0?n.opacity:1,M8(r)),e.opacityExit=nn(t.opacity!==void 0?t.opacity:1,0,D8(r))):i&&(e.opacity=nn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(hl(e,t,r))}function c_(e,t){e.min=t.min,e.max=t.max}function Br(e,t){c_(e.x,t.x),c_(e.y,t.y)}function u_(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function d_(e,t,n,r,s){return e-=t,e=ip(e,1/n,r),s!==void 0&&(e=ip(e,1/s,r)),e}function P8(e,t=0,n=1,r=.5,s,i=e,a=e){if(Os.test(t)&&(t=parseFloat(t),t=nn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=nn(i.min,i.max,r);e===i&&(o-=t),e.min=d_(e.min,t,n,o,s),e.max=d_(e.max,t,n,o,s)}function f_(e,t,[n,r,s],i,a){P8(e,t[n],t[r],t[s],t.scale,i,a)}const j8=["x","scaleX","originX"],B8=["y","scaleY","originY"];function h_(e,t,n,r){f_(e.x,t,j8,n?n.x:void 0,r?r.x:void 0),f_(e.y,t,B8,n?n.y:void 0,r?r.y:void 0)}function p_(e){return e.translate===0&&e.scale===1}function iI(e){return p_(e.x)&&p_(e.y)}function m_(e,t){return e.min===t.min&&e.max===t.max}function F8(e,t){return m_(e.x,t.x)&&m_(e.y,t.y)}function g_(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aI(e,t){return g_(e.x,t.x)&&g_(e.y,t.y)}function y_(e){return Mr(e.x)/Mr(e.y)}function b_(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class U8{constructor(){this.members=[]}add(t){oE(this.members,t),t.scheduleRender()}remove(t){if(lE(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $8(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const pa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Cc=typeof window<"u"&&window.MotionDebug!==void 0,Mg=["","X","Y","Z"],H8={visibility:"hidden"},E_=1e3;let z8=0;function Dg(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function oI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=uC(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",$t,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&oI(r)}function lI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},o=t==null?void 0:t()){this.id=z8++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cc&&(pa.totalNodes=pa.resolvedTargetDeltas=pa.recalculatedProjection=0),this.nodes.forEach(Y8),this.nodes.forEach(Q8),this.nodes.forEach(Z8),this.nodes.forEach(W8),Cc&&window.MotionDebug.record(pa)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=R8(h,250),oh.hasAnimatedSinceResize&&(oh.hasAnimatedSinceResize=!1,this.nodes.forEach(w_))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||r9,{onLayoutAnimationStart:w,onLayoutAnimationComplete:g}=d.getProps(),E=!this.targetLayout||!aI(this.targetLayout,m)||p,b=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||h&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,b);const _={...aE(y,"layout"),onPlay:w,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||w_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,qi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(J8),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&oI(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const N=_/1e3;v_(f.x,a.x,N),v_(f.y,a.y,N),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),t9(this.relativeTarget,this.relativeTargetOrigin,h,N),b&&F8(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=un()),Br(b,this.relativeTarget)),y&&(this.animationValues=d,L8(d,u,this.latestValues,N,E,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$t.update(()=>{oh.hasAnimatedSinceResize=!0,this.currentAnimation=S8(0,E_,{...a,onUpdate:o=>{this.mixTargetDelta(o),a.onUpdate&&a.onUpdate(o)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(E_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:d}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&cI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||un();const f=Mr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const h=Mr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+h}Br(o,l),Fo(o,d),Wc(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new U8),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&Dg("z",a,u,this.animationValues);for(let d=0;d{var o;return(o=a.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(x_),this.root.sharedNodes.clear()}}}function V8(e){e.updateLayout()}function K8(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;i==="size"?Fr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Mr(h);h.min=r[f].min,h.max=h.min+p}):cI(i,n.layoutBox,r)&&Fr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Mr(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=jo();Wc(o,r,n.layoutBox);const l=jo();a?Wc(l,e.applyTransform(s,!0),n.measuredBox):Wc(l,r,n.layoutBox);const u=!iI(o);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=un();qc(m,n.layoutBox,h.layoutBox);const y=un();qc(y,r,p.layoutBox),aI(m,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Y8(e){Cc&&pa.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function W8(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function q8(e){e.clearSnapshot()}function x_(e){e.clearMeasurements()}function G8(e){e.isLayoutDirty=!1}function X8(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function w_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Q8(e){e.resolveTargetDelta()}function Z8(e){e.calcProjection()}function J8(e){e.resetSkewAndRotation()}function e9(e){e.removeLeadSnapshot()}function v_(e,t,n){e.translate=nn(t.translate,0,n),e.scale=nn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function __(e,t,n,r){e.min=nn(t.min,n.min,r),e.max=nn(t.max,n.max,r)}function t9(e,t,n,r){__(e.x,t.x,n.x,r),__(e.y,t.y,n.y,r)}function n9(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const r9={duration:.45,ease:[.4,0,.1,1]},T_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),N_=T_("applewebkit/")&&!T_("chrome/")?Math.round:Rr;function k_(e){e.min=N_(e.min),e.max=N_(e.max)}function s9(e){k_(e.x),k_(e.y)}function cI(e,t,n){return e==="position"||e==="preserve-aspect"&&!o8(y_(t),y_(n),.2)}function i9(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const a9=lI({attachResizeListener:(e,t)=>Ou(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Pg={current:void 0},uI=lI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Pg.current){const e=new a9({});e.mount(window),e.setOptions({layoutScroll:!0}),Pg.current=e}return Pg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),o9={pan:{Feature:_8},drag:{Feature:v8,ProjectionNode:uI,MeasureLayout:nI}};function l9(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const i=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function dI(e,t){const n=l9(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function S_(e){return t=>{t.pointerType==="touch"||YC()||e(t)}}function c9(e,t,n={}){const[r,s,i]=dI(e,n),a=S_(o=>{const{target:l}=o,u=t(o);if(typeof u!="function"||!l)return;const d=S_(f=>{u(f),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,s)});return r.forEach(o=>{o.addEventListener("pointerenter",a,s)}),i}function A_(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&$t.postRender(()=>i(t,ud(t)))}class u9 extends ea{mount(){const{current:t}=this.node;t&&(this.unmount=c9(t,n=>(A_(this.node,n,"Start"),r=>A_(this.node,r,"End"))))}unmount(){}}class d9 extends ea{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=cd(Ou(this.node.current,"focus",()=>this.onFocus()),Ou(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const fI=(e,t)=>t?e===t?!0:fI(e,t.parentElement):!1,f9=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function h9(e){return f9.has(e.tagName)||e.tabIndex!==-1}const Ic=new WeakSet;function C_(e){return t=>{t.key==="Enter"&&e(t)}}function jg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const p9=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=C_(()=>{if(Ic.has(n))return;jg(n,"down");const s=C_(()=>{jg(n,"up")}),i=()=>jg(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function I_(e){return vE(e)&&!YC()}function m9(e,t,n={}){const[r,s,i]=dI(e,n),a=o=>{const l=o.currentTarget;if(!I_(o)||Ic.has(l))return;Ic.add(l);const u=t(o),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!I_(p)||!Ic.has(l))&&(Ic.delete(l),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||fI(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(o=>{!h9(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,s),o.addEventListener("focus",u=>p9(u,s),s)}),i}function R_(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&$t.postRender(()=>i(t,ud(t)))}class g9 extends ea{mount(){const{current:t}=this.node;t&&(this.unmount=m9(t,n=>(R_(this.node,n,"Start"),(r,{success:s})=>R_(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Xy=new WeakMap,Bg=new WeakMap,y9=e=>{const t=Xy.get(e.target);t&&t(e)},b9=e=>{e.forEach(y9)};function E9({root:e,...t}){const n=e||document;Bg.has(n)||Bg.set(n,{});const r=Bg.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(b9,{root:e,...t})),r[s]}function x9(e,t,n){const r=E9(t);return Xy.set(e,n),r.observe(e),()=>{Xy.delete(e),r.unobserve(e)}}const w9={some:0,all:1};class v9 extends ea{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:w9[s]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(l)};return x9(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(_9(t,n))&&this.startObserver()}unmount(){}}function _9({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const T9={inView:{Feature:v9},tap:{Feature:g9},focus:{Feature:d9},hover:{Feature:u9}},N9={layout:{ProjectionNode:uI,MeasureLayout:nI}},Qy={current:null},hI={current:!1};function k9(){if(hI.current=!0,!!Yb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Qy.current=e.matches;e.addListener(t),t()}else Qy.current=!1}const S9=[...MC,Yn,Gi],A9=e=>S9.find(LC(e)),O_=new WeakMap;function C9(e,t,n){for(const r in t){const s=t[r],i=n[r];if(qn(s))e.addValue(r,s);else if(qn(i))e.addValue(r,Iu(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Iu(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const L_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class I9{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ls.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),hI.current||k9(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Qy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){O_.delete(this.current),this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=eo.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&$t.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in fl){const n=fl[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):un()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Iu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(RC(s)||vC(s))?s=parseFloat(s):!A9(s)&&Gi.test(n)&&(s=AC(t,n)),this.setBaseTarget(t,qn(s)?s.get():s)),qn(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const a=Zb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(s=a[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!qn(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new cE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class pI extends I9{constructor(){super(...arguments),this.KeyframeResolver=DC}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;qn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function R9(e){return window.getComputedStyle(e)}class O9 extends pI{constructor(){super(...arguments),this.type="html",this.renderInstance=tC}readValueFromInstance(t,n){if(eo.has(n)){const r=yE(n);return r&&r.default||0}else{const r=R9(t),s=(ZA(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return eI(t,n)}build(t,n,r){tE(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return iE(t,n,r)}}class L9 extends pI{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=un}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(eo.has(n)){const r=yE(n);return r&&r.default||0}return n=nC.has(n)?n:Gb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iC(t,n,r)}build(t,n,r){nE(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){rC(t,n,r,s)}mount(t){this.isSVGTag=sE(t.tagName),super.mount(t)}}const M9=(e,t)=>Qb(e)?new L9(t):new O9(t,{allowProjection:e!==v.Fragment}),D9=aj({...QB,...T9,...o9,...N9},M9),Gt=w5(D9);function _n(){return _n=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?v.useEffect:v.useLayoutEffect;function yo(e,t,n){var r=v.useRef(t);r.current=t,v.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var P9=["container"];function j9(e){var t=e.container,n=t===void 0?document.body:t,r=cm(e,P9);return $a.createPortal(et.createElement("div",_n({},r)),n)}function B9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function F9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function U9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function $9(){return v.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function D_(e){var t=e.touches[0],n=t.clientX,r=t.clientY;if(e.touches.length>=2){var s=e.touches[1],i=s.clientX,a=s.clientY;return[(n+i)/2,(r+a)/2,Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2))]}return[n,r,0]}var Ni=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,o=e;return i<=r?(s=1,o=0):e>0&&a-e<=0?(s=2,o=a):e<0&&a+e<=0&&(s=3,o=-a),[s,o]};function Fg(e,t,n,r,s,i,a,o,l,u){a===void 0&&(a=innerWidth/2),o===void 0&&(o=innerHeight/2),l===void 0&&(l=0),u===void 0&&(u=0);var d=Ni(e,i,n,innerWidth)[0],f=Ni(t,i,r,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-i/s*(a-(h+e))-h+(r/n>=3&&n*i===innerWidth?0:d?l/2:l),y:o-i/s*(o-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:o}}function e1(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function Ug(e,t,n){var r=e1(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,o=s,l=i,u=e/t*i,d=t/e*s;return e=i?o=u:e>=s&&ts/i?l=d:t/e>=3&&!r[2]?a=((l=d)-i)/2:o=u,{width:o,height:l,x:0,y:a,pause:!0}}function gf(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,o=v.useRef(e);o.current=e;var l=v.useRef(0),u=v.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=v.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){l.current=p,d(),o.current.apply(null,h)}var y=l.current,w=p-y;if(y===0&&(r&&m(),l.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){l=requestAnimationFrame(u)}}var z9={T:0,L:0,W:0,H:0,FIT:void 0},gI=function(){var e=v.useRef(!1);return v.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},V9=["className"];function K9(e){var t=e.className,n=t===void 0?"":t,r=cm(e,V9);return et.createElement("div",_n({className:"PhotoView__Spinner "+n},r),et.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},et.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),et.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var Y9=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function W9(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,o=e.brokenElement,l=cm(e,Y9),u=gI();return t&&!r?et.createElement(et.Fragment,null,et.createElement("img",_n({className:"PhotoView__Photo"+(s?" "+s:""),src:t,onLoad:function(d){var f=d.target;u.current&&i({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&i({broken:!0})},draggable:!1,alt:""},l)),!n&&(a?et.createElement("span",{className:"PhotoView__icon"},a):et.createElement(K9,{className:"PhotoView__icon"}))):o?et.createElement("span",{className:"PhotoView__icon"},typeof o=="function"?o({src:t}):o):null}var q9={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function G9(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,o=a===void 0?0:a,l=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,y=e.loadingElement,w=e.brokenElement,g=e.onPhotoTap,E=e.onMaskTap,b=e.onReachMove,_=e.onReachUp,N=e.onPhotoResize,T=e.isActive,A=e.expose,k=ap(q9),R=k[0],I=k[1],M=v.useRef(0),B=gI(),Y=R.naturalWidth,P=Y===void 0?i:Y,U=R.naturalHeight,C=U===void 0?o:U,L=R.width,O=L===void 0?i:L,j=R.height,S=j===void 0?o:j,H=R.loaded,V=H===void 0?!n:H,D=R.broken,ne=R.x,ee=R.y,re=R.touched,de=R.stopRaf,G=R.maskTouched,W=R.rotate,oe=R.scale,he=R.CX,J=R.CY,ce=R.lastX,Ce=R.lastY,Ee=R.lastCX,ge=R.lastCY,Le=R.lastScale,ve=R.touchTime,Ue=R.touchLength,Ie=R.pause,ae=R.reach,wt=Ra({onScale:function(ue){return we(mf(ue))},onRotate:function(ue){W!==ue&&(A({rotate:ue}),I(_n({rotate:ue},Ug(P,C,ue))))}});function we(ue,Oe,Qe){oe!==ue&&(A({scale:ue}),I(_n({scale:ue},Fg(ne,ee,O,S,oe,ue,Oe,Qe),ue<=1&&{x:0,y:0})))}var vt=gf(function(ue,Oe,Qe){if(Qe===void 0&&(Qe=0),(re||G)&&T){var cn=e1(W,O,S),an=cn[0],ie=cn[1];if(Qe===0&&M.current===0){var _e=Math.abs(ue-he)<=20,ye=Math.abs(Oe-J)<=20;if(_e&&ye)return void I({lastCX:ue,lastCY:Oe});M.current=_e?Oe>J?3:2:1}var Pe,$e=ue-Ee,qe=Oe-ge;if(Qe===0){var gt=Ni($e+ce,oe,an,innerWidth)[0],It=Ni(qe+Ce,oe,ie,innerHeight);Pe=function(gn,yn,zt,kn){return yn&&gn===1||kn==="x"?"x":zt&&gn>1||kn==="y"?"y":void 0}(M.current,gt,It[0],ae),Pe!==void 0&&b(Pe,ue,Oe,oe)}if(Pe==="x"||G)return void I({reach:"x"});var Rt=mf(oe+(Qe-Ue)/100/2*oe,P/O,.2);A({scale:Rt}),I(_n({touchLength:Qe,reach:Pe,scale:Rt},Fg(ne,ee,O,S,oe,Rt,ue,Oe,$e,qe)))}},{maxWait:8});function ct(ue){return!de&&!re&&(B.current&&I(_n({},ue,{pause:u})),B.current)}var K,X,le,Ne,Re,ut,We,ot,Zt=(Re=function(ue){return ct({x:ue})},ut=function(ue){return ct({y:ue})},We=function(ue){return B.current&&(A({scale:ue}),I({scale:ue})),!re&&B.current},ot=Ra({X:function(ue){return Re(ue)},Y:function(ue){return ut(ue)},S:function(ue){return We(ue)}}),function(ue,Oe,Qe,cn,an,ie,_e,ye,Pe,$e,qe){var gt=e1($e,an,ie),It=gt[0],Rt=gt[1],gn=Ni(ue,ye,It,innerWidth),yn=gn[0],zt=gn[1],kn=Ni(Oe,ye,Rt,innerHeight),er=kn[0],_r=kn[1],Dn=Date.now()-qe;if(Dn>=200||ye!==_e||Math.abs(Pe-_e)>1){var Hn=Fg(ue,Oe,an,ie,_e,ye),tr=Hn.x,Tr=Hn.y,Vt=yn?zt:tr!==ue?tr:null,Sn=er?_r:Tr!==Oe?Tr:null;return Vt!==null&&ba(ue,Vt,ot.X),Sn!==null&&ba(Oe,Sn,ot.Y),void(ye!==_e&&ba(_e,ye,ot.S))}var Pn=(ue-Qe)/Dn,nr=(Oe-cn)/Dn,zn=Math.sqrt(Math.pow(Pn,2)+Math.pow(nr,2)),An=!1,st=!1;(function(Cn,Bt){var Jt,In=Cn,jn=0,wn=0,rr=function(ke){Jt||(Jt=ke);var Me=ke-Jt,He=Math.sign(Cn),Lt=-.001*He,yt=Math.sign(-In)*Math.pow(In,2)*2e-4,Kt=In*Me+(Lt+yt)*Math.pow(Me,2)/2;jn+=Kt,Jt=ke,He*(In+=(Lt+yt)*Me)<=0?Z():Bt(jn)?Ot():Z()};function Ot(){wn=requestAnimationFrame(rr)}function Z(){cancelAnimationFrame(wn)}Ot()})(zn,function(Cn){var Bt=ue+Cn*(Pn/zn),Jt=Oe+Cn*(nr/zn),In=Ni(Bt,_e,It,innerWidth),jn=In[0],wn=In[1],rr=Ni(Jt,_e,Rt,innerHeight),Ot=rr[0],Z=rr[1];if(jn&&!An&&(An=!0,yn?ba(Bt,wn,ot.X):P_(wn,Bt+(Bt-wn),ot.X)),Ot&&!st&&(st=!0,er?ba(Jt,Z,ot.Y):P_(Z,Jt+(Jt-Z),ot.Y)),An&&st)return!1;var ke=An||ot.X(wn),Me=st||ot.Y(Z);return ke&&Me})}),Ct=(K=g,X=function(ue,Oe){ae||we(oe!==1?1:Math.max(2,P/O),ue,Oe)},le=v.useRef(0),Ne=gf(function(){le.current=0,K.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var ue=[].slice.call(arguments);le.current+=1,Ne.apply(void 0,ue),le.current>=2&&(Ne.cancel(),le.current=0,X.apply(void 0,ue))});function Ge(ue,Oe){if(M.current=0,(re||G)&&T){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Qe=mf(oe,P/O);if(Zt(ne,ee,ce,Ce,O,S,oe,Qe,Le,W,ve),_(ue,Oe),he===ue&&J===Oe){if(re)return void Ct(ue,Oe);G&&E(ue,Oe)}}}function Et(ue,Oe,Qe){Qe===void 0&&(Qe=0),I({touched:!0,CX:ue,CY:Oe,lastCX:ue,lastCY:Oe,lastX:ne,lastY:ee,lastScale:oe,touchLength:Qe,touchTime:Date.now()})}function Ht(ue){I({maskTouched:!0,CX:ue.clientX,CY:ue.clientY,lastX:ne,lastY:ee})}yo(Ks?void 0:"mousemove",function(ue){ue.preventDefault(),vt(ue.clientX,ue.clientY)}),yo(Ks?void 0:"mouseup",function(ue){Ge(ue.clientX,ue.clientY)}),yo(Ks?"touchmove":void 0,function(ue){ue.preventDefault();var Oe=D_(ue);vt.apply(void 0,Oe)},{passive:!1}),yo(Ks?"touchend":void 0,function(ue){var Oe=ue.changedTouches[0];Ge(Oe.clientX,Oe.clientY)},{passive:!1}),yo("resize",gf(function(){V&&!re&&(I(Ug(P,C,W)),N())},{maxWait:8})),Jy(function(){T&&A(_n({scale:oe,rotate:W},wt))},[T]);var Nn=function(ue,Oe,Qe,cn,an,ie,_e,ye,Pe,$e){var qe=function(tr,Tr,Vt,Sn,Pn){var nr=v.useRef(!1),zn=ap({lead:!0,scale:Vt}),An=zn[0],st=An.lead,Cn=An.scale,Bt=zn[1],Jt=gf(function(In){try{return Pn(!0),Bt({lead:!1,scale:In}),Promise.resolve()}catch(jn){return Promise.reject(jn)}},{wait:Sn});return Jy(function(){nr.current?(Pn(!1),Bt({lead:!0}),Jt(Vt)):nr.current=!0},[Vt]),st?[tr*Cn,Tr*Cn,Vt/Cn]:[tr*Vt,Tr*Vt,1]}(ie,_e,ye,Pe,$e),gt=qe[0],It=qe[1],Rt=qe[2],gn=function(tr,Tr,Vt,Sn,Pn){var nr=v.useState(z9),zn=nr[0],An=nr[1],st=v.useState(0),Cn=st[0],Bt=st[1],Jt=v.useRef(),In=Ra({OK:function(){return tr&&Bt(4)}});function jn(wn){Pn(!1),Bt(wn)}return v.useEffect(function(){if(Jt.current||(Jt.current=Date.now()),Vt){if(function(wn,rr){var Ot=wn&&wn.current;if(Ot&&Ot.nodeType===1){var Z=Ot.getBoundingClientRect();rr({T:Z.top,L:Z.left,W:Z.width,H:Z.height,FIT:Ot.tagName==="IMG"?getComputedStyle(Ot).objectFit:void 0})}}(Tr,An),tr)return Date.now()-Jt.current<250?(Bt(1),requestAnimationFrame(function(){Bt(2),requestAnimationFrame(function(){return jn(3)})}),void setTimeout(In.OK,Sn)):void Bt(4);jn(5)}},[tr,Vt]),[Cn,zn]}(ue,Oe,Qe,Pe,$e),yn=gn[0],zt=gn[1],kn=zt.W,er=zt.FIT,_r=innerWidth/2,Dn=innerHeight/2,Hn=yn<3||yn>4;return[Hn?kn?zt.L:_r:cn+(_r-ie*ye/2),Hn?kn?zt.T:Dn:an+(Dn-_e*ye/2),gt,Hn&&er?gt*(zt.H/kn):It,yn===0?Rt:Hn?kn/(ie*ye)||.01:Rt,Hn?er?1:0:1,yn,er]}(u,l,V,ne,ee,O,S,oe,d,function(ue){return I({pause:ue})}),Fe=Nn[4],rt=Nn[6],tt="transform "+d+"ms "+f,mt={className:p,onMouseDown:Ks?void 0:function(ue){ue.stopPropagation(),ue.button===0&&Et(ue.clientX,ue.clientY,0)},onTouchStart:Ks?function(ue){ue.stopPropagation(),Et.apply(void 0,D_(ue))}:void 0,onWheel:function(ue){if(!ae){var Oe=mf(oe-ue.deltaY/100/2,P/O);I({stopRaf:!0}),we(Oe,ue.clientX,ue.clientY)}},style:{width:Nn[2]+"px",height:Nn[3]+"px",opacity:Nn[5],objectFit:rt===4?void 0:Nn[7],transform:W?"rotate("+W+"deg)":void 0,transition:rt>2?tt+", opacity "+d+"ms ease, height "+(rt<4?d/2:rt>4?d:0)+"ms "+f:void 0}};return et.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Ks&&T?Ht:void 0,onTouchStart:Ks&&T?function(ue){return Ht(ue.touches[0])}:void 0},et.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Fe+", 0, 0, "+Fe+", "+Nn[0]+", "+Nn[1]+")",transition:re||Ie?void 0:tt,willChange:T?"transform":void 0}},n?et.createElement(W9,_n({src:n,loaded:V,broken:D},mt,{onPhotoLoad:function(ue){I(_n({},ue,ue.loaded&&Ug(ue.naturalWidth||0,ue.naturalHeight||0,W)))},loadingElement:y,brokenElement:w})):r&&r({attrs:mt,scale:Fe,rotate:W})))}var j_={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function X9(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,o=a===void 0||a,l=e.maskOpacity,u=l===void 0?1:l,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,y=e.toolbarRender,w=e.className,g=e.maskClassName,E=e.photoClassName,b=e.photoWrapClassName,_=e.loadingElement,N=e.brokenElement,T=e.images,A=e.index,k=A===void 0?0:A,R=e.onIndexChange,I=e.visible,M=e.onClose,B=e.afterClose,Y=e.portalContainer,P=ap(j_),U=P[0],C=P[1],L=v.useState(0),O=L[0],j=L[1],S=U.x,H=U.touched,V=U.pause,D=U.lastCX,ne=U.lastCY,ee=U.bg,re=ee===void 0?u:ee,de=U.lastBg,G=U.overlay,W=U.minimal,oe=U.scale,he=U.rotate,J=U.onScale,ce=U.onRotate,Ce=e.hasOwnProperty("index"),Ee=Ce?k:O,ge=Ce?R:j,Le=v.useRef(Ee),ve=T.length,Ue=T[Ee],Ie=typeof n=="boolean"?n:ve>n,ae=function(Fe,rt){var tt=v.useReducer(function(Qe){return!Qe},!1)[1],mt=v.useRef(0),ue=function(Qe){var cn=v.useRef(Qe);function an(ie){cn.current=ie}return v.useMemo(function(){(function(ie){Fe?(ie(Fe),mt.current=1):mt.current=2})(an)},[Qe]),[cn.current,an]}(Fe),Oe=ue[1];return[ue[0],mt.current,function(){tt(),mt.current===2&&(Oe(!1),rt&&rt()),mt.current=0}]}(I,B),wt=ae[0],we=ae[1],vt=ae[2];Jy(function(){if(wt)return C({pause:!0,x:Ee*-(innerWidth+uo)}),void(Le.current=Ee);C(j_)},[wt]);var ct=Ra({close:function(Fe){ce&&ce(0),C({overlay:!0,lastBg:re}),M(Fe)},changeIndex:function(Fe,rt){rt===void 0&&(rt=!1);var tt=Ie?Le.current+(Fe-Ee):Fe,mt=ve-1,ue=Zy(tt,0,mt),Oe=Ie?tt:ue,Qe=innerWidth+uo;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-Qe*Oe,pause:rt}),Le.current=Oe,ge&&ge(Ie?Fe<0?mt:Fe>mt?0:Fe:ue)}}),K=ct.close,X=ct.changeIndex;function le(Fe){return Fe?K():C({overlay:!G})}function Ne(){C({x:-(innerWidth+uo)*Ee,lastCX:void 0,lastCY:void 0,pause:!0}),Le.current=Ee}function Re(Fe,rt,tt,mt){Fe==="x"?function(ue){if(D!==void 0){var Oe=ue-D,Qe=Oe;!Ie&&(Ee===0&&Oe>0||Ee===ve-1&&Oe<0)&&(Qe=Oe/2),C({touched:!0,lastCX:D,x:-(innerWidth+uo)*Le.current+Qe,pause:!1})}else C({touched:!0,lastCX:ue,x:S,pause:!1})}(rt):Fe==="y"&&function(ue,Oe){if(ne!==void 0){var Qe=u===null?null:Zy(u,.01,u-Math.abs(ue-ne)/100/4);C({touched:!0,lastCY:ne,bg:Oe===1?Qe:u,minimal:Oe===1})}else C({touched:!0,lastCY:ue,bg:re,minimal:!0})}(tt,mt)}function ut(Fe,rt){var tt=Fe-(D??Fe),mt=rt-(ne??rt),ue=!1;if(tt<-40)X(Ee+1);else if(tt>40)X(Ee-1);else{var Oe=-(innerWidth+uo)*Le.current;Math.abs(mt)>100&&W&&f&&(ue=!0,K()),C({touched:!1,x:Oe,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!ue||G})}}yo("keydown",function(Fe){if(I)switch(Fe.key){case"ArrowLeft":X(Ee-1,!0);break;case"ArrowRight":X(Ee+1,!0);break;case"Escape":K()}});var We=function(Fe,rt,tt){return v.useMemo(function(){var mt=Fe.length;return tt?Fe.concat(Fe).concat(Fe).slice(mt+rt-1,mt+rt+2):Fe.slice(Math.max(rt-1,0),Math.min(rt+2,mt+1))},[Fe,rt,tt])}(T,Ee,Ie);if(!wt)return null;var ot=G&&!we,Zt=I?re:de,Ct=J&&ce&&{images:T,index:Ee,visible:I,onClose:K,onIndexChange:X,overlayVisible:ot,overlay:Ue&&Ue.overlay,scale:oe,rotate:he,onScale:J,onRotate:ce},Ge=r?r(we):400,Et=s?s(we):M_,Ht=r?r(3):600,Nn=s?s(3):M_;return et.createElement(j9,{className:"PhotoView-Portal"+(ot?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(Fe){return Fe.stopPropagation()},container:Y},I&&et.createElement($9,null),et.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(we===1?" PhotoView-Slider__fadeIn":we===2?" PhotoView-Slider__fadeOut":""),style:{background:Zt?"rgba(0, 0, 0, "+Zt+")":void 0,transitionTimingFunction:Et,transitionDuration:(H?0:Ge)+"ms",animationDuration:Ge+"ms"},onAnimationEnd:vt}),p&&et.createElement("div",{className:"PhotoView-Slider__BannerWrap"},et.createElement("div",{className:"PhotoView-Slider__Counter"},Ee+1," / ",ve),et.createElement("div",{className:"PhotoView-Slider__BannerRight"},y&&Ct&&y(Ct),et.createElement(B9,{className:"PhotoView-Slider__toolbarIcon",onClick:K}))),We.map(function(Fe,rt){var tt=Ie||Ee!==0?Le.current-1+rt:Ee+rt;return et.createElement(G9,{key:Ie?Fe.key+"/"+Fe.src+"/"+tt:Fe.key,item:Fe,speed:Ge,easing:Et,visible:I,onReachMove:Re,onReachUp:ut,onPhotoTap:function(){return le(i)},onMaskTap:function(){return le(o)},wrapClassName:b,className:E,style:{left:(innerWidth+uo)*tt+"px",transform:"translate3d("+S+"px, 0px, 0)",transition:H||V?void 0:"transform "+Ht+"ms "+Nn},loadingElement:_,brokenElement:N,onPhotoResize:Ne,isActive:Le.current===tt,expose:C})}),!Ks&&p&&et.createElement(et.Fragment,null,(Ie||Ee!==0)&&et.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return X(Ee-1,!0)}},et.createElement(F9,null)),(Ie||Ee+1-1){var g=u.slice();return g.splice(w,1,y),void o({images:g})}o(function(E){return{images:E.images.concat(y)}})},remove:function(y){o(function(w){var g=w.images.filter(function(E){return E.key!==y});return{images:g,index:Math.min(g.length-1,f)}})},show:function(y){var w=u.findIndex(function(g){return g.key===y});o({visible:!0,index:w}),r&&r(!0,w,a)}}),p=Ra({close:function(){o({visible:!1}),r&&r(!1,f,a)},changeIndex:function(y){o({index:y}),n&&n(y,a)}}),m=v.useMemo(function(){return _n({},a,h)},[a,h]);return et.createElement(mI.Provider,{value:m},t,et.createElement(X9,_n({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var yI=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,o=e.height,l=e.triggers,u=l===void 0?["onClick"]:l,d=e.children,f=v.useContext(mI),h=(t=function(){return f.nextId()},(n=v.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=v.useRef(null);v.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),v.useEffect(function(){return function(){f.remove(h)}},[]);var m=Ra({render:function(w){return s&&s(w)},show:function(w,g){f.show(h),function(E,b){if(d){var _=d.props[E];_&&_(b)}}(w,g)}}),y=v.useMemo(function(){var w={};return u.forEach(function(g){w[g]=m.show.bind(null,g)}),w},[]);return v.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:o})},[r]),d?v.Children.only(v.cloneElement(d,_n({},y,{ref:p}))):null};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),yI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const eF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var J9={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 tF={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.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eF=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>v.createElement("svg",{ref:l,...J9,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yI("lucide",s),...o},[...a.map(([u,d])=>v.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** + */const nF=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>v.createElement("svg",{ref:l,...tF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:bI("lucide",s),...o},[...a.map(([u,d])=>v.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Te=(e,t)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(eF,{ref:i,iconNode:t,className:yI(`lucide-${Z9(e)}`,r),...s}));return n.displayName=`${e}`,n};/** + */const Te=(e,t)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(nF,{ref:i,iconNode:t,className:bI(`lucide-${eF(e)}`,r),...s}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tF=Te("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + */const rF=Te("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bI=Te("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const EI=Te("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nF=Te("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** + */const sF=Te("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EI=Te("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const xI=Te("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xI=Te("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const wI=Te("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wI=Te("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** + */const vI=Te("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rF=Te("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + */const iF=Te("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $a=Te("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const Ha=Te("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vI=Te("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const _I=Te("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sF=Te("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + */const aF=Te("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iF=Te("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + */const oF=Te("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ds=Te("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Bs=Te("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ip=Te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const op=Te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aF=Te("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const lF=Te("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const or=Te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const Xn=Te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _I=Te("CircleAlert",[["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"}]]);/** + */const TI=Te("CircleAlert",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oF=Te("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const cF=Te("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lF=Te("CircleX",[["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"}]]);/** + */const uF=Te("CircleX",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cF=Te("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** + */const dF=Te("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vE=Te("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const _E=Te("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _E=Te("Copy",[["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"}]]);/** + */const TE=Te("Copy",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TI=Te("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const NI=Te("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ah=Te("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const lh=Te("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TE=Te("Download",[["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"}]]);/** + */const NE=Te("Download",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uF=Te("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + */const fF=Te("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -201,7 +201,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dF=Te("EyeOff",[["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"}]]);/** + */const hF=Te("EyeOff",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -216,187 +216,187 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fF=Te("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + */const pF=Te("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hF=Te("FilePlus",[["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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** + */const mF=Te("FilePlus",[["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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NI=Te("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const SI=Te("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pF=Te("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** + */const gF=Te("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SI=Te("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** + */const AI=Te("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mF=Te("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** + */const yF=Te("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gF=Te("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/** + */const bF=Te("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NE=Te("FolderUp",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** + */const SE=Te("FolderUp",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AI=Te("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + */const CI=Te("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CI=Te("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const II=Te("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yF=Te("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + */const EF=Te("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lm=Te("Globe",[["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"}]]);/** + */const um=Te("Globe",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bF=Te("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + */const xF=Te("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EF=Te("Headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]]);/** + */const wF=Te("Headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const II=Te("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const RI=Te("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cd=Te("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const Bl=Te("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xF=Te("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** + */const vF=Te("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RI=Te("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + */const OI=Te("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wF=Te("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/** + */const _F=Te("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vF=Te("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** + */const TF=Te("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _F=Te("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** + */const NF=Te("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TF=Te("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** + */const kF=Te("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wt=Te("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const bt=Te("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kF=Te("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + */const SF=Te("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NF=Te("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const AF=Te("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wc=Te("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const Gc=Te("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OI=Te("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + */const LI=Te("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SF=Te("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** + */const CF=Te("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AF=Te("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/** + */const IF=Te("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CF=Te("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const RF=Te("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LI=Te("Network",[["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"}]]);/** + */const MI=Te("Network",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IF=Te("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** + */const OF=Te("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RF=Te("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/** + */const LF=Te("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OF=Te("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const MF=Te("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LF=Te("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const DF=Te("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hs=Te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const ms=Te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SE=Te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const dm=Te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -406,27 +406,27 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MF=Te("Rocket",[["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"}]]);/** + */const PF=Te("Rocket",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MI=Te("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + */const DI=Te("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e1=Te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const t1=Te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DF=Te("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** + */const jF=Te("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PF=Te("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** + */const BF=Te("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -436,42 +436,42 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ha=Te("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + */const za=Te("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DI=Te("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** + */const PI=Te("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jl=Te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const Fl=Te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jF=Te("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const FF=Te("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BF=Te("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + */const UF=Te("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FF=Te("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + */const $F=Te("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UF=Te("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** + */const HF=Te("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $F=Te("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/** + */const zF=Te("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -481,122 +481,122 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gr=Te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),U_="veadk_auth_qs";let cc=null;function HF(){if(cc!==null)return cc;const e=window.location.search.replace(/^\?/,"");return e?(sessionStorage.setItem(U_,e),window.history.replaceState(null,"",window.location.pathname+window.location.hash),cc=e):cc=sessionStorage.getItem(U_)??"",cc}function Os(e){const t=HF();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((r,s)=>{n.searchParams.has(s)||n.searchParams.set(s,r)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const zF=/\brun_sse\s*failed\s*:\s*404\b/i,$_="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function mf(e){const t=String(e);return!zF.test(t)||t.includes($_)?t:`${t} + */const Xr=Te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),U_="veadk_auth_qs";let dc=null;function VF(){if(dc!==null)return dc;const e=window.location.search.replace(/^\?/,"");return e?(sessionStorage.setItem(U_,e),window.history.replaceState(null,"",window.location.pathname+window.location.hash),dc=e):dc=sessionStorage.getItem(U_)??"",dc}function Ms(e){const t=VF();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((r,s)=>{n.searchParams.has(s)||n.searchParams.set(s,r)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const KF=/\brun_sse\s*failed\s*:\s*404\b/i,$_="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function yf(e){const t=String(e);return!KF.test(t)||t.includes($_)?t:`${t} ${$_}`}async function*IE(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let r="";try{for(;;){const{done:s,value:i}=await t.read();if(s)break;r+=n.decode(i,{stream:!0});let a=r.match(/\r?\n\r?\n/);for(;(a==null?void 0:a.index)!==void 0;){const o=r.slice(0,a.index);r=r.slice(a.index+a[0].length);const l=o.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` -`);if(l)try{yield JSON.parse(l)}catch{l!=="[DONE]"&&l!=="ping"&&console.debug(`parseSSE: dropping unparseable frame (${l.length} chars):`,l.slice(0,200))}a=r.match(/\r?\n\r?\n/)}}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const cm=3e4,VF=12e4,PI=1e4;function ti(e,t=cm){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const ap="veadk_local_user",op="veadk_local_user_tab",KF=/^[A-Za-z0-9]{1,16}$/;function jI(){try{const e=sessionStorage.getItem(op);if(e)return e;const t=localStorage.getItem(ap);return t&&sessionStorage.setItem(op,t),t}catch{try{return localStorage.getItem(ap)}catch{return null}}}function H_(e){try{sessionStorage.setItem(op,e)}catch{}try{localStorage.setItem(ap,e)}catch{}}function YF(){try{sessionStorage.removeItem(op)}catch{}try{localStorage.removeItem(ap)}catch{}}function um(e){const t=new Headers(e),n=jI();return n&&t.set("X-VeADK-Local-User",n),t}async function WF(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:ti(void 0,PI)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error("无法加载登录配置,请检查网络后重试。")}if(!e.ok)throw new Error(`登录配置服务异常(HTTP ${e.status}),请稍后重试。`);try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error("登录配置服务返回了无法解析的响应,请稍后重试。")}}function qF(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function GF(){window.location.assign("/oauth2/logout")}async function XF(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:ti(void 0,PI)})}catch(n){throw console.warn("[identity] /oauth2/userinfo is unreachable:",n),new Error("无法连接身份服务,请检查网络后重试。")}if(e.ok){let n;try{n=await e.json()}catch(s){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",s),new Error("身份服务返回了无法解析的响应,请稍后重试。")}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(`身份服务异常(HTTP ${e.status}),请稍后重试。`);const t=jI();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function QF(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function ZF(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const oh="",RE=new Map;function BI(e,t){RE.set(e,t)}function FI(){RE.clear()}function ms(e){const t=RE.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}function At(e,t={},n={},r=cm){const s={...t,headers:um(t.headers),signal:ti(t.signal,r)};if(n.runtimeId){const i=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Os(`${oh}/web/runtime-proxy/${n.runtimeId}${e}${i}`),s)}if(n.base){const i=new Headers(s.headers);return i.set("X-AgentKit-Base",n.base),n.apiKey&&i.set("X-AgentKit-Key",n.apiKey),fetch(Os(`${oh}/agentkit-proxy${e}`),{...s,headers:i})}return fetch(Os(`${oh}${e}`),s)}function JF(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const r=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",s=String(t.msg??"");return r?`${r}: ${s}`:s}return String(t)}).filter(Boolean).join(` -`):e&&typeof e=="object"?JSON.stringify(e):""}async function Zr(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return JF(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function UI(){const e=await At("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class ud extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Ru extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}async function eU(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function dm(e,t,n){const r=await At("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await eU(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new ud;if(n!=null&&n.runtimeId&&r.status===404)throw new Ru("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new Ru("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await Zr(r,"读取 Agent 列表失败"));return r.json()}async function lp(e,t){const{app:n,ep:r}=ms(e),s=await At(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok)throw new Error(`create session failed: ${s.status}`);return(await s.json()).id}async function OE(e,t){const{app:n,ep:r}=ms(e),s=await At(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function cp(e,t,n){const{app:r,ep:s}=ms(e),i=await At(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{},s);if(!i.ok)throw new Error(`get session failed: ${i.status}`);return i.json()}async function t1(e,t,n){const{app:r,ep:s}=ms(e),i=await At(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}async function tU(e){const t=await At("/web/media/capabilities");if(!t.ok)throw new Error(await Zr(t,"media capabilities failed"));return t.json()}async function $I(e,t,n,r){const{app:s}=ms(e),i=new FormData;i.set("app_name",s),i.set("user_id",t),i.set("session_id",n),i.set("file",r);const a=await At("/web/media",{method:"POST",body:i},{},VF);if(!a.ok)throw new Error(await Zr(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function n1(e,t,n){const{app:r}=ms(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await At(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await Zr(i,"media cleanup failed"))}function HI(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((r,s)=>![1,3,5].includes(s)).join("/")}`}catch{return}}async function lh(e,t){const n=HI(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await At(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await Zr(r,"media cleanup failed"))}function zI(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=HI(t);if(!n)return t;const r=`${n}/content`;return Os(`${oh}${r}`)}async function VI(e,t){const{app:n,ep:r}=ms(e),s=await At(`/dev/apps/${encodeURIComponent(n)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(`trace failed: ${s.status}`);const i=s.headers.get("content-type")??"";if(!i.includes("application/json")){const o=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${o}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}async function KI(e,t){const n=await At(`/web/agent-info/${e}`,{},t);if(!n.ok)throw new Error(`agent-info failed: ${n.status}`);const r=await n.json();return{name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph}}async function dd(e){const{app:t,ep:n}=ms(e);return KI(t,n)}async function YI(e,t){const n={runtimeId:e,region:t},s=(await dm("","",n))[0];if(!s)throw new Error("该 Runtime 未提供可预览的 Agent。");return KI(s,n)}async function WI(e,t,n,r){const{app:s,ep:i}=ms(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),o=await At(`/web/search?${a.toString()}`,{},i);if(!o.ok)throw new Error(await Zr(o,"Agent 检索失败"));return o.json()}async function qI(e,t){const{app:n}=ms(e),r=await At(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!r.ok)throw new Error(`web search failed: ${r.status}`);return r.json()}async function*Ou({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:o}){const{app:l,ep:u}=ms(e),d=s.flatMap(m=>m.status&&m.status!=="ready"?[]:m.uri?[{fileData:{mimeType:m.mimeType,fileUri:m.uri,displayName:m.name},partMetadata:{veadkMedia:{id:m.id,uri:m.uri,name:m.name,mimeType:m.mimeType,sizeBytes:m.sizeBytes}}}]:m.data?[{inlineData:{mimeType:m.mimeType,data:m.data,displayName:m.name}}]:[]),f=i&&(i.skills.length>0||i.targetAgent)?i:void 0,h=[...d,...a.map(m=>({functionResponse:{id:m.id,name:m.name,response:m.response}})),...r.trim()?[{text:r}]:[]];if(f&&h.length>0){const m=h[0],b=m.partMetadata;h[0]={...m,partMetadata:{...b,veadkInvocation:f}}}const p=await At("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:l,user_id:t,session_id:n,new_message:{role:"user",parts:h},streaming:!0,custom_metadata:f?{veadkInvocation:f}:void 0}),signal:o},u,0);if(!p.ok)throw new Error(mf(`run_sse failed: ${p.status}`));for await(const m of IE(p)){const b=m;typeof b.error=="string"&&(b.error=mf(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=mf(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=mf(b.error_message)),yield b}}const qc=new Map;async function LE(e,t,n,r){var u;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&qc.set(s,i);const a=()=>{s&&qc.get(s)===i&&qc.delete(s)};let o;try{o=await At("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:i==null?void 0:i.signal,body:JSON.stringify({name:e,files:t,config:n,taskId:s,im:r==null?void 0:r.im,envs:r==null?void 0:r.envs})},{},0)}catch(d){throw a(),d}if(!o.ok){const d=await o.text().catch(()=>"");throw a(),new Error(d||`部署失败 (${o.status})`)}let l=null;try{for await(const d of IE(o)){const f=d;if(f&&f.done){l=f;break}f&&f.message&&((u=r==null?void 0:r.onStage)==null||u.call(r,f))}}catch(d){throw a(),d}if(a(),!l)throw new Error("部署失败:连接中断");if(!l.success)throw new Error(l.error||"部署失败");if(!l.agentName)throw new Error("部署失败:返回缺少 Agent 名称");if(!l.runtimeId&&!l.url)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:l.apikey??"",url:l.url??"",agentName:l.agentName,runtimeId:l.runtimeId,consoleUrl:l.consoleUrl,region:l.region,feishuChannel:l.feishuChannel}}async function GI(e){var n;const t=await At("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(r||`取消部署失败 (${t.status})`)}(n=qc.get(e))==null||n.abort(),qc.delete(e)}async function XI(e="cn-beijing"){const t=await At(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Lu={title:"VeADK Studio",logoUrl:""},Ug={studio:!1,branding:Lu,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function QI(){var e,t;try{const n=await At("/web/ui-config");if(!n.ok)return Ug;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Lu.logoUrl;return{studio:r.studio??!1,branding:{title:typeof((t=r.branding)==null?void 0:t.title)=="string"?r.branding.title:Lu.title,logoUrl:s?Os(s):""},features:{...Ug.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return Ug}}const ZI={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function JI(){var n,r,s;const e=await At("/web/access");if(!e.ok)throw new Error(`加载权限失败 (${e.status})`);const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.capabilities)==null?void 0:n.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.manageAgents)!="boolean"||!["all","mine"].includes((s=t.capabilities)==null?void 0:s.runtimeScope))throw new Error("权限服务返回了无法解析的响应");return t}async function ch(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await At(`/web/runtimes?${t.toString()}`);if(!n.ok)throw new Error(`加载 Runtime 失败 (${n.status})`);const r=await n.json();return{runtimes:r.runtimes??[],nextToken:r.nextToken??""}}async function eR(e,t="cn-beijing"){try{return await dm("","",{runtimeId:e,region:t})}catch(n){if(n instanceof ud||n instanceof Ru)throw n;return null}}async function tR(e,t="cn-beijing"){const n=await At("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(r||`删除失败 (${n.status})`)}}async function ME(e,t="cn-beijing"){const n=await At(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Zr(n,"加载 Runtime 详情失败"));return n.json()}async function up(e){const t=await At("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Zr(t,"生成项目失败"));return t.json()}async function nR(e){const t=await At("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Zr(t,"创建调试运行失败"));return t.json()}async function rR(e,t){const n=await At(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Zr(n,"创建调试会话失败"));return(await n.json()).id}async function*sR({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await At(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:i},streaming:!0}),signal:s},{},0);if(!a.ok)throw new Error(await Zr(a,"调试运行失败"));for await(const o of IE(a))yield o}async function r1(e){const t=await At(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Zr(t,"清理调试运行失败"))}const nU=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Lu,DEFAULT_STUDIO_ACCESS:ZI,RuntimeAccessDeniedError:ud,RuntimeProbeError:Ru,cancelAgentkitDeployment:GI,clearRemoteApps:FI,componentSearch:WI,createGeneratedAgentTestRun:nR,createGeneratedAgentTestSession:rR,createSession:lp,deleteGeneratedAgentTestRun:r1,deleteMedia:lh,deleteRuntime:tR,deleteSession:t1,deleteSessionMedia:n1,deployAgentkitProject:LE,fetchRemoteApps:dm,generateAgentProject:up,getAgentInfo:dd,getMediaCapabilities:tU,getMyRuntimes:XI,getRuntimeAgentInfo:YI,getRuntimeDetail:ME,getRuntimes:ch,getSession:cp,getSessionTrace:VI,getStudioAccess:JI,getUiConfig:QI,listApps:UI,listSessions:OE,mediaContentUrl:zI,probeRuntimeApps:eR,registerRemoteApp:BI,runGeneratedAgentTestSSE:sR,runSSE:Ou,uploadMedia:$I,webSearch:qI},Symbol.toStringTag,{value:"Module"})),rU="send_a2ui_json_to_client",sU="validated_a2ui_json",s1="adk_request_credential";function iU(e){var r,s,i,a;const t=e,n=((r=t==null?void 0:t.exchangedAuthCredential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.exchanged_auth_credential)==null?void 0:s.oauth2)??((i=t==null?void 0:t.rawAuthCredential)==null?void 0:i.oauth2)??((a=t==null?void 0:t.raw_auth_credential)==null?void 0:a.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function qs(){return{blocks:[],liveStart:0}}const z_=e=>e.functionCall??e.function_call,i1=e=>e.functionResponse??e.function_response;function aU(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function iR(e){const t=[];for(const[n,r]of e.entries()){const s=r.partMetadata??r.part_metadata,i=s==null?void 0:s.veadkTransport;if((i==null?void 0:i.hidden)===!0)continue;const a=s==null?void 0:s.veadkMedia;if(typeof(a==null?void 0:a.uri)=="string"){t.push({id:String(a.id??a.uri),mimeType:typeof a.mimeType=="string"?a.mimeType:void 0,uri:a.uri,name:typeof a.name=="string"?a.name:void 0,sizeBytes:typeof a.sizeBytes=="number"?a.sizeBytes:void 0});continue}const o=r.inlineData??r.inline_data;if(o&&o.data){t.push({id:`inline-${n}-${o.displayName??o.display_name??"media"}`,mimeType:o.mimeType??o.mime_type,data:aU(o.data),name:o.displayName??o.display_name});continue}const l=r.fileData??r.file_data,u=(l==null?void 0:l.fileUri)??(l==null?void 0:l.file_uri);l&&u&&t.push({id:u,mimeType:l.mimeType??l.mime_type,uri:u,name:l.displayName??l.display_name})}return t}function a1(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const oU=new Set(["llm","sequential","parallel","loop","a2a"]);function lU(e){var t;for(const n of e){const r=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!r||typeof r!="object")continue;const s=r,i=Array.isArray(s.skills)?s.skills.flatMap(l=>{if(!l||typeof l!="object")return[];const u=l;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let a;const o=s.targetAgent;if(o&&typeof o=="object"){const l=o,u=l.type;typeof l.name=="string"&&typeof u=="string"&&oU.has(u)&&Array.isArray(l.path)&&(a={name:l.name,description:typeof l.description=="string"?l.description:"",type:u,path:l.path.filter(d=>typeof d=="string")})}if(i.length>0||a)return{skills:i,targetAgent:a}}}function cU(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function V_(e,t,n){const r=e[e.length-1];r&&r.kind===t?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function gf(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function pl(e,t){var a,o;const n=e.blocks.map(l=>({...l}));let r=e.liveStart;const s=((a=t.content)==null?void 0:a.parts)??[],i=s.some(l=>z_(l)||i1(l));if(t.partial&&!i){for(const l of s){const u=a1(l);typeof u=="string"&&u&&V_(n,l.thought?"thinking":"text",u)}return{blocks:n,liveStart:r}}n.length=r;for(const l of s){const u=z_(l),d=i1(l),f=iR([l]),h=a1(l);if(typeof h=="string"&&h)V_(n,l.thought?"thinking":"text",h);else if(f.length)gf(n),cU(n,f);else if(u)if(gf(n),u.name===s1){const p=u.args??{},m=p.authConfig??p.auth_config??p,w=String(p.functionCallId??p.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:u.id??"",label:w,authUri:iU(m),authConfig:m,done:!1})}else n.push({kind:"tool",name:u.name??"",args:u.args,done:!1});else if(d){if(gf(n),d.name===s1)for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="auth"&&!m.done){m.done=!0;break}}for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="tool"&&!m.done&&m.name===d.name){m.done=!0,m.response=d.response;break}}if(d.name===rU){const p=((o=d.response)==null?void 0:o[sU])??[];if(p.length){const m=n[n.length-1];m&&m.kind==="a2ui"?m.messages.push(...p):n.push({kind:"a2ui",messages:p})}}}}return gf(n),r=n.length,{blocks:n,liveStart:r}}function uU(e){var r;const t=[];let n=qs();for(const s of e)if(s.author==="user"){const a=((r=s.content)==null?void 0:r.parts)??[];if(a.some(f=>{var h;return((h=i1(f))==null?void 0:h.name)===s1})){for(let f=t.length-1;f>=0;f--)if(t[f].role==="assistant"){for(let h=t[f].blocks.length-1;h>=0;h--){const p=t[f].blocks[h];if(p.kind==="auth"){p.done=!0;break}}break}}const o=a.map(a1).filter(f=>!!f).join(""),l=iR(a),u=lU(a);if(!o&&!l.length&&!u){n=qs();continue}const d=[];u&&d.push({kind:"invocation",value:u}),l.length&&d.push({kind:"attachment",files:l}),o&&d.push({kind:"text",text:o}),t.push({role:"user",blocks:d,meta:{ts:s.timestamp}}),n=qs()}else{let a=t[t.length-1];(!a||a.role!=="assistant")&&(a={role:"assistant",blocks:[],meta:{}},t.push(a),n=qs()),n=pl(n,s),a.blocks=n.blocks;const o=s.usageMetadata??s.usage_metadata,l=a.meta??(a.meta={});o!=null&&o.totalTokenCount&&(l.tokens=o.totalTokenCount),s.timestamp&&(l.ts=s.timestamp)}return t}function aR(e){var t,n;for(const r of e??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const s=(((n=r.content)==null?void 0:n.parts)??[]).map(i=>i.text).find(Boolean);if(s)return s}return"新会话"}async function fd(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:ti(void 0,cm)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 AgentKit Skills 中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit Skills 中心");if(t.status===404)throw new Error("技能不存在或无 SKILL.md 内容");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function dU(){return(await fd("/web/skill-spaces?region=all")).items||[]}async function fU(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),fd(`/web/skill-spaces?${t.toString()}`)}async function hU(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await fd(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function pU(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),fd(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function mU(e,t,n,r,s){const i=[];n&&i.push(`version=${encodeURIComponent(n)}`),r&&i.push(`region=${encodeURIComponent(r)}`),s&&i.push(`project=${encodeURIComponent(s)}`);const a=i.length>0?`?${i.join("&")}`:"";return fd(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function gU(e,t){return{source:"skillspace",id:`ss:${e.id}/${t.skillId}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:t.skillId,version:t.version}}function yU(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}function ede(){}function K_(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&t.push(a),s=r+1,r=n.indexOf(",",s)}return t}function oR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const bU=/[$_\p{ID_Start}]/u,EU=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,xU=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,wU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lR={};function tde(e){return e?bU.test(String.fromCodePoint(e)):!1}function nde(e,t){const r=(t||lR).jsx?xU:EU;return e?r.test(String.fromCodePoint(e)):!1}function Y_(e,t){return(lR.jsx?vU:wU).test(e)}const _U=/[ \t\n\f\r]/g;function TU(e){return typeof e=="object"?e.type==="text"?W_(e.value):!1:W_(e)}function W_(e){return e.replace(_U,"")===""}let hd=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};hd.prototype.normal={};hd.prototype.property={};hd.prototype.space=void 0;function cR(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new hd(n,r,t)}function Mu(e){return e.toLowerCase()}class xr{constructor(t,n){this.attribute=n,this.property=t}}xr.prototype.attribute="";xr.prototype.booleanish=!1;xr.prototype.boolean=!1;xr.prototype.commaOrSpaceSeparated=!1;xr.prototype.commaSeparated=!1;xr.prototype.defined=!1;xr.prototype.mustUseProperty=!1;xr.prototype.number=!1;xr.prototype.overloadedBoolean=!1;xr.prototype.property="";xr.prototype.spaceSeparated=!1;xr.prototype.space=void 0;let kU=0;const Je=eo(),yn=eo(),o1=eo(),be=eo(),Mt=eo(),Qo=eo(),kr=eo();function eo(){return 2**++kU}const l1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:yn,commaOrSpaceSeparated:kr,commaSeparated:Qo,number:be,overloadedBoolean:o1,spaceSeparated:Mt},Symbol.toStringTag,{value:"Module"})),$g=Object.keys(l1);class DE extends xr{constructor(t,n,r,s){let i=-1;if(super(t,n),q_(this,"space",s),typeof r=="number")for(;++i<$g.length;){const a=$g[i];q_(this,$g[i],(r&l1[a])===l1[a])}}}DE.prototype.defined=!0;function q_(e,t,n){n&&(e[t]=n)}function Bl(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new DE(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Mu(r)]=r,n[Mu(i.attribute)]=r}return new hd(t,n,e.space)}const uR=Bl({properties:{ariaActiveDescendant:null,ariaAtomic:yn,ariaAutoComplete:null,ariaBusy:yn,ariaChecked:yn,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:Mt,ariaCurrent:null,ariaDescribedBy:Mt,ariaDetails:null,ariaDisabled:yn,ariaDropEffect:Mt,ariaErrorMessage:null,ariaExpanded:yn,ariaFlowTo:Mt,ariaGrabbed:yn,ariaHasPopup:null,ariaHidden:yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Mt,ariaLevel:be,ariaLive:null,ariaModal:yn,ariaMultiLine:yn,ariaMultiSelectable:yn,ariaOrientation:null,ariaOwns:Mt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:yn,ariaReadOnly:yn,ariaRelevant:null,ariaRequired:yn,ariaRoleDescription:Mt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:yn,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dR(e,t){return t in e?e[t]:t}function fR(e,t){return dR(e,t.toLowerCase())}const NU=Bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qo,acceptCharset:Mt,accessKey:Mt,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:Mt,autoFocus:Je,autoPlay:Je,blocking:Mt,capture:null,charSet:null,checked:Je,cite:null,className:Mt,cols:be,colSpan:null,content:null,contentEditable:yn,controls:Je,controlsList:Mt,coords:be|Qo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:o1,draggable:yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:Mt,height:be,hidden:o1,high:be,href:null,hrefLang:null,htmlFor:Mt,httpEquiv:Mt,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:Mt,itemRef:Mt,itemScope:Je,itemType:Mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Je,optimum:be,pattern:null,ping:Mt,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:Mt,required:Je,reversed:Je,rows:be,rowSpan:be,sandbox:Mt,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:yn,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Mt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:yn,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Je,disableRemotePlayback:Je,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:fR}),SU=Bl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:kr,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:Mt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Qo,g2:Qo,glyphName:Qo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:kr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kr,rev:kr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kr,requiredFeatures:kr,requiredFonts:kr,requiredFormats:kr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:kr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kr,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dR}),hR=Bl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),pR=Bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fR}),mR=Bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),AU={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},CU=/[A-Z]/g,G_=/-[a-z]/g,IU=/^data[-\w.:]+$/i;function fm(e,t){const n=Mu(t);let r=t,s=xr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&IU.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(G_,OU);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!G_.test(i)){let a=i.replace(CU,RU);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=DE}return new s(r,t)}function RU(e){return"-"+e.toLowerCase()}function OU(e){return e.charAt(1).toUpperCase()}const pd=cR([uR,NU,hR,pR,mR],"html"),ea=cR([uR,SU,hR,pR,mR],"svg");function X_(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function gR(e){return e.join(" ").trim()}var PE={},Q_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,LU=/\n/g,MU=/^\s*/,DU=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,PU=/^:\s*/,jU=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,BU=/^[;\s]*/,FU=/^\s+|\s+$/g,UU=` -`,Z_="/",J_="*",ba="",$U="comment",HU="declaration";function zU(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var b=m.match(LU);b&&(n+=b.length);var w=m.lastIndexOf(UU);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(b){return b.position=new a(m),u(),b}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(m){var b=new Error(t.source+":"+n+":"+r+": "+m);if(b.reason=m,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(m){var b=m.exec(e);if(b){var w=b[0];return s(w),e=e.slice(w.length),b}}function u(){l(MU)}function d(m){var b;for(m=m||[];b=f();)b!==!1&&m.push(b);return m}function f(){var m=i();if(!(Z_!=e.charAt(0)||J_!=e.charAt(1))){for(var b=2;ba!=e.charAt(b)&&(J_!=e.charAt(b)||Z_!=e.charAt(b+1));)++b;if(b+=2,ba===e.charAt(b-1))return o("End of comment missing");var w=e.slice(2,b-2);return r+=2,s(w),e=e.slice(b),r+=2,m({type:$U,comment:w})}}function h(){var m=i(),b=l(DU);if(b){if(f(),!l(PU))return o("property missing ':'");var w=l(jU),g=m({type:HU,property:eT(b[0].replace(Q_,ba)),value:w?eT(w[0].replace(Q_,ba)):ba});return l(BU),g}}function p(){var m=[];d(m);for(var b;b=h();)b!==!1&&(m.push(b),d(m));return m}return u(),p()}function eT(e){return e?e.replace(FU,ba):ba}var VU=zU,KU=Nh&&Nh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PE,"__esModule",{value:!0});PE.default=WU;const YU=KU(VU);function WU(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,YU.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:o}=i;s?t(a,o,i):o&&(n=n||{},n[a]=o)}),n}var hm={};Object.defineProperty(hm,"__esModule",{value:!0});hm.camelCase=void 0;var qU=/^--[a-zA-Z0-9_-]+$/,GU=/-([a-z])/g,XU=/^[^-]+$/,QU=/^-(webkit|moz|ms|o|khtml)-/,ZU=/^-(ms)-/,JU=function(e){return!e||XU.test(e)||qU.test(e)},e7=function(e,t){return t.toUpperCase()},tT=function(e,t){return"".concat(t,"-")},t7=function(e,t){return t===void 0&&(t={}),JU(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(ZU,tT):e=e.replace(QU,tT),e.replace(GU,e7))};hm.camelCase=t7;var n7=Nh&&Nh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},r7=n7(PE),s7=hm;function c1(e,t){var n={};return!e||typeof e!="string"||(0,r7.default)(e,function(r,s){r&&s&&(n[(0,s7.camelCase)(r,t)]=s)}),n}c1.default=c1;var i7=c1;const a7=Ju(i7),pm=yR("end"),Ps=yR("start");function yR(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function o7(e){const t=Ps(e),n=pm(e);if(t&&n)return{start:t,end:n}}function Gc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nT(e.position):"start"in e||"end"in e?nT(e):"line"in e||"column"in e?u1(e):""}function u1(e){return rT(e&&e.line)+":"+rT(e&&e.column)}function nT(e){return u1(e&&e.start)+"-"+u1(e&&e.end)}function rT(e){return e&&typeof e=="number"?e:1}class Qn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(a=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Gc(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qn.prototype.file="";Qn.prototype.name="";Qn.prototype.reason="";Qn.prototype.message="";Qn.prototype.stack="";Qn.prototype.column=void 0;Qn.prototype.line=void 0;Qn.prototype.ancestors=void 0;Qn.prototype.cause=void 0;Qn.prototype.fatal=void 0;Qn.prototype.place=void 0;Qn.prototype.ruleId=void 0;Qn.prototype.source=void 0;const jE={}.hasOwnProperty,l7=new Map,c7=/[A-Z]/g,u7=new Set(["table","tbody","thead","tfoot","tr"]),d7=new Set(["td","th"]),bR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function f7(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=x7(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=E7(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ea:pd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=ER(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function ER(e,t,n){if(t.type==="element")return h7(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return p7(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return g7(e,t,n);if(t.type==="mdxjsEsm")return m7(e,t);if(t.type==="root")return y7(e,t,n);if(t.type==="text")return b7(e,t)}function h7(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ea,e.schema=s),e.ancestors.push(t);const i=wR(e,t.tagName,!1),a=w7(e,t);let o=FE(e,t);return u7.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!TU(l):!0})),xR(e,a,i,t),BE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function p7(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Du(e,t.position)}function m7(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Du(e,t.position)}function g7(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ea,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:wR(e,t.name,!0),a=v7(e,t),o=FE(e,t);return xR(e,a,i,t),BE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function y7(e,t,n){const r={};return BE(r,FE(e,t)),e.create(t,e.Fragment,r,n)}function b7(e,t){return t.value}function xR(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function BE(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function E7(e,t,n){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?n:t;return o?u(i,a,o):u(i,a)}}function x7(e,t){return n;function n(r,s,i,a){const o=Array.isArray(i.children),l=Ps(r);return t(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function w7(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&jE.call(t.properties,s)){const i=_7(e,s,t.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&d7.has(t.tagName)?r=o:n[a]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function v7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Du(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else Du(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function FE(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:l7;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i0?(Rr(e,e.length,0,t),e):t}const aT={}.hasOwnProperty;function _R(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ds(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ir=ta(/[A-Za-z]/),Gn=ta(/[\dA-Za-z]/),O7=ta(/[#-'*+\--9=?A-Z^-~]/);function dp(e){return e!==null&&(e<32||e===127)}const d1=ta(/\d/),L7=ta(/[\dA-Fa-f]/),M7=ta(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function Ct(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const mm=ta(new RegExp("\\p{P}|\\p{S}","u")),za=ta(/\s/);function ta(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fl(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function dt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return it(l)?(e.enter(n),o(l)):t(l)}function o(l){return it(l)&&i++a))return;const C=t.events.length;let N=C,R,I;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(R){I=t.events[N][1].end;break}R=!0}for(g(r),T=C;Ty;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=y}function E(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function F7(e,t,n){return dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ml(e){if(e===null||Ct(e)||za(e))return 1;if(mm(e))return 2}function gm(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};lT(f,-l),lT(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=$r(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=$r(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=$r(u,gm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=$r(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=$r(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Rr(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&it(T)?dt(e,E,"linePrefix",i+1)(T):E(T)}function E(T){return T===null||Fe(T)?e.check(cT,b,_)(T):(e.enter("codeFlowValue"),y(T))}function y(T){return T===null||Fe(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),y)}function _(T){return e.exit("codeFenced"),t(T)}function k(T,C,N){let R=0;return I;function I(U){return T.enter("lineEnding"),T.consume(U),T.exit("lineEnding"),M}function M(U){return T.enter("codeFencedFence"),it(U)?dt(T,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):B(U)}function B(U){return U===o?(T.enter("codeFencedFenceSequence"),Y(U)):N(U)}function Y(U){return U===o?(R++,T.consume(U),Y):R>=a?(T.exit("codeFencedFenceSequence"),it(U)?dt(T,P,"whitespace")(U):P(U)):N(U)}function P(U){return U===null||Fe(U)?(T.exit("codeFencedFence"),C(U)):N(U)}}}function Q7(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const zg={name:"codeIndented",tokenize:J7},Z7={partial:!0,tokenize:e$};function J7(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),dt(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):Fe(u)?e.attempt(Z7,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Fe(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function e$(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):Fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):dt(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):Fe(a)?s(a):n(a)}}const t$={name:"codeText",previous:r$,resolve:n$,tokenize:s$};function n$(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&uc(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),uc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),uc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function CR(e,t,n,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||dp(g)?n(g):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(o),h(g)):g===null||g===60||Fe(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function b(g){return!d&&(g===null||g===41||Ct(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):d999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):Fe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Fe(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!it(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function RR(e,t,n,r,s,i){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===a?(e.exit(i),l(a)):h===null?n(h):Fe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),dt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Fe(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Xc(e,t){let n;return r;function r(s){return Fe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):it(s)?dt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const f$={name:"definition",tokenize:p$},h$={partial:!0,tokenize:m$};function p$(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return IR.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return s=ds(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Ct(p)?Xc(e,u)(p):u(p)}function u(p){return CR(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(h$,f,f)(p)}function f(p){return it(p)?dt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Fe(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function m$(e,t,n){return r;function r(o){return Ct(o)?Xc(e,s)(o):n(o)}function s(o){return RR(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return it(o)?dt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Fe(o)?t(o):n(o)}}const g$={name:"hardBreakEscape",tokenize:y$};function y$(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Fe(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const b$={name:"headingAtx",resolve:E$,tokenize:x$};function E$(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Rr(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function x$(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||Ct(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Fe(d)?(e.exit("atxHeading"),t(d)):it(d)?dt(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||Ct(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const w$=["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"],dT=["pre","script","style","textarea"],v$={concrete:!0,name:"htmlFlow",resolveTo:k$,tokenize:N$},_$={partial:!0,tokenize:A$},T$={partial:!0,tokenize:S$};function k$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function N$(e,t,n){const r=this;let s,i,a,o,l;return u;function u(D){return d(D)}function d(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),f}function f(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),i=!0,b):D===63?(e.consume(D),s=3,r.interrupt?t:S):ir(D)?(e.consume(D),a=String.fromCharCode(D),w):n(D)}function h(D){return D===45?(e.consume(D),s=2,p):D===91?(e.consume(D),s=5,o=0,m):ir(D)?(e.consume(D),s=4,r.interrupt?t:S):n(D)}function p(D){return D===45?(e.consume(D),r.interrupt?t:S):n(D)}function m(D){const ne="CDATA[";return D===ne.charCodeAt(o++)?(e.consume(D),o===ne.length?r.interrupt?t:B:m):n(D)}function b(D){return ir(D)?(e.consume(D),a=String.fromCharCode(D),w):n(D)}function w(D){if(D===null||D===47||D===62||Ct(D)){const ne=D===47,J=a.toLowerCase();return!ne&&!i&&dT.includes(J)?(s=1,r.interrupt?t(D):B(D)):w$.includes(a.toLowerCase())?(s=6,ne?(e.consume(D),g):r.interrupt?t(D):B(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):i?E(D):y(D))}return D===45||Gn(D)?(e.consume(D),a+=String.fromCharCode(D),w):n(D)}function g(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function E(D){return it(D)?(e.consume(D),E):I(D)}function y(D){return D===47?(e.consume(D),I):D===58||D===95||ir(D)?(e.consume(D),_):it(D)?(e.consume(D),y):I(D)}function _(D){return D===45||D===46||D===58||D===95||Gn(D)?(e.consume(D),_):k(D)}function k(D){return D===61?(e.consume(D),T):it(D)?(e.consume(D),k):y(D)}function T(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),l=D,C):it(D)?(e.consume(D),T):N(D)}function C(D){return D===l?(e.consume(D),l=null,R):D===null||Fe(D)?n(D):(e.consume(D),C)}function N(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Ct(D)?k(D):(e.consume(D),N)}function R(D){return D===47||D===62||it(D)?y(D):n(D)}function I(D){return D===62?(e.consume(D),M):n(D)}function M(D){return D===null||Fe(D)?B(D):it(D)?(e.consume(D),M):n(D)}function B(D){return D===45&&s===2?(e.consume(D),A):D===60&&s===1?(e.consume(D),L):D===62&&s===4?(e.consume(D),H):D===63&&s===3?(e.consume(D),S):D===93&&s===5?(e.consume(D),j):Fe(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(_$,V,Y)(D)):D===null||Fe(D)?(e.exit("htmlFlowData"),Y(D)):(e.consume(D),B)}function Y(D){return e.check(T$,P,V)(D)}function P(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return D===null||Fe(D)?Y(D):(e.enter("htmlFlowData"),B(D))}function A(D){return D===45?(e.consume(D),S):B(D)}function L(D){return D===47?(e.consume(D),a="",O):B(D)}function O(D){if(D===62){const ne=a.toLowerCase();return dT.includes(ne)?(e.consume(D),H):B(D)}return ir(D)&&a.length<8?(e.consume(D),a+=String.fromCharCode(D),O):B(D)}function j(D){return D===93?(e.consume(D),S):B(D)}function S(D){return D===62?(e.consume(D),H):D===45&&s===2?(e.consume(D),S):B(D)}function H(D){return D===null||Fe(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),H)}function V(D){return e.exit("htmlFlow"),t(D)}}function S$(e,t,n){const r=this;return s;function s(a){return Fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function A$(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(md,t,n)}}const C$={name:"htmlText",tokenize:I$};function I$(e,t,n){const r=this;let s,i,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),u):S===47?(e.consume(S),k):S===63?(e.consume(S),y):ir(S)?(e.consume(S),N):n(S)}function u(S){return S===45?(e.consume(S),d):S===91?(e.consume(S),i=0,m):ir(S)?(e.consume(S),E):n(S)}function d(S){return S===45?(e.consume(S),p):n(S)}function f(S){return S===null?n(S):S===45?(e.consume(S),h):Fe(S)?(a=f,L(S)):(e.consume(S),f)}function h(S){return S===45?(e.consume(S),p):f(S)}function p(S){return S===62?A(S):S===45?h(S):f(S)}function m(S){const H="CDATA[";return S===H.charCodeAt(i++)?(e.consume(S),i===H.length?b:m):n(S)}function b(S){return S===null?n(S):S===93?(e.consume(S),w):Fe(S)?(a=b,L(S)):(e.consume(S),b)}function w(S){return S===93?(e.consume(S),g):b(S)}function g(S){return S===62?A(S):S===93?(e.consume(S),g):b(S)}function E(S){return S===null||S===62?A(S):Fe(S)?(a=E,L(S)):(e.consume(S),E)}function y(S){return S===null?n(S):S===63?(e.consume(S),_):Fe(S)?(a=y,L(S)):(e.consume(S),y)}function _(S){return S===62?A(S):y(S)}function k(S){return ir(S)?(e.consume(S),T):n(S)}function T(S){return S===45||Gn(S)?(e.consume(S),T):C(S)}function C(S){return Fe(S)?(a=C,L(S)):it(S)?(e.consume(S),C):A(S)}function N(S){return S===45||Gn(S)?(e.consume(S),N):S===47||S===62||Ct(S)?R(S):n(S)}function R(S){return S===47?(e.consume(S),A):S===58||S===95||ir(S)?(e.consume(S),I):Fe(S)?(a=R,L(S)):it(S)?(e.consume(S),R):A(S)}function I(S){return S===45||S===46||S===58||S===95||Gn(S)?(e.consume(S),I):M(S)}function M(S){return S===61?(e.consume(S),B):Fe(S)?(a=M,L(S)):it(S)?(e.consume(S),M):R(S)}function B(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),s=S,Y):Fe(S)?(a=B,L(S)):it(S)?(e.consume(S),B):(e.consume(S),P)}function Y(S){return S===s?(e.consume(S),s=void 0,U):S===null?n(S):Fe(S)?(a=Y,L(S)):(e.consume(S),Y)}function P(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Ct(S)?R(S):(e.consume(S),P)}function U(S){return S===47||S===62||Ct(S)?R(S):n(S)}function A(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function L(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),O}function O(S){return it(S)?dt(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):j(S)}function j(S){return e.enter("htmlTextData"),a(S)}}const HE={name:"labelEnd",resolveAll:M$,resolveTo:D$,tokenize:P$},R$={tokenize:j$},O$={tokenize:B$},L$={tokenize:F$};function M$(e){let t=-1;const n=[];for(;++t=3&&(u===null||Fe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),it(u)?dt(e,o,"whitespace")(u):o(u))}}const fr={continuation:{tokenize:G$},exit:Q$,name:"list",tokenize:q$},Y$={partial:!0,tokenize:Z$},W$={partial:!0,tokenize:X$};function q$(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:d1(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(uh,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return d1(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(md,r.interrupt?n:d,e.attempt(Y$,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return it(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function G$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(md,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,dt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!it(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(W$,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,dt(e,e.attempt(fr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function X$(e,t,n){const r=this;return dt(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function Q$(e){e.exit(this.containerState.type)}function Z$(e,t,n){const r=this;return dt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!it(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const fT={name:"setextUnderline",resolveTo:J$,tokenize:eH};function J$(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function eH(e,t,n){const r=this;let s;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),it(u)?dt(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Fe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const tH={tokenize:nH};function nH(e){const t=this,n=e.attempt(md,r,e.attempt(this.parser.constructs.flowInitial,s,dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(o$,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const rH={resolveAll:LR()},sH=OR("string"),iH=OR("text");function OR(e){return{resolveAll:LR(e==="text"?aH:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,o);return a;function a(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=s[d];let h=-1;if(f)for(;++h-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function EH(e,t){let n=-1;const r=[];let s;for(;++n{var n;if(t&&typeof t=="object"&&"msg"in t){const r=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",s=String(t.msg??"");return r?`${r}: ${s}`:s}return String(t)}).filter(Boolean).join(` +`):e&&typeof e=="object"?JSON.stringify(e):""}async function Jr(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return tU(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function $I(){const e=await Nt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class fd extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Lu extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}async function nU(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function hm(e,t,n){const r=await Nt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await nU(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new fd;if(n!=null&&n.runtimeId&&r.status===404)throw new Lu("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new Lu("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await Jr(r,"读取 Agent 列表失败"));return r.json()}async function up(e,t){const{app:n,ep:r}=ys(e),s=await Nt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok)throw new Error(`create session failed: ${s.status}`);return(await s.json()).id}async function OE(e,t){const{app:n,ep:r}=ys(e),s=await Nt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function dp(e,t,n){const{app:r,ep:s}=ys(e),i=await Nt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{},s);if(!i.ok)throw new Error(`get session failed: ${i.status}`);return i.json()}async function n1(e,t,n){const{app:r,ep:s}=ys(e),i=await Nt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}async function rU(e){const t=await Nt("/web/media/capabilities");if(!t.ok)throw new Error(await Jr(t,"media capabilities failed"));return t.json()}async function HI(e,t,n,r){const{app:s}=ys(e),i=new FormData;i.set("app_name",s),i.set("user_id",t),i.set("session_id",n),i.set("file",r);const a=await Nt("/web/media",{method:"POST",body:i},{},YF);if(!a.ok)throw new Error(await Jr(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function r1(e,t,n){const{app:r}=ys(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await Nt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await Jr(i,"media cleanup failed"))}function zI(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((r,s)=>![1,3,5].includes(s)).join("/")}`}catch{return}}async function uh(e,t){const n=zI(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await Nt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await Jr(r,"media cleanup failed"))}function VI(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=zI(t);if(!n)return t;const r=`${n}/content`;return Ms(`${ch}${r}`)}async function KI(e,t){const{app:n,ep:r}=ys(e),s=await Nt(`/dev/apps/${encodeURIComponent(n)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(`trace failed: ${s.status}`);const i=s.headers.get("content-type")??"";if(!i.includes("application/json")){const o=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${o}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}async function YI(e,t){const n=await Nt(`/web/agent-info/${e}`,{},t);if(!n.ok)throw new Error(`agent-info failed: ${n.status}`);const r=await n.json();return{name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph}}async function hd(e){const{app:t,ep:n}=ys(e);return YI(t,n)}async function WI(e,t){const n={runtimeId:e,region:t},s=(await hm("","",n))[0];if(!s)throw new Error("该 Runtime 未提供可预览的 Agent。");return YI(s,n)}async function qI(e,t,n,r){const{app:s,ep:i}=ys(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),o=await Nt(`/web/search?${a.toString()}`,{},i);if(!o.ok)throw new Error(await Jr(o,"Agent 检索失败"));return o.json()}async function GI(e,t){const{app:n}=ys(e),r=await Nt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!r.ok)throw new Error(`web search failed: ${r.status}`);return r.json()}async function*Mu({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:o}){const{app:l,ep:u}=ys(e),d=s.flatMap(m=>m.status&&m.status!=="ready"?[]:m.uri?[{fileData:{mimeType:m.mimeType,fileUri:m.uri,displayName:m.name},partMetadata:{veadkMedia:{id:m.id,uri:m.uri,name:m.name,mimeType:m.mimeType,sizeBytes:m.sizeBytes}}}]:m.data?[{inlineData:{mimeType:m.mimeType,data:m.data,displayName:m.name}}]:[]),f=i&&(i.skills.length>0||i.targetAgent)?i:void 0,h=[...d,...a.map(m=>({functionResponse:{id:m.id,name:m.name,response:m.response}})),...r.trim()?[{text:r}]:[]];if(f&&h.length>0){const m=h[0],y=m.partMetadata;h[0]={...m,partMetadata:{...y,veadkInvocation:f}}}const p=await Nt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:l,user_id:t,session_id:n,new_message:{role:"user",parts:h},streaming:!0,custom_metadata:f?{veadkInvocation:f}:void 0}),signal:o},u,0);if(!p.ok)throw new Error(yf(`run_sse failed: ${p.status}`));for await(const m of IE(p)){const y=m;typeof y.error=="string"&&(y.error=yf(y.error)),typeof y.errorMessage=="string"&&(y.errorMessage=yf(y.errorMessage)),typeof y.error_message=="string"&&(y.error_message=yf(y.error_message)),yield y}}const Xc=new Map;async function LE(e,t,n,r){var u;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&Xc.set(s,i);const a=()=>{s&&Xc.get(s)===i&&Xc.delete(s)};let o;try{o=await Nt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:i==null?void 0:i.signal,body:JSON.stringify({name:e,files:t,config:n,taskId:s,im:r==null?void 0:r.im,envs:r==null?void 0:r.envs})},{},0)}catch(d){throw a(),d}if(!o.ok){const d=await o.text().catch(()=>"");throw a(),new Error(d||`部署失败 (${o.status})`)}let l=null;try{for await(const d of IE(o)){const f=d;if(f&&f.done){l=f;break}f&&f.message&&((u=r==null?void 0:r.onStage)==null||u.call(r,f))}}catch(d){throw a(),d}if(a(),!l)throw new Error("部署失败:连接中断");if(!l.success)throw new Error(l.error||"部署失败");if(!l.agentName)throw new Error("部署失败:返回缺少 Agent 名称");if(!l.runtimeId&&!l.url)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:l.apikey??"",url:l.url??"",agentName:l.agentName,runtimeId:l.runtimeId,consoleUrl:l.consoleUrl,region:l.region,feishuChannel:l.feishuChannel}}async function XI(e){var n;const t=await Nt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(r||`取消部署失败 (${t.status})`)}(n=Xc.get(e))==null||n.abort(),Xc.delete(e)}async function QI(e="cn-beijing"){const t=await Nt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Du={title:"VeADK Studio",logoUrl:""},$g={studio:!1,branding:Du,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function ZI(){var e,t;try{const n=await Nt("/web/ui-config");if(!n.ok)return $g;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Du.logoUrl;return{studio:r.studio??!1,branding:{title:typeof((t=r.branding)==null?void 0:t.title)=="string"?r.branding.title:Du.title,logoUrl:s?Ms(s):""},features:{...$g.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return $g}}const JI={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function eR(){var n,r,s;const e=await Nt("/web/access");if(!e.ok)throw new Error(`加载权限失败 (${e.status})`);const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.capabilities)==null?void 0:n.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.manageAgents)!="boolean"||!["all","mine"].includes((s=t.capabilities)==null?void 0:s.runtimeScope))throw new Error("权限服务返回了无法解析的响应");return t}async function dh(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await Nt(`/web/runtimes?${t.toString()}`);if(!n.ok)throw new Error(`加载 Runtime 失败 (${n.status})`);const r=await n.json();return{runtimes:r.runtimes??[],nextToken:r.nextToken??""}}async function tR(e,t="cn-beijing"){try{return await hm("","",{runtimeId:e,region:t})}catch(n){if(n instanceof fd||n instanceof Lu)throw n;return null}}async function nR(e,t="cn-beijing"){const n=await Nt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(r||`删除失败 (${n.status})`)}}async function ME(e,t="cn-beijing"){const n=await Nt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Jr(n,"加载 Runtime 详情失败"));return n.json()}async function fp(e){const t=await Nt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Jr(t,"生成项目失败"));return t.json()}async function rR(e){const t=await Nt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Jr(t,"创建调试运行失败"));return t.json()}async function sR(e,t){const n=await Nt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Jr(n,"创建调试会话失败"));return(await n.json()).id}async function*iR({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await Nt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:i},streaming:!0}),signal:s},{},0);if(!a.ok)throw new Error(await Jr(a,"调试运行失败"));for await(const o of IE(a))yield o}async function s1(e){const t=await Nt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Jr(t,"清理调试运行失败"))}const sU=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Du,DEFAULT_STUDIO_ACCESS:JI,RuntimeAccessDeniedError:fd,RuntimeProbeError:Lu,cancelAgentkitDeployment:XI,clearRemoteApps:UI,componentSearch:qI,createGeneratedAgentTestRun:rR,createGeneratedAgentTestSession:sR,createSession:up,deleteGeneratedAgentTestRun:s1,deleteMedia:uh,deleteRuntime:nR,deleteSession:n1,deleteSessionMedia:r1,deployAgentkitProject:LE,fetchRemoteApps:hm,generateAgentProject:fp,getAgentInfo:hd,getMediaCapabilities:rU,getMyRuntimes:QI,getRuntimeAgentInfo:WI,getRuntimeDetail:ME,getRuntimes:dh,getSession:dp,getSessionTrace:KI,getStudioAccess:eR,getUiConfig:ZI,listApps:$I,listSessions:OE,mediaContentUrl:VI,probeRuntimeApps:tR,registerRemoteApp:FI,runGeneratedAgentTestSSE:iR,runSSE:Mu,uploadMedia:HI,webSearch:GI},Symbol.toStringTag,{value:"Module"})),iU="send_a2ui_json_to_client",aU="validated_a2ui_json",i1="adk_request_credential";function oU(e){var r,s,i,a;const t=e,n=((r=t==null?void 0:t.exchangedAuthCredential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.exchanged_auth_credential)==null?void 0:s.oauth2)??((i=t==null?void 0:t.rawAuthCredential)==null?void 0:i.oauth2)??((a=t==null?void 0:t.raw_auth_credential)==null?void 0:a.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function Qs(){return{blocks:[],liveStart:0}}const z_=e=>e.functionCall??e.function_call,a1=e=>e.functionResponse??e.function_response;function lU(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function aR(e){const t=[];for(const[n,r]of e.entries()){const s=r.partMetadata??r.part_metadata,i=s==null?void 0:s.veadkTransport;if((i==null?void 0:i.hidden)===!0)continue;const a=s==null?void 0:s.veadkMedia;if(typeof(a==null?void 0:a.uri)=="string"){t.push({id:String(a.id??a.uri),mimeType:typeof a.mimeType=="string"?a.mimeType:void 0,uri:a.uri,name:typeof a.name=="string"?a.name:void 0,sizeBytes:typeof a.sizeBytes=="number"?a.sizeBytes:void 0});continue}const o=r.inlineData??r.inline_data;if(o&&o.data){t.push({id:`inline-${n}-${o.displayName??o.display_name??"media"}`,mimeType:o.mimeType??o.mime_type,data:lU(o.data),name:o.displayName??o.display_name});continue}const l=r.fileData??r.file_data,u=(l==null?void 0:l.fileUri)??(l==null?void 0:l.file_uri);l&&u&&t.push({id:u,mimeType:l.mimeType??l.mime_type,uri:u,name:l.displayName??l.display_name})}return t}function o1(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const cU=new Set(["llm","sequential","parallel","loop","a2a"]);function uU(e){var t;for(const n of e){const r=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!r||typeof r!="object")continue;const s=r,i=Array.isArray(s.skills)?s.skills.flatMap(l=>{if(!l||typeof l!="object")return[];const u=l;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let a;const o=s.targetAgent;if(o&&typeof o=="object"){const l=o,u=l.type;typeof l.name=="string"&&typeof u=="string"&&cU.has(u)&&Array.isArray(l.path)&&(a={name:l.name,description:typeof l.description=="string"?l.description:"",type:u,path:l.path.filter(d=>typeof d=="string")})}if(i.length>0||a)return{skills:i,targetAgent:a}}}function dU(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function V_(e,t,n){const r=e[e.length-1];r&&r.kind===t?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function bf(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function ml(e,t){var a,o;const n=e.blocks.map(l=>({...l}));let r=e.liveStart;const s=((a=t.content)==null?void 0:a.parts)??[],i=s.some(l=>z_(l)||a1(l));if(t.partial&&!i){for(const l of s){const u=o1(l);typeof u=="string"&&u&&V_(n,l.thought?"thinking":"text",u)}return{blocks:n,liveStart:r}}n.length=r;for(const l of s){const u=z_(l),d=a1(l),f=aR([l]),h=o1(l);if(typeof h=="string"&&h)V_(n,l.thought?"thinking":"text",h);else if(f.length)bf(n),dU(n,f);else if(u)if(bf(n),u.name===i1){const p=u.args??{},m=p.authConfig??p.auth_config??p,w=String(p.functionCallId??p.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:u.id??"",label:w,authUri:oU(m),authConfig:m,done:!1})}else n.push({kind:"tool",name:u.name??"",args:u.args,done:!1});else if(d){if(bf(n),d.name===i1)for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="auth"&&!m.done){m.done=!0;break}}for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="tool"&&!m.done&&m.name===d.name){m.done=!0,m.response=d.response;break}}if(d.name===iU){const p=((o=d.response)==null?void 0:o[aU])??[];if(p.length){const m=n[n.length-1];m&&m.kind==="a2ui"?m.messages.push(...p):n.push({kind:"a2ui",messages:p})}}}}return bf(n),r=n.length,{blocks:n,liveStart:r}}function fU(e){var r;const t=[];let n=Qs();for(const s of e)if(s.author==="user"){const a=((r=s.content)==null?void 0:r.parts)??[];if(a.some(f=>{var h;return((h=a1(f))==null?void 0:h.name)===i1})){for(let f=t.length-1;f>=0;f--)if(t[f].role==="assistant"){for(let h=t[f].blocks.length-1;h>=0;h--){const p=t[f].blocks[h];if(p.kind==="auth"){p.done=!0;break}}break}}const o=a.map(o1).filter(f=>!!f).join(""),l=aR(a),u=uU(a);if(!o&&!l.length&&!u){n=Qs();continue}const d=[];u&&d.push({kind:"invocation",value:u}),l.length&&d.push({kind:"attachment",files:l}),o&&d.push({kind:"text",text:o}),t.push({role:"user",blocks:d,meta:{ts:s.timestamp}}),n=Qs()}else{let a=t[t.length-1];(!a||a.role!=="assistant")&&(a={role:"assistant",blocks:[],meta:{}},t.push(a),n=Qs()),n=ml(n,s),a.blocks=n.blocks;const o=s.usageMetadata??s.usage_metadata,l=a.meta??(a.meta={});o!=null&&o.totalTokenCount&&(l.tokens=o.totalTokenCount),s.timestamp&&(l.ts=s.timestamp)}return t}function oR(e){var t,n;for(const r of e??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const s=(((n=r.content)==null?void 0:n.parts)??[]).map(i=>i.text).find(Boolean);if(s)return s}return"新会话"}async function pd(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ds(void 0,dd)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 AgentKit Skills 中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit Skills 中心");if(t.status===404)throw new Error("技能不存在或无 SKILL.md 内容");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function hU(){return(await pd("/web/skill-spaces?region=all")).items||[]}async function pU(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),pd(`/web/skill-spaces?${t.toString()}`)}async function mU(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function gU(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function yU(e,t,n,r,s){const i=[];n&&i.push(`version=${encodeURIComponent(n)}`),r&&i.push(`region=${encodeURIComponent(r)}`),s&&i.push(`project=${encodeURIComponent(s)}`);const a=i.length>0?`?${i.join("&")}`:"";return pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function bU(e,t){return{source:"skillspace",id:`ss:${e.id}/${t.skillId}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:t.skillId,version:t.version}}function EU(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}function ade(){}function K_(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&t.push(a),s=r+1,r=n.indexOf(",",s)}return t}function lR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const xU=/[$_\p{ID_Start}]/u,wU=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,vU=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,_U=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cR={};function ode(e){return e?xU.test(String.fromCodePoint(e)):!1}function lde(e,t){const r=(t||cR).jsx?vU:wU;return e?r.test(String.fromCodePoint(e)):!1}function Y_(e,t){return(cR.jsx?TU:_U).test(e)}const NU=/[ \t\n\f\r]/g;function kU(e){return typeof e=="object"?e.type==="text"?W_(e.value):!1:W_(e)}function W_(e){return e.replace(NU,"")===""}let md=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};md.prototype.normal={};md.prototype.property={};md.prototype.space=void 0;function uR(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new md(n,r,t)}function Pu(e){return e.toLowerCase()}class vr{constructor(t,n){this.attribute=n,this.property=t}}vr.prototype.attribute="";vr.prototype.booleanish=!1;vr.prototype.boolean=!1;vr.prototype.commaOrSpaceSeparated=!1;vr.prototype.commaSeparated=!1;vr.prototype.defined=!1;vr.prototype.mustUseProperty=!1;vr.prototype.number=!1;vr.prototype.overloadedBoolean=!1;vr.prototype.property="";vr.prototype.spaceSeparated=!1;vr.prototype.space=void 0;let SU=0;const Je=to(),bn=to(),l1=to(),be=to(),Dt=to(),Zo=to(),kr=to();function to(){return 2**++SU}const c1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:bn,commaOrSpaceSeparated:kr,commaSeparated:Zo,number:be,overloadedBoolean:l1,spaceSeparated:Dt},Symbol.toStringTag,{value:"Module"})),Hg=Object.keys(c1);class DE extends vr{constructor(t,n,r,s){let i=-1;if(super(t,n),q_(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&OU.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(G_,MU);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!G_.test(i)){let a=i.replace(RU,LU);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=DE}return new s(r,t)}function LU(e){return"-"+e.toLowerCase()}function MU(e){return e.charAt(1).toUpperCase()}const gd=uR([dR,AU,pR,mR,gR],"html"),ta=uR([dR,CU,pR,mR,gR],"svg");function X_(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function yR(e){return e.join(" ").trim()}var PE={},Q_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,DU=/\n/g,PU=/^\s*/,jU=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,BU=/^:\s*/,FU=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,UU=/^[;\s]*/,$U=/^\s+|\s+$/g,HU=` +`,Z_="/",J_="*",Ea="",zU="comment",VU="declaration";function KU(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var y=m.match(DU);y&&(n+=y.length);var w=m.lastIndexOf(HU);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new a(m),u(),y}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var w=y[0];return s(w),e=e.slice(w.length),y}}function u(){l(PU)}function d(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=i();if(!(Z_!=e.charAt(0)||J_!=e.charAt(1))){for(var y=2;Ea!=e.charAt(y)&&(J_!=e.charAt(y)||Z_!=e.charAt(y+1));)++y;if(y+=2,Ea===e.charAt(y-1))return o("End of comment missing");var w=e.slice(2,y-2);return r+=2,s(w),e=e.slice(y),r+=2,m({type:zU,comment:w})}}function h(){var m=i(),y=l(jU);if(y){if(f(),!l(BU))return o("property missing ':'");var w=l(FU),g=m({type:VU,property:eT(y[0].replace(Q_,Ea)),value:w?eT(w[0].replace(Q_,Ea)):Ea});return l(UU),g}}function p(){var m=[];d(m);for(var y;y=h();)y!==!1&&(m.push(y),d(m));return m}return u(),p()}function eT(e){return e?e.replace($U,Ea):Ea}var YU=KU,WU=Ah&&Ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PE,"__esModule",{value:!0});PE.default=GU;const qU=WU(YU);function GU(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,qU.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:o}=i;s?t(a,o,i):o&&(n=n||{},n[a]=o)}),n}var mm={};Object.defineProperty(mm,"__esModule",{value:!0});mm.camelCase=void 0;var XU=/^--[a-zA-Z0-9_-]+$/,QU=/-([a-z])/g,ZU=/^[^-]+$/,JU=/^-(webkit|moz|ms|o|khtml)-/,e7=/^-(ms)-/,t7=function(e){return!e||ZU.test(e)||XU.test(e)},n7=function(e,t){return t.toUpperCase()},tT=function(e,t){return"".concat(t,"-")},r7=function(e,t){return t===void 0&&(t={}),t7(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(e7,tT):e=e.replace(JU,tT),e.replace(QU,n7))};mm.camelCase=r7;var s7=Ah&&Ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i7=s7(PE),a7=mm;function u1(e,t){var n={};return!e||typeof e!="string"||(0,i7.default)(e,function(r,s){r&&s&&(n[(0,a7.camelCase)(r,t)]=s)}),n}u1.default=u1;var o7=u1;const l7=td(o7),gm=bR("end"),Fs=bR("start");function bR(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function c7(e){const t=Fs(e),n=gm(e);if(t&&n)return{start:t,end:n}}function Qc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nT(e.position):"start"in e||"end"in e?nT(e):"line"in e||"column"in e?d1(e):""}function d1(e){return rT(e&&e.line)+":"+rT(e&&e.column)}function nT(e){return d1(e&&e.start)+"-"+d1(e&&e.end)}function rT(e){return e&&typeof e=="number"?e:1}class Zn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(a=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Qc(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zn.prototype.file="";Zn.prototype.name="";Zn.prototype.reason="";Zn.prototype.message="";Zn.prototype.stack="";Zn.prototype.column=void 0;Zn.prototype.line=void 0;Zn.prototype.ancestors=void 0;Zn.prototype.cause=void 0;Zn.prototype.fatal=void 0;Zn.prototype.place=void 0;Zn.prototype.ruleId=void 0;Zn.prototype.source=void 0;const jE={}.hasOwnProperty,u7=new Map,d7=/[A-Z]/g,f7=new Set(["table","tbody","thead","tfoot","tr"]),h7=new Set(["td","th"]),ER="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function p7(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=v7(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=w7(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ta:gd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=xR(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function xR(e,t,n){if(t.type==="element")return m7(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return g7(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return b7(e,t,n);if(t.type==="mdxjsEsm")return y7(e,t);if(t.type==="root")return E7(e,t,n);if(t.type==="text")return x7(e,t)}function m7(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ta,e.schema=s),e.ancestors.push(t);const i=vR(e,t.tagName,!1),a=_7(e,t);let o=FE(e,t);return f7.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!kU(l):!0})),wR(e,a,i,t),BE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function g7(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ju(e,t.position)}function y7(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ju(e,t.position)}function b7(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ta,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:vR(e,t.name,!0),a=T7(e,t),o=FE(e,t);return wR(e,a,i,t),BE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function E7(e,t,n){const r={};return BE(r,FE(e,t)),e.create(t,e.Fragment,r,n)}function x7(e,t){return t.value}function wR(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function BE(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function w7(e,t,n){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?n:t;return o?u(i,a,o):u(i,a)}}function v7(e,t){return n;function n(r,s,i,a){const o=Array.isArray(i.children),l=Fs(r);return t(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function _7(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&jE.call(t.properties,s)){const i=N7(e,s,t.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&h7.has(t.tagName)?r=o:n[a]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function T7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ju(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else ju(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function FE(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:u7;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i0?(Or(e,e.length,0,t),e):t}const aT={}.hasOwnProperty;function TR(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function fs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const or=na(/[A-Za-z]/),Gn=na(/[\dA-Za-z]/),M7=na(/[#-'*+\--9=?A-Z^-~]/);function hp(e){return e!==null&&(e<32||e===127)}const f1=na(/\d/),D7=na(/[\dA-Fa-f]/),P7=na(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function At(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const ym=na(new RegExp("\\p{P}|\\p{S}","u")),Va=na(/\s/);function na(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $l(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function dt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return it(l)?(e.enter(n),o(l)):t(l)}function o(l){return it(l)&&i++a))return;const A=t.events.length;let k=A,R,I;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(R){I=t.events[k][1].end;break}R=!0}for(g(r),T=A;Tb;){const N=n[_];t.containerState=N[1],N[0].exit.call(t,e)}n.length=b}function E(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function $7(e,t,n){return dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gl(e){if(e===null||At(e)||Va(e))return 1;if(ym(e))return 2}function bm(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};lT(f,-l),lT(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Hr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Hr(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Hr(u,bm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Hr(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Hr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Or(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&it(T)?dt(e,E,"linePrefix",i+1)(T):E(T)}function E(T){return T===null||Be(T)?e.check(cT,y,_)(T):(e.enter("codeFlowValue"),b(T))}function b(T){return T===null||Be(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),b)}function _(T){return e.exit("codeFenced"),t(T)}function N(T,A,k){let R=0;return I;function I(U){return T.enter("lineEnding"),T.consume(U),T.exit("lineEnding"),M}function M(U){return T.enter("codeFencedFence"),it(U)?dt(T,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):B(U)}function B(U){return U===o?(T.enter("codeFencedFenceSequence"),Y(U)):k(U)}function Y(U){return U===o?(R++,T.consume(U),Y):R>=a?(T.exit("codeFencedFenceSequence"),it(U)?dt(T,P,"whitespace")(U):P(U)):k(U)}function P(U){return U===null||Be(U)?(T.exit("codeFencedFence"),A(U)):k(U)}}}function J7(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Vg={name:"codeIndented",tokenize:t$},e$={partial:!0,tokenize:n$};function t$(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),dt(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):Be(u)?e.attempt(e$,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Be(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function n$(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):dt(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):Be(a)?s(a):n(a)}}const r$={name:"codeText",previous:i$,resolve:s$,tokenize:a$};function s$(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&fc(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function IR(e,t,n,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||hp(g)?n(g):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(o),h(g)):g===null||g===60||Be(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!d&&(g===null||g===41||At(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):d999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):Be(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Be(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!it(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function OR(e,t,n,r,s,i){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===a?(e.exit(i),l(a)):h===null?n(h):Be(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),dt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Be(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Zc(e,t){let n;return r;function r(s){return Be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):it(s)?dt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const p$={name:"definition",tokenize:g$},m$={partial:!0,tokenize:y$};function g$(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return RR.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return s=fs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return At(p)?Zc(e,u)(p):u(p)}function u(p){return IR(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(m$,f,f)(p)}function f(p){return it(p)?dt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Be(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function y$(e,t,n){return r;function r(o){return At(o)?Zc(e,s)(o):n(o)}function s(o){return OR(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return it(o)?dt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Be(o)?t(o):n(o)}}const b$={name:"hardBreakEscape",tokenize:E$};function E$(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Be(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const x$={name:"headingAtx",resolve:w$,tokenize:v$};function w$(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Or(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function v$(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||At(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Be(d)?(e.exit("atxHeading"),t(d)):it(d)?dt(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||At(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const _$=["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"],dT=["pre","script","style","textarea"],T$={concrete:!0,name:"htmlFlow",resolveTo:S$,tokenize:A$},N$={partial:!0,tokenize:I$},k$={partial:!0,tokenize:C$};function S$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function A$(e,t,n){const r=this;let s,i,a,o,l;return u;function u(D){return d(D)}function d(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),f}function f(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),i=!0,y):D===63?(e.consume(D),s=3,r.interrupt?t:S):or(D)?(e.consume(D),a=String.fromCharCode(D),w):n(D)}function h(D){return D===45?(e.consume(D),s=2,p):D===91?(e.consume(D),s=5,o=0,m):or(D)?(e.consume(D),s=4,r.interrupt?t:S):n(D)}function p(D){return D===45?(e.consume(D),r.interrupt?t:S):n(D)}function m(D){const ne="CDATA[";return D===ne.charCodeAt(o++)?(e.consume(D),o===ne.length?r.interrupt?t:B:m):n(D)}function y(D){return or(D)?(e.consume(D),a=String.fromCharCode(D),w):n(D)}function w(D){if(D===null||D===47||D===62||At(D)){const ne=D===47,ee=a.toLowerCase();return!ne&&!i&&dT.includes(ee)?(s=1,r.interrupt?t(D):B(D)):_$.includes(a.toLowerCase())?(s=6,ne?(e.consume(D),g):r.interrupt?t(D):B(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):i?E(D):b(D))}return D===45||Gn(D)?(e.consume(D),a+=String.fromCharCode(D),w):n(D)}function g(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function E(D){return it(D)?(e.consume(D),E):I(D)}function b(D){return D===47?(e.consume(D),I):D===58||D===95||or(D)?(e.consume(D),_):it(D)?(e.consume(D),b):I(D)}function _(D){return D===45||D===46||D===58||D===95||Gn(D)?(e.consume(D),_):N(D)}function N(D){return D===61?(e.consume(D),T):it(D)?(e.consume(D),N):b(D)}function T(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),l=D,A):it(D)?(e.consume(D),T):k(D)}function A(D){return D===l?(e.consume(D),l=null,R):D===null||Be(D)?n(D):(e.consume(D),A)}function k(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||At(D)?N(D):(e.consume(D),k)}function R(D){return D===47||D===62||it(D)?b(D):n(D)}function I(D){return D===62?(e.consume(D),M):n(D)}function M(D){return D===null||Be(D)?B(D):it(D)?(e.consume(D),M):n(D)}function B(D){return D===45&&s===2?(e.consume(D),C):D===60&&s===1?(e.consume(D),L):D===62&&s===4?(e.consume(D),H):D===63&&s===3?(e.consume(D),S):D===93&&s===5?(e.consume(D),j):Be(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(N$,V,Y)(D)):D===null||Be(D)?(e.exit("htmlFlowData"),Y(D)):(e.consume(D),B)}function Y(D){return e.check(k$,P,V)(D)}function P(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return D===null||Be(D)?Y(D):(e.enter("htmlFlowData"),B(D))}function C(D){return D===45?(e.consume(D),S):B(D)}function L(D){return D===47?(e.consume(D),a="",O):B(D)}function O(D){if(D===62){const ne=a.toLowerCase();return dT.includes(ne)?(e.consume(D),H):B(D)}return or(D)&&a.length<8?(e.consume(D),a+=String.fromCharCode(D),O):B(D)}function j(D){return D===93?(e.consume(D),S):B(D)}function S(D){return D===62?(e.consume(D),H):D===45&&s===2?(e.consume(D),S):B(D)}function H(D){return D===null||Be(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),H)}function V(D){return e.exit("htmlFlow"),t(D)}}function C$(e,t,n){const r=this;return s;function s(a){return Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function I$(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(yd,t,n)}}const R$={name:"htmlText",tokenize:O$};function O$(e,t,n){const r=this;let s,i,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),u):S===47?(e.consume(S),N):S===63?(e.consume(S),b):or(S)?(e.consume(S),k):n(S)}function u(S){return S===45?(e.consume(S),d):S===91?(e.consume(S),i=0,m):or(S)?(e.consume(S),E):n(S)}function d(S){return S===45?(e.consume(S),p):n(S)}function f(S){return S===null?n(S):S===45?(e.consume(S),h):Be(S)?(a=f,L(S)):(e.consume(S),f)}function h(S){return S===45?(e.consume(S),p):f(S)}function p(S){return S===62?C(S):S===45?h(S):f(S)}function m(S){const H="CDATA[";return S===H.charCodeAt(i++)?(e.consume(S),i===H.length?y:m):n(S)}function y(S){return S===null?n(S):S===93?(e.consume(S),w):Be(S)?(a=y,L(S)):(e.consume(S),y)}function w(S){return S===93?(e.consume(S),g):y(S)}function g(S){return S===62?C(S):S===93?(e.consume(S),g):y(S)}function E(S){return S===null||S===62?C(S):Be(S)?(a=E,L(S)):(e.consume(S),E)}function b(S){return S===null?n(S):S===63?(e.consume(S),_):Be(S)?(a=b,L(S)):(e.consume(S),b)}function _(S){return S===62?C(S):b(S)}function N(S){return or(S)?(e.consume(S),T):n(S)}function T(S){return S===45||Gn(S)?(e.consume(S),T):A(S)}function A(S){return Be(S)?(a=A,L(S)):it(S)?(e.consume(S),A):C(S)}function k(S){return S===45||Gn(S)?(e.consume(S),k):S===47||S===62||At(S)?R(S):n(S)}function R(S){return S===47?(e.consume(S),C):S===58||S===95||or(S)?(e.consume(S),I):Be(S)?(a=R,L(S)):it(S)?(e.consume(S),R):C(S)}function I(S){return S===45||S===46||S===58||S===95||Gn(S)?(e.consume(S),I):M(S)}function M(S){return S===61?(e.consume(S),B):Be(S)?(a=M,L(S)):it(S)?(e.consume(S),M):R(S)}function B(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),s=S,Y):Be(S)?(a=B,L(S)):it(S)?(e.consume(S),B):(e.consume(S),P)}function Y(S){return S===s?(e.consume(S),s=void 0,U):S===null?n(S):Be(S)?(a=Y,L(S)):(e.consume(S),Y)}function P(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||At(S)?R(S):(e.consume(S),P)}function U(S){return S===47||S===62||At(S)?R(S):n(S)}function C(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function L(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),O}function O(S){return it(S)?dt(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):j(S)}function j(S){return e.enter("htmlTextData"),a(S)}}const HE={name:"labelEnd",resolveAll:P$,resolveTo:j$,tokenize:B$},L$={tokenize:F$},M$={tokenize:U$},D$={tokenize:$$};function P$(e){let t=-1;const n=[];for(;++t=3&&(u===null||Be(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),it(u)?dt(e,o,"whitespace")(u):o(u))}}const pr={continuation:{tokenize:Q$},exit:J$,name:"list",tokenize:X$},q$={partial:!0,tokenize:eH},G$={partial:!0,tokenize:Z$};function X$(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:f1(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(fh,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return f1(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yd,r.interrupt?n:d,e.attempt(q$,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return it(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Q$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yd,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,dt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!it(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(G$,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,dt(e,e.attempt(pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Z$(e,t,n){const r=this;return dt(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function J$(e){e.exit(this.containerState.type)}function eH(e,t,n){const r=this;return dt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!it(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const fT={name:"setextUnderline",resolveTo:tH,tokenize:nH};function tH(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function nH(e,t,n){const r=this;let s;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),it(u)?dt(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Be(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const rH={tokenize:sH};function sH(e){const t=this,n=e.attempt(yd,r,e.attempt(this.parser.constructs.flowInitial,s,dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(c$,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const iH={resolveAll:MR()},aH=LR("string"),oH=LR("text");function LR(e){return{resolveAll:MR(e==="text"?lH:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,o);return a;function a(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=s[d];let h=-1;if(f)for(;++h-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function wH(e,t){let n=-1;const r=[];let s;for(;++n0){const ut=le.tokenStack[le.tokenStack.length-1];(ut[1]||pT).call(le,void 0,ut[0])}for(X.position={start:gi(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:gi(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function LH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Fl(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function PH(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jH(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function PR(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function BH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return PR(e,t);const s={src:Fl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function FH(e,t){const n={src:Fl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function UH(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function $H(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return PR(e,t);const s={href:Fl(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function HH(e,t){const n={href:Fl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zH(e,t,n){const r=e.all(t),s=n?VH(n):jR(t),i={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o0){const ut=le.tokenStack[le.tokenStack.length-1];(ut[1]||pT).call(le,void 0,ut[0])}for(X.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})},Re=-1;++Re0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function DH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=$l(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function BH(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FH(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function jR(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function UH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jR(e,t);const s={src:$l(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function $H(e,t){const n={src:$l(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function HH(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function zH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jR(e,t);const s={href:$l(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function VH(e,t){const n={href:$l(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KH(e,t,n){const r=e.all(t),s=n?YH(n):BR(t),i={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function KH(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Ps(t.children[1]),l=pm(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function XH(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(yT(t.slice(s),s>0,!1)),i.join("")}function yT(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===mT||i===gT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===mT||i===gT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function JH(e,t){const n={type:"text",value:ZH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ez(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const tz={blockquote:IH,break:RH,code:OH,delete:LH,emphasis:MH,footnoteReference:DH,heading:PH,html:jH,imageReference:BH,image:FH,inlineCode:UH,linkReference:$H,link:HH,listItem:zH,list:KH,paragraph:YH,root:WH,strong:qH,table:GH,tableCell:QH,tableRow:XH,text:JH,thematicBreak:ez,toml:yf,yaml:yf,definition:yf,footnoteDefinition:yf};function yf(){}const BR=-1,ym=0,Qc=1,fp=2,zE=3,VE=4,KE=5,YE=6,FR=7,UR=8,nz=typeof self=="object"?self:globalThis,bT=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new nz[e](t)},rz=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=t[s];switch(i){case ym:case BR:return n(a,s);case Qc:{const o=n([],s);for(const l of a)o.push(r(l));return o}case fp:{const o=n({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case zE:return n(new Date(a),s);case VE:{const{source:o,flags:l}=a;return n(new RegExp(o,l),s)}case KE:{const o=n(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case YE:{const o=n(new Set,s);for(const l of a)o.add(r(l));return o}case FR:{const{name:o,message:l}=a;return n(bT(o,l),s)}case UR:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(bT(i,a),s)};return r},ET=e=>rz(new Map,e)(0),uo="",{toString:sz}={},{keys:iz}=Object,dc=e=>{const t=typeof e;if(t!=="object"||!e)return[ym,t];const n=sz.call(e).slice(8,-1);switch(n){case"Array":return[Qc,uo];case"Object":return[fp,uo];case"Date":return[zE,uo];case"RegExp":return[VE,uo];case"Map":return[KE,uo];case"Set":return[YE,uo];case"DataView":return[Qc,n]}return n.includes("Array")?[Qc,n]:n.includes("Error")?[FR,n]:[fp,n]},bf=([e,t])=>e===ym&&(t==="function"||t==="symbol"),az=(e,t,n,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},i=a=>{if(n.has(a))return n.get(a);let[o,l]=dc(a);switch(o){case ym:{let d=a;switch(l){case"bigint":o=UR,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return s([BR],a)}return s([o,d],a)}case Qc:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),s([l,[...h]],a)}const d=[],f=s([o,d],a);for(const h of a)d.push(i(h));return f}case fp:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],f=s([o,d],a);for(const h of iz(a))(e||!bf(dc(a[h])))&&d.push([i(h),i(a[h])]);return f}case zE:return s([o,a.toISOString()],a);case VE:{const{source:d,flags:f}=a;return s([o,{source:d,flags:f}],a)}case KE:{const d=[],f=s([o,d],a);for(const[h,p]of a)(e||!(bf(dc(h))||bf(dc(p))))&&d.push([i(h),i(p)]);return f}case YE:{const d=[],f=s([o,d],a);for(const h of a)(e||!bf(dc(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xT=(e,{json:t,lossy:n}={})=>{const r=[];return az(!(t||n),!!t,new Map,r)(e),r},gl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ET(xT(e,t)):structuredClone(e):(e,t)=>ET(xT(e,t));function oz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function lz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function cz(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||oz,r=e.options.footnoteBackLabel||lz,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&m.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const E=w.children[w.children.length-1];E&&E.type==="text"?E.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...gl(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)}function YH(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r1}function WH(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Fs(t.children[1]),l=gm(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function ZH(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(yT(t.slice(s),s>0,!1)),i.join("")}function yT(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===mT||i===gT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===mT||i===gT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function tz(e,t){const n={type:"text",value:ez(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rz={blockquote:OH,break:LH,code:MH,delete:DH,emphasis:PH,footnoteReference:jH,heading:BH,html:FH,imageReference:UH,image:$H,inlineCode:HH,linkReference:zH,link:VH,listItem:KH,list:WH,paragraph:qH,root:GH,strong:XH,table:QH,tableCell:JH,tableRow:ZH,text:tz,thematicBreak:nz,toml:Ef,yaml:Ef,definition:Ef,footnoteDefinition:Ef};function Ef(){}const FR=-1,Em=0,Jc=1,pp=2,zE=3,VE=4,KE=5,YE=6,UR=7,$R=8,sz=typeof self=="object"?self:globalThis,bT=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new sz[e](t)},iz=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=t[s];switch(i){case Em:case FR:return n(a,s);case Jc:{const o=n([],s);for(const l of a)o.push(r(l));return o}case pp:{const o=n({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case zE:return n(new Date(a),s);case VE:{const{source:o,flags:l}=a;return n(new RegExp(o,l),s)}case KE:{const o=n(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case YE:{const o=n(new Set,s);for(const l of a)o.add(r(l));return o}case UR:{const{name:o,message:l}=a;return n(bT(o,l),s)}case $R:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(bT(i,a),s)};return r},ET=e=>iz(new Map,e)(0),fo="",{toString:az}={},{keys:oz}=Object,hc=e=>{const t=typeof e;if(t!=="object"||!e)return[Em,t];const n=az.call(e).slice(8,-1);switch(n){case"Array":return[Jc,fo];case"Object":return[pp,fo];case"Date":return[zE,fo];case"RegExp":return[VE,fo];case"Map":return[KE,fo];case"Set":return[YE,fo];case"DataView":return[Jc,n]}return n.includes("Array")?[Jc,n]:n.includes("Error")?[UR,n]:[pp,n]},xf=([e,t])=>e===Em&&(t==="function"||t==="symbol"),lz=(e,t,n,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},i=a=>{if(n.has(a))return n.get(a);let[o,l]=hc(a);switch(o){case Em:{let d=a;switch(l){case"bigint":o=$R,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return s([FR],a)}return s([o,d],a)}case Jc:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),s([l,[...h]],a)}const d=[],f=s([o,d],a);for(const h of a)d.push(i(h));return f}case pp:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],f=s([o,d],a);for(const h of oz(a))(e||!xf(hc(a[h])))&&d.push([i(h),i(a[h])]);return f}case zE:return s([o,a.toISOString()],a);case VE:{const{source:d,flags:f}=a;return s([o,{source:d,flags:f}],a)}case KE:{const d=[],f=s([o,d],a);for(const[h,p]of a)(e||!(xf(hc(h))||xf(hc(p))))&&d.push([i(h),i(p)]);return f}case YE:{const d=[],f=s([o,d],a);for(const h of a)(e||!xf(hc(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xT=(e,{json:t,lossy:n}={})=>{const r=[];return lz(!(t||n),!!t,new Map,r)(e),r},yl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ET(xT(e,t)):structuredClone(e):(e,t)=>ET(xT(e,t));function cz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function uz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function dz(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||cz,r=e.options.footnoteBackLabel||uz,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&m.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const E=w.children[w.children.length-1];E&&E.type==="text"?E.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...yl(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const gd=function(e){if(e==null)return hz;if(typeof e=="function")return bm(e);if(typeof e=="object")return Array.isArray(e)?uz(e):dz(e);if(typeof e=="string")return fz(e);throw new Error("Expected function, string, or object as test")};function uz(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=$R,m,b,w;if((!t||i(l,u,d[d.length-1]||void 0))&&(p=yz(n(l,d)),p[0]===h1))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==gz)for(b=(r?g.children.length:-1)+a,w=d.concat(g);b>-1&&b":""))+")"})}return h;function h(){let p=HR,m,y,w;if((!t||i(l,u,d[d.length-1]||void 0))&&(p=Ez(n(l,d)),p[0]===p1))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==bz)for(y=(r?g.children.length:-1)+a,w=d.concat(g);y>-1&&y0&&n.push({type:"text",value:` -`}),n}function wT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vT(e,t){const n=Ez(e,t),r=n.one(e,void 0),s=cz(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function Tz(e,t){return e&&"run"in e?async function(n,r){const s=vT(n,{file:r,...t});await e.run(s,r)}:function(n,r){return vT(n,{file:r,...e||t})}}function _T(e){if(e)throw e}var dh=Object.prototype.hasOwnProperty,zR=Object.prototype.toString,TT=Object.defineProperty,kT=Object.getOwnPropertyDescriptor,NT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):zR.call(t)==="[object Array]"},ST=function(t){if(!t||zR.call(t)!=="[object Object]")return!1;var n=dh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&dh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||dh.call(t,s)},AT=function(t,n){TT&&n.name==="__proto__"?TT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},CT=function(t,n){if(n==="__proto__")if(dh.call(t,n)){if(kT)return kT(t,n).value}else return;return t[n]},kz=function e(){var t,n,r,s,i,a,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});la.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return s(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){n||(n=!0,t(a,...o))}function i(a){s(null,a)}}const Ts={basename:Az,dirname:Cz,extname:Iz,join:Rz,sep:"/"};function Az(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bd(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===t.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Cz(e){if(bd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Iz(e){bd(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function Rz(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Lz(e,t){let n="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return n}function bd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Mz={cwd:Dz};function Dz(){return"/"}function g1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Pz(e){if(typeof e=="string")e=new URL(e);else if(!g1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return jz(e)}function jz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...m]=d;const b=r[h][1];m1(b)&&m1(p)&&(p=Kg(!0,b,p)),r[h]=[u,p,...m]}}}}const $z=new WE().freeze();function Gg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RT(e){if(!m1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ef(e){return Hz(e)?e:new VR(e)}function Hz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function zz(e){return typeof e=="string"||Vz(e)}function Vz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Kz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",LT=[],MT={allowDangerousHtml:!0},Yz=/^(https?|ircs?|mailto|xmpp)$/i,Wz=[{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:"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 qz(e){const t=Gz(e),n=Xz(e);return Qz(t.runSync(t.parse(n),n),e)}function Gz(e){const t=e.rehypePlugins||LT,n=e.remarkPlugins||LT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...MT}:MT;return $z().use(CH).use(n).use(Tz,r).use(t)}function Xz(e){const t=e.children||"",n=new VR;return typeof t=="string"&&(n.value=t),n}function Qz(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||Zz;for(const d of Wz)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Kz+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),yd(e,u),f7(e,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in Hg)if(Object.hasOwn(Hg,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],b=Hg[p];(b===null||b.includes(d.tagName))&&(d.properties[p]=l(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function Zz(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||Yz.test(e.slice(0,t))?e:""}function DT(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function Jz(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function eV(e,t,n){const s=gd((n||{}).ignore||[]),i=tV(t);let a=-1;for(;++a0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=_+1:(m!==_&&E.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(T)?E.push(...T):T&&E.push(T),m=_+y[0].length,g=!0),!h.global)break;y=h.exec(u.value)}return g?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=DT(e,"(");let i=DT(e,")");for(;r!==-1&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function KR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||za(n)||mm(n))&&(!t||n!==47)}YR.peek=TV;function gV(){this.buffer()}function yV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function bV(){this.buffer()}function EV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ds(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wV(e){this.exit(e)}function vV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ds(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _V(e){this.exit(e)}function TV(){return"["}function YR(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function kV(){return{enter:{gfmFootnoteCallString:gV,gfmFootnoteCall:yV,gfmFootnoteDefinitionLabelString:bV,gfmFootnoteDefinition:EV},exit:{gfmFootnoteCallString:xV,gfmFootnoteCall:wV,gfmFootnoteDefinitionLabelString:vV,gfmFootnoteDefinition:_V}}}function NV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:YR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?WR:SV))),u(),l}}function SV(e,t,n){return t===0?e:WR(e,t,n)}function WR(e,t,n){return(n?"":" ")+e}const AV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qR.peek=LV;function CV(){return{canContainEols:["delete"],enter:{strikethrough:RV},exit:{strikethrough:OV}}}function IV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:AV}],handlers:{delete:qR}}}function RV(e){this.enter({type:"delete",children:[]},e)}function OV(e){this.exit(e)}function qR(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function LV(){return"~"}function MV(e){return e.length}function DV(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||MV,i=[],a=[],o=[],l=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++gl[g])&&(l[g]=y)}b.push(E)}a[d]=b,o[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=E),p[f]=E),h[f]=y}a.splice(1,0,h),o.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),BV);return s(),a}function BV(e,t,n){return">"+(n?"":" ")+e}function FV(e,t){return BT(e,t.inConstruct,!0)&&!BT(e,t.notInConstruct,!1)}function BT(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ra&&(a=i):i=1,s=r+t.length,r=n.indexOf(t,s);return a}function $V(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function HV(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zV(e,t,n,r){const s=HV(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if($V(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,VV);return f(),h}const o=n.createTracker(r),l=s.repeat(Math.max(UV(i,s)+1,3)),u=n.enter("codeFenced");let d=o.move(l);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:` +`}),n}function wT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vT(e,t){const n=wz(e,t),r=n.one(e,void 0),s=dz(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` +`},s),i}function kz(e,t){return e&&"run"in e?async function(n,r){const s=vT(n,{file:r,...t});await e.run(s,r)}:function(n,r){return vT(n,{file:r,...e||t})}}function _T(e){if(e)throw e}var hh=Object.prototype.hasOwnProperty,VR=Object.prototype.toString,TT=Object.defineProperty,NT=Object.getOwnPropertyDescriptor,kT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):VR.call(t)==="[object Array]"},ST=function(t){if(!t||VR.call(t)!=="[object Object]")return!1;var n=hh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&hh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||hh.call(t,s)},AT=function(t,n){TT&&n.name==="__proto__"?TT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},CT=function(t,n){if(n==="__proto__")if(hh.call(t,n)){if(NT)return NT(t,n).value}else return;return t[n]},Sz=function e(){var t,n,r,s,i,a,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});la.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return s(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){n||(n=!0,t(a,...o))}function i(a){s(null,a)}}const ks={basename:Iz,dirname:Rz,extname:Oz,join:Lz,sep:"/"};function Iz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xd(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===t.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Rz(e){if(xd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Oz(e){xd(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function Lz(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Dz(e,t){let n="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return n}function xd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Pz={cwd:jz};function jz(){return"/"}function y1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Bz(e){if(typeof e=="string")e=new URL(e);else if(!y1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Fz(e)}function Fz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...m]=d;const y=r[h][1];g1(y)&&g1(p)&&(p=Yg(!0,y,p)),r[h]=[u,p,...m]}}}}const zz=new WE().freeze();function Xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Zg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RT(e){if(!g1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wf(e){return Vz(e)?e:new KR(e)}function Vz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Kz(e){return typeof e=="string"||Yz(e)}function Yz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",LT=[],MT={allowDangerousHtml:!0},qz=/^(https?|ircs?|mailto|xmpp)$/i,Gz=[{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:"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 Xz(e){const t=Qz(e),n=Zz(e);return Jz(t.runSync(t.parse(n),n),e)}function Qz(e){const t=e.rehypePlugins||LT,n=e.remarkPlugins||LT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...MT}:MT;return zz().use(RH).use(n).use(kz,r).use(t)}function Zz(e){const t=e.children||"",n=new KR;return typeof t=="string"&&(n.value=t),n}function Jz(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||eV;for(const d of Gz)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Wz+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Ed(e,u),p7(e,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in zg)if(Object.hasOwn(zg,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],y=zg[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=l(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function eV(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||qz.test(e.slice(0,t))?e:""}function DT(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function tV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function nV(e,t,n){const s=bd((n||{}).ignore||[]),i=rV(t);let a=-1;for(;++a0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=_+1:(m!==_&&E.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(T)?E.push(...T):T&&E.push(T),m=_+b[0].length,g=!0),!h.global)break;b=h.exec(u.value)}return g?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=DT(e,"(");let i=DT(e,")");for(;r!==-1&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function YR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Va(n)||ym(n))&&(!t||n!==47)}WR.peek=kV;function bV(){this.buffer()}function EV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function xV(){this.buffer()}function wV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _V(e){this.exit(e)}function TV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NV(e){this.exit(e)}function kV(){return"["}function WR(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function SV(){return{enter:{gfmFootnoteCallString:bV,gfmFootnoteCall:EV,gfmFootnoteDefinitionLabelString:xV,gfmFootnoteDefinition:wV},exit:{gfmFootnoteCallString:vV,gfmFootnoteCall:_V,gfmFootnoteDefinitionLabelString:TV,gfmFootnoteDefinition:NV}}}function AV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:WR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?` +`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?qR:CV))),u(),l}}function CV(e,t,n){return t===0?e:qR(e,t,n)}function qR(e,t,n){return(n?"":" ")+e}const IV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];GR.peek=DV;function RV(){return{canContainEols:["delete"],enter:{strikethrough:LV},exit:{strikethrough:MV}}}function OV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:IV}],handlers:{delete:GR}}}function LV(e){this.enter({type:"delete",children:[]},e)}function MV(e){this.exit(e)}function GR(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function DV(){return"~"}function PV(e){return e.length}function jV(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||PV,i=[],a=[],o=[],l=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++gl[g])&&(l[g]=b)}y.push(E)}a[d]=y,o[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=E),p[f]=E),h[f]=b}a.splice(1,0,h),o.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),UV);return s(),a}function UV(e,t,n){return">"+(n?"":" ")+e}function $V(e,t){return BT(e,t.inConstruct,!0)&&!BT(e,t.notInConstruct,!1)}function BT(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ra&&(a=i):i=1,s=r+t.length,r=n.indexOf(t,s);return a}function zV(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function VV(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function KV(e,t,n,r){const s=VV(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(zV(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,YV);return f(),h}const o=n.createTracker(r),l=s.repeat(Math.max(HV(i,s)+1,3)),u=n.enter("codeFenced");let d=o.move(l);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...o.current()})),f()}return d+=o.move(` `),i&&(d+=o.move(i+` -`)),d+=o.move(l),u(),d}function VV(e,t,n){return(n?"":" ")+e}function qE(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function KV(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function YV(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Pu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function hp(e,t,n){const r=ml(e),s=ml(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}XR.peek=WV;function XR(e,t,n,r){const s=YV(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=hp(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Pu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=hp(r.after.charCodeAt(0),f,s);h.inside&&(l=l.slice(0,-1)+Pu(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function WV(e,t,n){return n.options.emphasis||"*"}function qV(e,t){let n=!1;return yd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,h1}),!!((!e.depth||e.depth<3)&&UE(e)&&(t.options.setext||n))}function GV(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(qV(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:` +`)),d+=o.move(l),u(),d}function YV(e,t,n){return(n?"":" ")+e}function qE(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function WV(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function qV(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Bu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mp(e,t,n){const r=gl(e),s=gl(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}QR.peek=GV;function QR(e,t,n,r){const s=qV(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=mp(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Bu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=mp(r.after.charCodeAt(0),f,s);h.inside&&(l=l.slice(0,-1)+Bu(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function GV(e,t,n){return n.options.emphasis||"*"}function XV(e,t){let n=!1;return Ed(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,p1}),!!((!e.depth||e.depth<3)&&UE(e)&&(t.options.setext||n))}function QV(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(XV(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:` `,after:` `});return f(),d(),h+` `+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const a="#".repeat(s),o=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=Pu(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}QR.peek=XV;function QR(e){return e.value||""}function XV(){return"<"}ZR.peek=QV;function ZR(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function QV(){return"!"}JR.peek=ZV;function JR(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function ZV(){return"!"}eO.peek=JV;function eO(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}nO.peek=eK;function nO(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(tO(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function eK(e,t,n){return tO(e,n)?"<":"["}rO.peek=tK;function rO(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function tK(){return"["}function GE(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function nK(e){const t=GE(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function rK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function sO(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function sK(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?rK(n):GE(n);const o=e.ordered?a==="."?")":".":nK(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),sO(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return l(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?i:i+" ".repeat(a-i.length))+f}}function oK(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const lK=gd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function cK(e,t,n,r){return(e.children.some(function(a){return lK(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function uK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}iO.peek=dK;function iO(e,t,n,r){const s=uK(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=hp(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Pu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=hp(r.after.charCodeAt(0),f,s);h.inside&&(l=l.slice(0,-1)+Pu(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function dK(e,t,n){return n.options.strong||"*"}function fK(e,t,n,r){return n.safe(e.value,r)}function hK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function pK(e,t,n){const r=(sO(n)+(n.options.ruleSpaces?" ":"")).repeat(hK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const aO={blockquote:jV,break:FT,code:zV,definition:KV,emphasis:XR,hardBreak:FT,heading:GV,html:QR,image:ZR,imageReference:JR,inlineCode:eO,link:nO,linkReference:rO,list:sK,listItem:aK,paragraph:oK,root:cK,strong:iO,text:fK,thematicBreak:pK};function mK(){return{enter:{table:gK,tableData:UT,tableHeader:UT,tableRow:bK},exit:{codeText:EK,table:yK,tableData:t0,tableHeader:t0,tableRow:t0}}}function gK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function yK(e){this.exit(e),this.data.inTable=void 0}function bK(e){this.enter({type:"tableRow",children:[]},e)}function t0(e){this.exit(e)}function UT(e){this.enter({type:"tableCell",children:[]},e)}function EK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,xK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function xK(e,t){return t==="|"?t:e}function wK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";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:h,table:a,tableCell:l,tableRow:o}};function a(p,m,b,w){return u(d(p,b,w),p.align)}function o(p,m,b,w){const g=f(p,b,w),E=u([g]);return E.slice(0,E.indexOf(` -`))}function l(p,m,b,w){const g=b.enter("tableCell"),E=b.enter("phrasing"),y=b.containerPhrasing(p,{...w,before:i,after:i});return E(),g(),y}function u(p,m){return DV(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,b){const w=p.children;let g=-1;const E=[],y=m.enter("table");for(;++g0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const FK={tokenize:WK,partial:!0};function UK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:VK,continuation:{tokenize:KK},exit:YK}},text:{91:{name:"gfmFootnoteCall",tokenize:zK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:$K,resolveTo:HK}}}}function $K(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=ds(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function HK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function zK(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!a||f===null||f===91||Ct(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(ds(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ct(f)||(a=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function VK(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(a>999||m===93&&!o||m===null||m===91||Ct(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return i=ds(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ct(m)||(o=!0),a++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(i)||s.push(i),dt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function KK(e,t,n){return e.check(md,t,e.attempt(FK,t,n))}function YK(e){e.exit("gfmFootnoteDefinition")}function WK(e,t,n){const r=this;return dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function qK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(m):(a.consume(m),f++,p);if(f<2&&!n)return l(m);const w=a.exit("strikethroughSequenceTemporary"),g=ml(m);return w._open=!g||g===2&&!!b,w._close=!b||b===2&&!!g,o(m)}}}class GK{constructor(){this.map=[]}add(t,n,r){XK(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function XK(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const P=r.events[M][1].type;if(P==="lineEnding"||P==="linePrefix")M--;else break}const B=M>-1?r.events[M][1].type:null,Y=B==="tableHead"||B==="tableRow"?T:l;return Y===T&&r.parser.lazy[r.now().line]?n(I):Y(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):Fe(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):it(I)?dt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||Ct(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,it(I)?dt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),b):k(I)}function b(I){return it(I)?dt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),g):I===45?(i+=1,g(I)):I===null||Fe(I)?_(I):k(I)}function g(I){return I===45?(e.enter("tableDelimiterFiller"),E(I)):k(I)}function E(I){return I===45?(e.consume(I),E):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(I))}function y(I){return it(I)?dt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||Fe(I)?!a||s!==i?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function T(I){return e.enter("tableRow"),C(I)}function C(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),C):I===null||Fe(I)?(e.exit("tableRow"),t(I)):it(I)?dt(e,C,"whitespace")(I):(e.enter("data"),N(I))}function N(I){return I===null||I===124||Ct(I)?(e.exit("data"),C(I)):(e.consume(I),I===92?R:N)}function R(I){return I===92||I===124?(e.consume(I),N):N(I)}}function eY(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,d,f;const h=new GK;for(;++nn[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;e.add(m,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},yo(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function HT(e,t,n,r,s){const i=[],a=yo(t.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function yo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const tY={name:"tasklistCheck",tokenize:rY};function nY(){return{text:{91:tY}}}function rY(e,t,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return Ct(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Fe(l)?t(l):it(l)?e.check({tokenize:sY},t,n)(l):n(l)}}function sY(e,t,n){return dt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function iY(e){return _R([IK(),UK(),qK(e),ZK(),nY()])}const aY={};function oY(e){const t=this,n=e||aY,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(iY(n)),i.push(NK()),a.push(SK(n))}const zT=function(e,t,n){const r=gd(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&l.push(` -`.repeat(u)||" "),u=-1,l.push(d))}return l.join("")}function gO(e,t,n){return e.type==="element"?mY(e,t,n):e.type==="text"?n.whitespace==="normal"?yO(e,n):gY(e):[]}function mY(e,t,n){const r=bO(e,n),s=e.children||[];let i=-1,a=[];if(hY(e))return a;let o,l;for(b1(e)||WT(e)&&zT(t,e,WT)?l=` -`:fY(e)?(o=2,l=2):mO(e)&&(o=1,l=1);++i]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:b,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[k,f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function _Y(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=vY(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function EO(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(o);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],g={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],y=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:w,built_in:[...E,...y,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,g,o,l,u,d,n]}}function TY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},g=[f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:g.concat([{begin:/\(/,end:/\)/,keywords:w,contains:g.concat(["self"]),relevance:0}]),relevance:0},y={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function kY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:b,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[k,f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function NY(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:t,literal:r},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=e.inherit(h,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[b,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[u,b,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},y=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+y+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const SY=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),AY=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],CY=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],IY=[...AY,...CY],RY=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),OY=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),LY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),MY=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function DY(e){const t=e.regex,n=SY(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+OY.join("|")+")"},{begin:":(:)?("+LY.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+MY.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:RY.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+IY.join("|")+")\\b"}]}}function PY(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function jY(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"wO(e,t,n-1))}function FY(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+wO("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,qT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},qT,u]}}const GT="[A-Za-z$_][0-9A-Za-z$_]*",UY=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],$Y=["true","false","null","undefined","NaN","Infinity"],vO=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],_O=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],TO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],HY=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zY=[].concat(TO,vO,_O);function kO(e){const t=e.regex,n=(O,{after:j})=>{const S="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const S=O[0].length+O.index,H=O.input[S];if(H==="<"||H===","){j.ignoreMatch();return}H===">"&&(n(O,{after:S})||j.ignoreMatch());let V;const D=O.input.substring(S);if(V=D.match(/^\s*=/)){j.ignoreMatch();return}if((V=D.match(/^\s+extends\s+/))&&V.index===0){j.ignoreMatch();return}}},o={$pattern:GT,keyword:UY,literal:$Y,built_in:zY,"variable.language":HY},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,b,w,{match:/\$\d+/},f];h.contains=y.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(y)});const _=[].concat(E,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k},C={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...vO,..._O]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,B([...TO,"super","import"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,b,w,E,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,M,C,U,{match:/\$[(.]/}]}}function NO(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Eo="[0-9](_*[0-9])*",_f=`\\.(${Eo})`,Tf="[0-9a-fA-F](_*[0-9a-fA-F])*",VY={className:"number",variants:[{begin:`(\\b(${Eo})((${_f})|\\.)?|(${_f}))[eE][+-]?(${Eo})[fFdD]?\\b`},{begin:`\\b(${Eo})((${_f})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_f})[fFdD]?\\b`},{begin:`\\b(${Eo})[fFdD]\\b`},{begin:`\\b0[xX]((${Tf})\\.?|(${Tf})?\\.(${Tf}))[pP][+-]?(${Eo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Tf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function KY(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,s]}]};s.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=VY,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,o,l,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const YY=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),WY=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],qY=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],GY=[...WY,...qY],XY=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),SO=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),AO=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),QY=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),ZY=SO.concat(AO).sort().reverse();function JY(e){const t=YY(e),n=ZY,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],o=[],l=function(y){return{className:"string",begin:"~?"+y+".*?"+y}},u=function(y,_,k){return{className:y,begin:_,relevance:k}},d={$pattern:/[a-z-]+/,keyword:r,attribute:XY.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:d,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+s,10),u("variable","@\\{"+s+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+QY.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:o,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+s+"\\}"),{begin:"\\b("+GY.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",i,0),u("selector-id","#"+i),u("selector-class","\\."+i,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+SO.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+AO.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,w,E,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function eW(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function CO(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,l];return[u,d,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,i,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},s,r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tW(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function nW(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,i,l],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,w,g="\\1")=>{const E=g==="\\1"?g:t.concat(g,w);return t.concat(t.concat("(?:",b,")"),w,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,g,r)},p=(b,w,g)=>t.concat(t.concat("(?:",b,")"),w,/(?:\\.|[^\\\/])*?/,g,r),m=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:m}}function rW(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(P,U)=>{U.data._beginMatch=P[1]||P[2]},"on:end":(P,U)=>{U.data._beginMatch!==P[1]&&U.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,m={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:g,literal:(P=>{const U=[];return P.forEach(A=>{U.push(A),A.toLowerCase()===A?U.push(A.toUpperCase()):U.push(A.toLowerCase())}),U})(w),built_in:E},k=P=>P.map(U=>U.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(E).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,N,e.C_BLOCK_COMMENT_MODE,m,b,T]},M={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(g).join("\\b|"),"|",k(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(M);const B=[R,N,e.C_BLOCK_COMMENT_MODE,m,b,T],Y={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},a,M,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",Y,a,N,e.C_BLOCK_COMMENT_MODE,m,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,b]}}function sW(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function iW(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function RO(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${r.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,g,f]}]}}function aW(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function oW(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function lW(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},T=[f,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);d.contains=T,b.contains=T;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:T}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(I).concat(u).concat(T)}}function cW(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:o,literal:l,built_in:u},illegal:""},i]}}const uW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),dW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],hW=[...dW,...fW],pW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),mW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),gW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),yW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function bW(e){const t=uW(e),n=gW,r=mW,s="@[a-z-]+",i="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+hW.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+yW.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:pW.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function EW(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function xW(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...l].filter(k=>!d.includes(k)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(k){return t.concat(/\b/,t.either(...k.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const y={scope:"keyword",match:E(h),relevance:0};function _(k,{exceptions:T,when:C}={}){const N=C;return T=T||[],k.map(R=>R.match(/\|\d+$/)||T.includes(R)?R:N(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:k=>k.length<3}),literal:i,type:o,built_in:f},contains:[{scope:"type",match:E(a)},y,g,b,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function OO(e){return e?typeof e=="string"?e:e.source:null}function fc(e){return St("(?=",e,")")}function St(...e){return e.map(n=>OO(n)).join("")}function wW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function nr(...e){return"("+(wW(e).capture?"":"?:")+e.map(r=>OO(r)).join("|")+")"}const ZE=e=>St(/\b/,e,/\w$/.test(e)?/\b/:/\B/),vW=["Protocol","Type"].map(ZE),XT=["init","self"].map(ZE),_W=["Any","Self"],n0=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],QT=["false","nil","true"],TW=["assignment","associativity","higherThan","left","lowerThan","none","right"],kW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ZT=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],LO=nr(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),MO=nr(LO,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),r0=St(LO,MO,"*"),DO=nr(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),pp=nr(DO,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),vs=St(DO,pp,"*"),kf=St(/[A-Z]/,pp,"*"),NW=["attached","autoclosure",St(/convention\(/,nr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",St(/objc\(/,vs,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],SW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function AW(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,nr(...vW,...XT)],className:{2:"keyword"}},i={match:St(/\./,nr(...n0)),relevance:0},a=n0.filter(ge=>typeof ge=="string").concat(["_|0"]),o=n0.filter(ge=>typeof ge!="string").concat(_W).map(ZE),l={variants:[{className:"keyword",match:nr(...o,...XT)}]},u={$pattern:nr(/\b\w+/,/#\w+/),keyword:a.concat(kW),literal:QT},d=[s,i,l],f={match:St(/\./,nr(...ZT)),relevance:0},h={className:"built_in",match:St(/\b/,nr(...ZT),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:r0},{match:`\\.(\\.|${MO})+`}]},w=[m,b],g="([0-9]_*)+",E="([0-9a-fA-F]_*)+",y={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(ge="")=>({className:"subst",variants:[{match:St(/\\/,ge,/[0\\tnr"']/)},{match:St(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(ge="")=>({className:"subst",match:St(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(ge="")=>({className:"subst",label:"interpol",begin:St(/\\/,ge,/\(/),end:/\)/}),C=(ge="")=>({begin:St(ge,/"""/),end:St(/"""/,ge),contains:[_(ge),k(ge),T(ge)]}),N=(ge="")=>({begin:St(ge,/"/),end:St(/"/,ge),contains:[_(ge),T(ge)]}),R={className:"string",variants:[C(),C("#"),C("##"),C("###"),N(),N("#"),N("##"),N("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],M={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},B=ge=>{const Me=St(ge,/\//),ve=St(/\//,ge);return{begin:Me,end:ve,contains:[...I,{scope:"comment",begin:`#(?!.*${ve})`,end:/$/}]}},Y={scope:"regexp",variants:[B("###"),B("##"),B("#"),M]},P={match:St(/`/,vs,/`/)},U={className:"variable",match:/\$\d+/},A={className:"variable",match:`\\$${pp}+`},L=[P,U,A],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:SW,contains:[...w,y,R]}]}},j={scope:"keyword",match:St(/@/,nr(...NW),fc(nr(/\(/,/\s+/)))},S={scope:"meta",match:St(/@/,vs)},H=[O,j,S],V={match:fc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:St(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,pp,"+")},{className:"type",match:kf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:St(/\s+&\s+/,fc(kf)),relevance:0}]},D={begin://,keywords:u,contains:[...r,...d,...H,m,V]};V.contains.push(D);const ne={match:St(vs,/\s*:/),keywords:"_|0",relevance:0},J={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ne,...r,Y,...d,...p,...w,y,R,...L,...H,V]},re={begin://,keywords:"repeat each",contains:[...r,V]},de={begin:nr(fc(St(vs,/\s*:/)),fc(St(vs,/\s+/,vs,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:vs}]},G={begin:/\(/,end:/\)/,keywords:u,contains:[de,...r,...d,...w,y,R,...H,V,J],endsParent:!0,illegal:/["']/},W={match:[/(func|macro)/,/\s+/,nr(P.match,vs,r0)],className:{1:"keyword",3:"title.function"},contains:[re,G,t],illegal:[/\[/,/%/]},ae={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[re,G,t],illegal:/\[|%/},he={match:[/operator/,/\s+/,r0],className:{1:"keyword",3:"title"}},Z={begin:[/precedencegroup/,/\s+/,kf],className:{1:"keyword",3:"title"},contains:[V],keywords:[...TW,...QT],end:/}/},ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,vs,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[re,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:kf},...d],relevance:0}]};for(const ge of R.variants){const Me=ge.contains.find($e=>$e.label==="interpol");Me.keywords=u;const ve=[...d,...p,...w,y,R,...L];Me.contains=[...ve,{begin:/\(/,end:/\)/,contains:["self",...ve]}]}return{name:"Swift",keywords:u,contains:[...r,W,ae,ce,Ce,Ee,he,Z,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Y,...d,...p,...w,y,R,...L,...H,V,J]}}const mp="[A-Za-z$_][0-9A-Za-z$_]*",PO=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],jO=["true","false","null","undefined","NaN","Infinity"],BO=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],FO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],UO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$O=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],HO=[].concat(UO,BO,FO);function CW(e){const t=e.regex,n=(O,{after:j})=>{const S="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const S=O[0].length+O.index,H=O.input[S];if(H==="<"||H===","){j.ignoreMatch();return}H===">"&&(n(O,{after:S})||j.ignoreMatch());let V;const D=O.input.substring(S);if(V=D.match(/^\s*=/)){j.ignoreMatch();return}if((V=D.match(/^\s+extends\s+/))&&V.index===0){j.ignoreMatch();return}}},o={$pattern:mp,keyword:PO,literal:jO,built_in:HO,"variable.language":$O},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,b,w,{match:/\$\d+/},f];h.contains=y.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(y)});const _=[].concat(E,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k},C={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...BO,...FO]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,B([...UO,"super","import"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,b,w,E,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,M,C,U,{match:/\$[(.]/}]}}function zO(e){const t=e.regex,n=CW(e),r=mp,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:mp,keyword:PO.concat(l),literal:jO,built_in:HO.concat(s),"variable.language":$O},d={className:"meta",begin:"@"+r},f=(b,w,g)=>{const E=b.contains.findIndex(y=>y.label===w);if(E===-1)throw new Error("can not find mode to replace");b.contains.splice(E,1,g)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,i,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);const m=n.contains.find(b=>b.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function IW(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,o),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function RW(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,a,s,e.QUOTE_STRING_MODE,l,u,o]}}function OW(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,l,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function VO(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,b,i,a],g=[...w];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const LW={arduino:_Y,bash:EO,c:TY,cpp:kY,csharp:NY,css:DY,diff:PY,go:jY,graphql:BY,ini:xO,java:FY,javascript:kO,json:NO,kotlin:KY,less:JY,lua:eW,makefile:CO,markdown:IO,objectivec:tW,perl:nW,php:rW,"php-template":sW,plaintext:iW,python:RO,"python-repl":aW,r:oW,ruby:lW,rust:cW,scss:bW,shell:EW,sql:xW,swift:AW,typescript:zO,vbnet:IW,wasm:RW,xml:OW,yaml:VO};function KO(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&KO(n)}),e}let JT=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function YO(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ri(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const MW="",ek=e=>!!e.scope,DW=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class PW{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=YO(t)}openNode(t){if(!ek(t))return;const n=DW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){ek(t)&&(this.buffer+=MW)}value(){return this.buffer}span(t){this.buffer+=``}}const tk=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class JE{constructor(){this.rootNode=tk(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=tk({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{JE._collapse(n)}))}}class jW extends JE{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new PW(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ju(e){return e?typeof e=="string"?e:e.source:null}function WO(e){return no("(?=",e,")")}function BW(e){return no("(?:",e,")*")}function FW(e){return no("(?:",e,")?")}function no(...e){return e.map(n=>ju(n)).join("")}function UW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ex(...e){return"("+(UW(e).capture?"":"?:")+e.map(r=>ju(r)).join("|")+")"}function qO(e){return new RegExp(e.toString()+"|").exec("").length-1}function $W(e,t){const n=e&&e.exec(t);return n&&n.index===0}const HW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function tx(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=ju(r),a="";for(;i.length>0;){const o=HW.exec(i);if(!o){a+=i;break}a+=i.substring(0,o.index),i=i.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+s):(a+=o[0],o[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const zW=/\b\B/,GO="[a-zA-Z]\\w*",nx="[a-zA-Z_]\\w*",XO="\\b\\d+(\\.\\d+)?",QO="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ZO="\\b(0b[01]+)",VW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",KW=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=no(t,/.*\b/,e.binary,/\b.*/)),Ri({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Bu={begin:"\\\\[\\s\\S]",relevance:0},YW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Bu]},WW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Bu]},qW={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Em=function(e,t,n={}){const r=Ri({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=ex("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:no(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},GW=Em("//","$"),XW=Em("/\\*","\\*/"),QW=Em("#","$"),ZW={scope:"number",begin:XO,relevance:0},JW={scope:"number",begin:QO,relevance:0},eq={scope:"number",begin:ZO,relevance:0},tq={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Bu,{begin:/\[/,end:/\]/,relevance:0,contains:[Bu]}]},nq={scope:"title",begin:GO,relevance:0},rq={scope:"title",begin:nx,relevance:0},sq={begin:"\\.\\s*"+nx,relevance:0},iq=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var Nf=Object.freeze({__proto__:null,APOS_STRING_MODE:YW,BACKSLASH_ESCAPE:Bu,BINARY_NUMBER_MODE:eq,BINARY_NUMBER_RE:ZO,COMMENT:Em,C_BLOCK_COMMENT_MODE:XW,C_LINE_COMMENT_MODE:GW,C_NUMBER_MODE:JW,C_NUMBER_RE:QO,END_SAME_AS_BEGIN:iq,HASH_COMMENT_MODE:QW,IDENT_RE:GO,MATCH_NOTHING_RE:zW,METHOD_GUARD:sq,NUMBER_MODE:ZW,NUMBER_RE:XO,PHRASAL_WORDS_MODE:qW,QUOTE_STRING_MODE:WW,REGEXP_MODE:tq,RE_STARTERS_RE:VW,SHEBANG:KW,TITLE_MODE:nq,UNDERSCORE_IDENT_RE:nx,UNDERSCORE_TITLE_MODE:rq});function aq(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function oq(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function lq(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=aq,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function cq(e,t){Array.isArray(e.illegal)&&(e.illegal=ex(...e.illegal))}function uq(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function dq(e,t){e.relevance===void 0&&(e.relevance=1)}const fq=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=no(n.beforeMatch,WO(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},hq=["of","and","for","in","not","or","if","then","parent","list","value"],pq="keyword";function JO(e,t,n=pq){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(i){Object.assign(r,JO(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const l=o.split("|");r[l[0]]=[i,mq(l[0],l[1])]})}}function mq(e,t){return t?Number(t):gq(e)?0:1}function gq(e){return hq.includes(e.toLowerCase())}const nk={},Ra=e=>{console.error(e)},rk=(e,...t)=>{console.log(`WARN: ${e}`,...t)},fo=(e,t)=>{nk[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),nk[`${e}/${t}`]=!0)},gp=new Error;function eL(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let o=1;o<=t.length;o++)a[o+r]=s[o],i[o+r]=!0,r+=qO(t[o-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function yq(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ra("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),gp;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ra("beginScope must be object"),gp;eL(e,e.begin,{key:"beginScope"}),e.begin=tx(e.begin,{joinWith:""})}}function bq(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ra("skip, excludeEnd, returnEnd not compatible with endScope: {}"),gp;if(typeof e.endScope!="object"||e.endScope===null)throw Ra("endScope must be object"),gp;eL(e,e.end,{key:"endScope"}),e.end=tx(e.end,{joinWith:""})}}function Eq(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function xq(e){Eq(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),yq(e),bq(e)}function wq(e){function t(a,o){return new RegExp(ju(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=qO(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=t(tx(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const u=l.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new n;return this.rules.slice(o).forEach(([u,d])=>l.addRule(u,d)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const o=new r;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function i(a,o){const l=a;if(a.isCompiled)return l;[oq,uq,xq,fq].forEach(d=>d(a,o)),e.compilerExtensions.forEach(d=>d(a,o)),a.__beforeBegin=null,[lq,cq,dq].forEach(d=>d(a,o)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=JO(a.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=ju(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return vq(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,l)}),a.starts&&i(a.starts,o),l.matcher=s(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Ri(e.classNameAliases||{}),i(e)}function tL(e){return e?e.endsWithParent||tL(e.starts):!1}function vq(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ri(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:tL(e)?Ri(e,{starts:e.starts?Ri(e.starts):null}):Object.isFrozen(e)?Ri(e):e}var _q="11.11.1";class Tq extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const s0=YO,sk=Ri,ik=Symbol("nomatch"),kq=7,nL=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:jW};function l(A){return o.noHighlightRe.test(A)}function u(A){let L=A.className+" ";L+=A.parentNode?A.parentNode.className:"";const O=o.languageDetectRe.exec(L);if(O){const j=N(O[1]);return j||(rk(i.replace("{}",O[1])),rk("Falling back to no-highlight mode for this block.",A)),j?O[1]:"no-highlight"}return L.split(/\s+/).find(j=>l(j)||N(j))}function d(A,L,O){let j="",S="";typeof L=="object"?(j=A,O=L.ignoreIllegals,S=L.language):(fo("10.7.0","highlight(lang, code, ...args) has been deprecated."),fo("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),S=A,j=L),O===void 0&&(O=!0);const H={code:j,language:S};P("before:highlight",H);const V=H.result?H.result:f(H.language,H.code,O);return V.code=H.code,P("after:highlight",V),V}function f(A,L,O,j){const S=Object.create(null);function H(K,X){return K.keywords[X]}function V(){if(!ve.keywords){Re.addText(oe);return}let K=0;ve.keywordPatternRe.lastIndex=0;let X=ve.keywordPatternRe.exec(oe),le="";for(;X;){le+=oe.substring(K,X.index);const ke=Ee.case_insensitive?X[0].toLowerCase():X[0],Oe=H(ve,ke);if(Oe){const[ut,We]=Oe;if(Re.addText(le),le="",S[ke]=(S[ke]||0)+1,S[ke]<=kq&&(_t+=We),ut.startsWith("_"))le+=X[0];else{const ot=Ee.classNameAliases[ut]||ut;J(X[0],ot)}}else le+=X[0];K=ve.keywordPatternRe.lastIndex,X=ve.keywordPatternRe.exec(oe)}le+=oe.substring(K),Re.addText(le)}function D(){if(oe==="")return;let K=null;if(typeof ve.subLanguage=="string"){if(!t[ve.subLanguage]){Re.addText(oe);return}K=f(ve.subLanguage,oe,!0,$e[ve.subLanguage]),$e[ve.subLanguage]=K._top}else K=p(oe,ve.subLanguage.length?ve.subLanguage:null);ve.relevance>0&&(_t+=K.relevance),Re.__addSublanguage(K._emitter,K.language)}function ne(){ve.subLanguage!=null?D():V(),oe=""}function J(K,X){K!==""&&(Re.startScope(X),Re.addText(K),Re.endScope())}function re(K,X){let le=1;const ke=X.length-1;for(;le<=ke;){if(!K._emit[le]){le++;continue}const Oe=Ee.classNameAliases[K[le]]||K[le],ut=X[le];Oe?J(ut,Oe):(oe=ut,V(),oe=""),le++}}function de(K,X){return K.scope&&typeof K.scope=="string"&&Re.openNode(Ee.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(J(oe,Ee.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),oe=""):K.beginScope._multi&&(re(K.beginScope,X),oe="")),ve=Object.create(K,{parent:{value:ve}}),ve}function G(K,X,le){let ke=$W(K.endRe,le);if(ke){if(K["on:end"]){const Oe=new JT(K);K["on:end"](X,Oe),Oe.isMatchIgnored&&(ke=!1)}if(ke){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return G(K.parent,X,le)}function W(K){return ve.matcher.regexIndex===0?(oe+=K[0],1):(ct=!0,0)}function ae(K){const X=K[0],le=K.rule,ke=new JT(le),Oe=[le.__beforeBegin,le["on:begin"]];for(const ut of Oe)if(ut&&(ut(K,ke),ke.isMatchIgnored))return W(X);return le.skip?oe+=X:(le.excludeBegin&&(oe+=X),ne(),!le.returnBegin&&!le.excludeBegin&&(oe=X)),de(le,K),le.returnBegin?0:X.length}function he(K){const X=K[0],le=L.substring(K.index),ke=G(ve,K,le);if(!ke)return ik;const Oe=ve;ve.endScope&&ve.endScope._wrap?(ne(),J(X,ve.endScope._wrap)):ve.endScope&&ve.endScope._multi?(ne(),re(ve.endScope,K)):Oe.skip?oe+=X:(Oe.returnEnd||Oe.excludeEnd||(oe+=X),ne(),Oe.excludeEnd&&(oe=X));do ve.scope&&Re.closeNode(),!ve.skip&&!ve.subLanguage&&(_t+=ve.relevance),ve=ve.parent;while(ve!==ke.parent);return ke.starts&&de(ke.starts,K),Oe.returnEnd?0:X.length}function Z(){const K=[];for(let X=ve;X!==Ee;X=X.parent)X.scope&&K.unshift(X.scope);K.forEach(X=>Re.openNode(X))}let ce={};function Ce(K,X){const le=X&&X[0];if(oe+=K,le==null)return ne(),0;if(ce.type==="begin"&&X.type==="end"&&ce.index===X.index&&le===""){if(oe+=L.slice(X.index,X.index+1),!s){const ke=new Error(`0 width match regex (${A})`);throw ke.languageName=A,ke.badRule=ce.rule,ke}return 1}if(ce=X,X.type==="begin")return ae(X);if(X.type==="illegal"&&!O){const ke=new Error('Illegal lexeme "'+le+'" for mode "'+(ve.scope||"")+'"');throw ke.mode=ve,ke}else if(X.type==="end"){const ke=he(X);if(ke!==ik)return ke}if(X.type==="illegal"&&le==="")return oe+=` -`,1;if(Tt>1e5&&Tt>X.index*3)throw new Error("potential infinite loop, way more iterations than matches");return oe+=le,le.length}const Ee=N(A);if(!Ee)throw Ra(i.replace("{}",A)),new Error('Unknown language: "'+A+'"');const ge=wq(Ee);let Me="",ve=j||ge;const $e={},Re=new o.__emitter(o);Z();let oe="",_t=0,we=0,Tt=0,ct=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(L,Re);else{for(ve.matcher.considerAll();;){Tt++,ct?ct=!1:ve.matcher.considerAll(),ve.matcher.lastIndex=we;const K=ve.matcher.exec(L);if(!K)break;const X=L.substring(we,K.index),le=Ce(X,K);we=K.index+le}Ce(L.substring(we))}return Re.finalize(),Me=Re.toHTML(),{language:A,value:Me,relevance:_t,illegal:!1,_emitter:Re,_top:ve}}catch(K){if(K.message&&K.message.includes("Illegal"))return{language:A,value:s0(L),illegal:!0,relevance:0,_illegalBy:{message:K.message,index:we,context:L.slice(we-100,we+100),mode:K.mode,resultSoFar:Me},_emitter:Re};if(s)return{language:A,value:s0(L),illegal:!1,relevance:0,errorRaised:K,_emitter:Re,_top:ve};throw K}}function h(A){const L={value:s0(A),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return L._emitter.addText(A),L}function p(A,L){L=L||o.languages||Object.keys(t);const O=h(A),j=L.filter(N).filter(I).map(ne=>f(ne,A,!1));j.unshift(O);const S=j.sort((ne,J)=>{if(ne.relevance!==J.relevance)return J.relevance-ne.relevance;if(ne.language&&J.language){if(N(ne.language).supersetOf===J.language)return 1;if(N(J.language).supersetOf===ne.language)return-1}return 0}),[H,V]=S,D=H;return D.secondBest=V,D}function m(A,L,O){const j=L&&n[L]||O;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function b(A){let L=null;const O=u(A);if(l(O))return;if(P("before:highlightElement",{el:A,language:O}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),o.throwUnescapedHTML))throw new Tq("One of your code blocks includes unescaped HTML.",A.innerHTML);L=A;const j=L.textContent,S=O?d(j,{language:O,ignoreIllegals:!0}):p(j);A.innerHTML=S.value,A.dataset.highlighted="yes",m(A,O,S.language),A.result={language:S.language,re:S.relevance,relevance:S.relevance},S.secondBest&&(A.secondBest={language:S.secondBest.language,relevance:S.secondBest.relevance}),P("after:highlightElement",{el:A,result:S,text:j})}function w(A){o=sk(o,A)}const g=()=>{_(),fo("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){_(),fo("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let y=!1;function _(){function A(){_()}if(document.readyState==="loading"){y||window.addEventListener("DOMContentLoaded",A,!1),y=!0;return}document.querySelectorAll(o.cssSelector).forEach(b)}function k(A,L){let O=null;try{O=L(e)}catch(j){if(Ra("Language definition for '{}' could not be registered.".replace("{}",A)),s)Ra(j);else throw j;O=a}O.name||(O.name=A),t[A]=O,O.rawDefinition=L.bind(null,e),O.aliases&&R(O.aliases,{languageName:A})}function T(A){delete t[A];for(const L of Object.keys(n))n[L]===A&&delete n[L]}function C(){return Object.keys(t)}function N(A){return A=(A||"").toLowerCase(),t[A]||t[n[A]]}function R(A,{languageName:L}){typeof A=="string"&&(A=[A]),A.forEach(O=>{n[O.toLowerCase()]=L})}function I(A){const L=N(A);return L&&!L.disableAutodetect}function M(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=L=>{A["before:highlightBlock"](Object.assign({block:L.el},L))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=L=>{A["after:highlightBlock"](Object.assign({block:L.el},L))})}function B(A){M(A),r.push(A)}function Y(A){const L=r.indexOf(A);L!==-1&&r.splice(L,1)}function P(A,L){const O=A;r.forEach(function(j){j[O]&&j[O](L)})}function U(A){return fo("10.7.0","highlightBlock will be removed entirely in v12.0"),fo("10.7.0","Please use highlightElement now."),b(A)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:b,highlightBlock:U,configure:w,initHighlighting:g,initHighlightingOnLoad:E,registerLanguage:k,unregisterLanguage:T,listLanguages:C,getLanguage:N,registerAliases:R,autoDetection:I,inherit:sk,addPlugin:B,removePlugin:Y}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=_q,e.regex={concat:no,lookahead:WO,either:ex,optional:FW,anyNumberOfTimes:BW};for(const A in Nf)typeof Nf[A]=="object"&&KO(Nf[A]);return Object.assign(e,Nf),e},yl=nL({});yl.newInstance=()=>nL({});var Nq=yl;yl.HighlightJS=yl;yl.default=yl;const Er=Ju(Nq),ak={},Sq="hljs-";function Aq(e){const t=Er.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:o};function n(l,u,d){const f=d||ak,h=typeof f.prefix=="string"?f.prefix:Sq;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:Cq,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,b=m.data;return b.language=p.language,b.relevance=p.relevance,m}function r(l,u){const f=(u||ak).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let d;for(d in l)Object.hasOwn(l,d)&&t.registerLanguage(d,l[d])}}function a(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let d;for(d in l)if(Object.hasOwn(l,d)){const f=l[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function o(l){return!!t.getLanguage(l)}}class Cq{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],s=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):r.children.push(...s)}openNode(t){const n=this,r=t.split(".").map(function(a,o){return o?a+"_".repeat(o):n.options.classPrefix+a}),s=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Iq={};function ok(e){const t=e||Iq,n=t.aliases,r=t.detect||!1,s=t.languages||LW,i=t.plainText,a=t.prefix,o=t.subset;let l="hljs";const u=Aq(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");l=d===-1?a:a.slice(0,d)}return function(d,f){yd(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const b=Rq(h);if(b===!1||!b&&!r||b&&i&&i.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(l)||h.properties.className.unshift(l);const w=pY(h,{whitespace:"pre"});let g;try{g=b?u.highlight(b,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:o})}catch(E){const y=E;if(b&&/Unknown language/.test(y.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[m,h],cause:y,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw y}!b&&g.data&&g.data.language&&h.properties.className.push("language-"+g.data.language),g.children.length>0&&(h.children=g.children)})}}function Rq(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n-1&&i<=t.length){let a=0;for(;;){let o=n[a];if(o===void 0){const l=uk(t,n[a-1]);o=l===-1?t.length+1:l+1,n[a]=o}if(o>i)return{line:a+1,column:i-(a>0?n[a-1]:0)+1,offset:i};a++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length1?n[i.line-2]:0)+i.column-1;if(a=55296&&e<=57343}function rG(e){return e>=56320&&e<=57343}function sG(e,t){return(e-55296)*1024+9216+t}function lL(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function cL(e){return e>=64976&&e<=65007||nG.has(e)}var se;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(se||(se={}));const iG=65536;class aG{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=iG,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:i}=this,a=s+n,o=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(rG(n))return this.pos++,this._addGap(),sG(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,F.EOF;return this._err(se.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;const r=this.html.charCodeAt(n);return r===F.CARRIAGE_RETURN?F.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;let t=this.html.charCodeAt(this.pos);return t===F.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,F.LINE_FEED):t===F.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,oL(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===F.LINE_FEED||t===F.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){lL(t)?this._err(se.controlCharacterInInputStream):cL(t)&&this._err(se.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const oG=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),lG=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function cG(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=lG.get(e))!==null&&t!==void 0?t:e}var Ln;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ln||(Ln={}));const uG=32;var Oi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Oi||(Oi={}));function x1(e){return e>=Ln.ZERO&&e<=Ln.NINE}function dG(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_F||e>=Ln.LOWER_A&&e<=Ln.LOWER_F}function fG(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_Z||e>=Ln.LOWER_A&&e<=Ln.LOWER_Z||x1(e)}function hG(e){return e===Ln.EQUALS||fG(e)}var Rn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Rn||(Rn={}));var Ks;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ks||(Ks={}));class pG{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Rn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ks.Strict}startEntity(t){this.decodeMode=t,this.state=Rn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Rn.EntityStart:return t.charCodeAt(n)===Ln.NUM?(this.state=Rn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Rn.NamedEntity,this.stateNamedEntity(t,n));case Rn.NumericStart:return this.stateNumericStart(t,n);case Rn.NumericDecimal:return this.stateNumericDecimal(t,n);case Rn.NumericHex:return this.stateNumericHex(t,n);case Rn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|uG)===Ln.LOWER_X?(this.state=Rn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Rn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(t.substr(n,i),s),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n>14;for(;n>14,i!==0){if(a===Ln.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ks.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&Oi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~Oi.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Rn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ks.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Rn.NumericDecimal:return this.emitNumericEntity(0,2);case Rn.NumericHex:return this.emitNumericEntity(0,3);case Rn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Rn.EntityStart:return 0}}}function mG(e,t,n,r){const s=(t&Oi.BRANCH_LENGTH)>>7,i=t&Oi.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=s?-1:e[n+l]-1}let a=n,o=a+s-1;for(;a<=o;){const l=a+o>>>1,u=e[l];if(ur)o=l-1;else return e[l+s]}return-1}var fe;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(fe||(fe={}));var Oa;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Oa||(Oa={}));var Hr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Hr||(Hr={}));var Q;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Q||(Q={}));var x;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(x||(x={}));const gG=new Map([[Q.A,x.A],[Q.ADDRESS,x.ADDRESS],[Q.ANNOTATION_XML,x.ANNOTATION_XML],[Q.APPLET,x.APPLET],[Q.AREA,x.AREA],[Q.ARTICLE,x.ARTICLE],[Q.ASIDE,x.ASIDE],[Q.B,x.B],[Q.BASE,x.BASE],[Q.BASEFONT,x.BASEFONT],[Q.BGSOUND,x.BGSOUND],[Q.BIG,x.BIG],[Q.BLOCKQUOTE,x.BLOCKQUOTE],[Q.BODY,x.BODY],[Q.BR,x.BR],[Q.BUTTON,x.BUTTON],[Q.CAPTION,x.CAPTION],[Q.CENTER,x.CENTER],[Q.CODE,x.CODE],[Q.COL,x.COL],[Q.COLGROUP,x.COLGROUP],[Q.DD,x.DD],[Q.DESC,x.DESC],[Q.DETAILS,x.DETAILS],[Q.DIALOG,x.DIALOG],[Q.DIR,x.DIR],[Q.DIV,x.DIV],[Q.DL,x.DL],[Q.DT,x.DT],[Q.EM,x.EM],[Q.EMBED,x.EMBED],[Q.FIELDSET,x.FIELDSET],[Q.FIGCAPTION,x.FIGCAPTION],[Q.FIGURE,x.FIGURE],[Q.FONT,x.FONT],[Q.FOOTER,x.FOOTER],[Q.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[Q.FORM,x.FORM],[Q.FRAME,x.FRAME],[Q.FRAMESET,x.FRAMESET],[Q.H1,x.H1],[Q.H2,x.H2],[Q.H3,x.H3],[Q.H4,x.H4],[Q.H5,x.H5],[Q.H6,x.H6],[Q.HEAD,x.HEAD],[Q.HEADER,x.HEADER],[Q.HGROUP,x.HGROUP],[Q.HR,x.HR],[Q.HTML,x.HTML],[Q.I,x.I],[Q.IMG,x.IMG],[Q.IMAGE,x.IMAGE],[Q.INPUT,x.INPUT],[Q.IFRAME,x.IFRAME],[Q.KEYGEN,x.KEYGEN],[Q.LABEL,x.LABEL],[Q.LI,x.LI],[Q.LINK,x.LINK],[Q.LISTING,x.LISTING],[Q.MAIN,x.MAIN],[Q.MALIGNMARK,x.MALIGNMARK],[Q.MARQUEE,x.MARQUEE],[Q.MATH,x.MATH],[Q.MENU,x.MENU],[Q.META,x.META],[Q.MGLYPH,x.MGLYPH],[Q.MI,x.MI],[Q.MO,x.MO],[Q.MN,x.MN],[Q.MS,x.MS],[Q.MTEXT,x.MTEXT],[Q.NAV,x.NAV],[Q.NOBR,x.NOBR],[Q.NOFRAMES,x.NOFRAMES],[Q.NOEMBED,x.NOEMBED],[Q.NOSCRIPT,x.NOSCRIPT],[Q.OBJECT,x.OBJECT],[Q.OL,x.OL],[Q.OPTGROUP,x.OPTGROUP],[Q.OPTION,x.OPTION],[Q.P,x.P],[Q.PARAM,x.PARAM],[Q.PLAINTEXT,x.PLAINTEXT],[Q.PRE,x.PRE],[Q.RB,x.RB],[Q.RP,x.RP],[Q.RT,x.RT],[Q.RTC,x.RTC],[Q.RUBY,x.RUBY],[Q.S,x.S],[Q.SCRIPT,x.SCRIPT],[Q.SEARCH,x.SEARCH],[Q.SECTION,x.SECTION],[Q.SELECT,x.SELECT],[Q.SOURCE,x.SOURCE],[Q.SMALL,x.SMALL],[Q.SPAN,x.SPAN],[Q.STRIKE,x.STRIKE],[Q.STRONG,x.STRONG],[Q.STYLE,x.STYLE],[Q.SUB,x.SUB],[Q.SUMMARY,x.SUMMARY],[Q.SUP,x.SUP],[Q.TABLE,x.TABLE],[Q.TBODY,x.TBODY],[Q.TEMPLATE,x.TEMPLATE],[Q.TEXTAREA,x.TEXTAREA],[Q.TFOOT,x.TFOOT],[Q.TD,x.TD],[Q.TH,x.TH],[Q.THEAD,x.THEAD],[Q.TITLE,x.TITLE],[Q.TR,x.TR],[Q.TRACK,x.TRACK],[Q.TT,x.TT],[Q.U,x.U],[Q.UL,x.UL],[Q.SVG,x.SVG],[Q.VAR,x.VAR],[Q.WBR,x.WBR],[Q.XMP,x.XMP]]);function $l(e){var t;return(t=gG.get(e))!==null&&t!==void 0?t:x.UNKNOWN}const pe=x,yG={[fe.HTML]:new Set([pe.ADDRESS,pe.APPLET,pe.AREA,pe.ARTICLE,pe.ASIDE,pe.BASE,pe.BASEFONT,pe.BGSOUND,pe.BLOCKQUOTE,pe.BODY,pe.BR,pe.BUTTON,pe.CAPTION,pe.CENTER,pe.COL,pe.COLGROUP,pe.DD,pe.DETAILS,pe.DIR,pe.DIV,pe.DL,pe.DT,pe.EMBED,pe.FIELDSET,pe.FIGCAPTION,pe.FIGURE,pe.FOOTER,pe.FORM,pe.FRAME,pe.FRAMESET,pe.H1,pe.H2,pe.H3,pe.H4,pe.H5,pe.H6,pe.HEAD,pe.HEADER,pe.HGROUP,pe.HR,pe.HTML,pe.IFRAME,pe.IMG,pe.INPUT,pe.LI,pe.LINK,pe.LISTING,pe.MAIN,pe.MARQUEE,pe.MENU,pe.META,pe.NAV,pe.NOEMBED,pe.NOFRAMES,pe.NOSCRIPT,pe.OBJECT,pe.OL,pe.P,pe.PARAM,pe.PLAINTEXT,pe.PRE,pe.SCRIPT,pe.SECTION,pe.SELECT,pe.SOURCE,pe.STYLE,pe.SUMMARY,pe.TABLE,pe.TBODY,pe.TD,pe.TEMPLATE,pe.TEXTAREA,pe.TFOOT,pe.TH,pe.THEAD,pe.TITLE,pe.TR,pe.TRACK,pe.UL,pe.WBR,pe.XMP]),[fe.MATHML]:new Set([pe.MI,pe.MO,pe.MN,pe.MS,pe.MTEXT,pe.ANNOTATION_XML]),[fe.SVG]:new Set([pe.TITLE,pe.FOREIGN_OBJECT,pe.DESC]),[fe.XLINK]:new Set,[fe.XML]:new Set,[fe.XMLNS]:new Set},w1=new Set([pe.H1,pe.H2,pe.H3,pe.H4,pe.H5,pe.H6]);Q.STYLE,Q.SCRIPT,Q.XMP,Q.IFRAME,Q.NOEMBED,Q.NOFRAMES,Q.PLAINTEXT;var $;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})($||($={}));const dn={DATA:$.DATA,RCDATA:$.RCDATA,RAWTEXT:$.RAWTEXT,SCRIPT_DATA:$.SCRIPT_DATA,PLAINTEXT:$.PLAINTEXT,CDATA_SECTION:$.CDATA_SECTION};function bG(e){return e>=F.DIGIT_0&&e<=F.DIGIT_9}function Cc(e){return e>=F.LATIN_CAPITAL_A&&e<=F.LATIN_CAPITAL_Z}function EG(e){return e>=F.LATIN_SMALL_A&&e<=F.LATIN_SMALL_Z}function xi(e){return EG(e)||Cc(e)}function fk(e){return xi(e)||bG(e)}function Sf(e){return e+32}function dL(e){return e===F.SPACE||e===F.LINE_FEED||e===F.TABULATION||e===F.FORM_FEED}function hk(e){return dL(e)||e===F.SOLIDUS||e===F.GREATER_THAN_SIGN}function xG(e){return e===F.NULL?se.nullCharacterReference:e>1114111?se.characterReferenceOutsideUnicodeRange:oL(e)?se.surrogateCharacterReference:cL(e)?se.noncharacterCharacterReference:lL(e)||e===F.CARRIAGE_RETURN?se.controlCharacterReference:null}class wG{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=$.DATA,this.returnState=$.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new aG(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new pG(oG,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(se.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(se.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=xG(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(se.endTagWithAttributes),t.selfClosing&&this._err(se.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case nt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case nt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case nt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:nt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=dL(t)?nt.WHITESPACE_CHARACTER:t===F.NULL?nt.NULL_CHARACTER:nt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(nt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=$.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ks.Attribute:Ks.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case $.DATA:{this._stateData(t);break}case $.RCDATA:{this._stateRcdata(t);break}case $.RAWTEXT:{this._stateRawtext(t);break}case $.SCRIPT_DATA:{this._stateScriptData(t);break}case $.PLAINTEXT:{this._statePlaintext(t);break}case $.TAG_OPEN:{this._stateTagOpen(t);break}case $.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case $.TAG_NAME:{this._stateTagName(t);break}case $.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case $.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case $.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case $.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case $.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case $.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case $.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case $.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case $.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case $.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case $.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case $.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case $.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case $.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case $.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case $.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case $.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case $.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case $.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case $.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case $.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case $.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case $.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case $.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case $.BOGUS_COMMENT:{this._stateBogusComment(t);break}case $.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case $.COMMENT_START:{this._stateCommentStart(t);break}case $.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case $.COMMENT:{this._stateComment(t);break}case $.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case $.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case $.COMMENT_END:{this._stateCommentEnd(t);break}case $.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case $.DOCTYPE:{this._stateDoctype(t);break}case $.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case $.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case $.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case $.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case $.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case $.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case $.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case $.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case $.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case $.CDATA_SECTION:{this._stateCdataSection(t);break}case $.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case $.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case $.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.TAG_OPEN;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitCodePoint(t);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case F.AMPERSAND:{this._startCharacterReference();break}case F.LESS_THAN_SIGN:{this.state=$.RCDATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.RAWTEXT_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(xi(t))this._createStartTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case F.EXCLAMATION_MARK:{this.state=$.MARKUP_DECLARATION_OPEN;break}case F.SOLIDUS:{this.state=$.END_TAG_OPEN;break}case F.QUESTION_MARK:{this._err(se.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t);break}case F.EOF:{this._err(se.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(se.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(xi(t))this._createEndTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case F.GREATER_THAN_SIGN:{this._err(se.missingEndTagName),this.state=$.DATA;break}case F.EOF:{this._err(se.eofBeforeTagName),this._emitChars("");break}case F.NULL:{this._err(se.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(Vt);break}case F.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===F.SOLIDUS?this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:xi(t)?(this._emitChars("<"),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){xi(t)?(this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case F.NULL:{this._err(se.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vt);break}case F.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===F.SOLIDUS?(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(dr.SCRIPT,!1)&&hk(this.preprocessor.peek(dr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==fe.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(NG,fe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(kG,fe.HTML)}clearBackToTableRowContext(){this.clearBackTo(TG,fe.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===x.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===x.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case fe.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case fe.SVG:{if(gk.has(s))return!1;break}case fe.MATHML:{if(mk.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,yp)}hasInListItemScope(t){return this.hasInDynamicScope(t,vG)}hasInButtonScope(t){return this.hasInDynamicScope(t,_G)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case fe.HTML:{if(w1.has(n))return!0;if(yp.has(n))return!1;break}case fe.SVG:{if(gk.has(n))return!1;break}case fe.MATHML:{if(mk.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===fe.HTML)switch(this.tagIDs[n]){case t:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===fe.HTML)switch(this.tagIDs[t]){case x.TBODY:case x.THEAD:case x.TFOOT:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===fe.HTML)switch(this.tagIDs[n]){case t:return!0;case x.OPTION:case x.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&fL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&pk.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&pk.has(this.currentTagId);)this.pop()}}const i0=3;var ks;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ks||(ks={}));const yk={type:ks.Marker};class CG{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let o=0;o[a.name,a.value]));let i=0;for(let a=0;as.get(l.name)===l.value)&&(i+=1,i>=i0&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(yk)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ks.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ks.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(yk);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ks.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ks.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ks.Element&&n.element===t)}}const wi={createDocument(){return{nodeName:"#document",mode:Hr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};wi.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(wi.isTextNode(n)){n.value+=t;return}}wi.appendChild(e,wi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&wi.isTextNode(r)?r.value+=t:wi.insertBefore(e,wi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function DG(e){return e.name===hL&&e.publicId===null&&(e.systemId===null||e.systemId===IG)}function PG(e){if(e.name!==hL)return Hr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===RG)return Hr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),LG.has(n))return Hr.QUIRKS;let r=t===null?OG:pL;if(bk(n,r))return Hr.QUIRKS;if(r=t===null?mL:MG,bk(n,r))return Hr.LIMITED_QUIRKS}return Hr.NO_QUIRKS}const Ek={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},jG="definitionurl",BG="definitionURL",FG=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),UG=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:fe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:fe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:fe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:fe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:fe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:fe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:fe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:fe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:fe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:fe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:fe.XMLNS}]]),$G=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),HG=new Set([x.B,x.BIG,x.BLOCKQUOTE,x.BODY,x.BR,x.CENTER,x.CODE,x.DD,x.DIV,x.DL,x.DT,x.EM,x.EMBED,x.H1,x.H2,x.H3,x.H4,x.H5,x.H6,x.HEAD,x.HR,x.I,x.IMG,x.LI,x.LISTING,x.MENU,x.META,x.NOBR,x.OL,x.P,x.PRE,x.RUBY,x.S,x.SMALL,x.SPAN,x.STRONG,x.STRIKE,x.SUB,x.SUP,x.TABLE,x.TT,x.U,x.UL,x.VAR]);function zG(e){const t=e.tagID;return t===x.FONT&&e.attrs.some(({name:r})=>r===Oa.COLOR||r===Oa.SIZE||r===Oa.FACE)||HG.has(t)}function gL(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let i,a;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,a=this.fragmentContextID):{current:i,currentTagId:a}=this.openElements,this._setContextModes(i,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===fe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,fe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=z.TEXT}switchToPlaintextParsing(){this.insertionMode=z.TEXT,this.originalInsertionMode=z.IN_BODY,this.tokenizer.state=dn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Q.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==fe.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=dn.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=dn.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=dn.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=dn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,fe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,fe.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Q.HTML,fe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,x.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,a=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:l,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:l,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),i=n.type===nt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===x.SVG&&this.treeAdapter.getTagName(n)===Q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===fe.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===x.MGLYPH||t.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,fe.HTML)}_processToken(t){switch(t.type){case nt.CHARACTER:{this.onCharacter(t);break}case nt.NULL_CHARACTER:{this.onNullCharacter(t);break}case nt.COMMENT:{this.onComment(t);break}case nt.DOCTYPE:{this.onDoctype(t);break}case nt.START_TAG:{this._processStartTag(t);break}case nt.END_TAG:{this.onEndTag(t);break}case nt.EOF:{this.onEof(t);break}case nt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return WG(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===ks.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(x.P),this.openElements.popUntilTagNamePopped(x.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case x.TR:{this.insertionMode=z.IN_ROW;return}case x.TBODY:case x.THEAD:case x.TFOOT:{this.insertionMode=z.IN_TABLE_BODY;return}case x.CAPTION:{this.insertionMode=z.IN_CAPTION;return}case x.COLGROUP:{this.insertionMode=z.IN_COLUMN_GROUP;return}case x.TABLE:{this.insertionMode=z.IN_TABLE;return}case x.BODY:{this.insertionMode=z.IN_BODY;return}case x.FRAMESET:{this.insertionMode=z.IN_FRAMESET;return}case x.SELECT:{this._resetInsertionModeForSelect(t);return}case x.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case x.HTML:{this.insertionMode=this.headElement?z.AFTER_HEAD:z.BEFORE_HEAD;return}case x.TD:case x.TH:{if(t>0){this.insertionMode=z.IN_CELL;return}break}case x.HEAD:{if(t>0){this.insertionMode=z.IN_HEAD;return}break}}this.insertionMode=z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===x.TEMPLATE)break;if(r===x.TABLE){this.insertionMode=z.IN_SELECT_IN_TABLE;return}}this.insertionMode=z.IN_SELECT}_isElementCausesFosterParenting(t){return bL.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case x.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===fe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case x.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return yG[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){SQ(this,t);return}switch(this.insertionMode){case z.INITIAL:{hc(this,t);break}case z.BEFORE_HTML:{Zc(this,t);break}case z.BEFORE_HEAD:{Jc(this,t);break}case z.IN_HEAD:{eu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{tu(this,t);break}case z.AFTER_HEAD:{nu(this,t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:{xL(this,t);break}case z.TEXT:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{a0(this,t);break}case z.IN_TABLE_TEXT:{NL(this,t);break}case z.IN_COLUMN_GROUP:{bp(this,t);break}case z.AFTER_BODY:{Ep(this,t);break}case z.AFTER_AFTER_BODY:{hh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){NQ(this,t);return}switch(this.insertionMode){case z.INITIAL:{hc(this,t);break}case z.BEFORE_HTML:{Zc(this,t);break}case z.BEFORE_HEAD:{Jc(this,t);break}case z.IN_HEAD:{eu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{tu(this,t);break}case z.AFTER_HEAD:{nu(this,t);break}case z.TEXT:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{a0(this,t);break}case z.IN_COLUMN_GROUP:{bp(this,t);break}case z.AFTER_BODY:{Ep(this,t);break}case z.AFTER_AFTER_BODY:{hh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){v1(this,t);return}switch(this.insertionMode){case z.INITIAL:case z.BEFORE_HTML:case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_TEMPLATE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{v1(this,t);break}case z.IN_TABLE_TEXT:{pc(this,t);break}case z.AFTER_BODY:{sX(this,t);break}case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{iX(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case z.INITIAL:{aX(this,t);break}case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:{this._err(t,se.misplacedDoctype);break}case z.IN_TABLE_TEXT:{pc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,se.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?AQ(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{hc(this,t);break}case z.BEFORE_HTML:{oX(this,t);break}case z.BEFORE_HEAD:{cX(this,t);break}case z.IN_HEAD:{gs(this,t);break}case z.IN_HEAD_NO_SCRIPT:{fX(this,t);break}case z.AFTER_HEAD:{pX(this,t);break}case z.IN_BODY:{Zn(this,t);break}case z.IN_TABLE:{bl(this,t);break}case z.IN_TABLE_TEXT:{pc(this,t);break}case z.IN_CAPTION:{uQ(this,t);break}case z.IN_COLUMN_GROUP:{lx(this,t);break}case z.IN_TABLE_BODY:{vm(this,t);break}case z.IN_ROW:{_m(this,t);break}case z.IN_CELL:{hQ(this,t);break}case z.IN_SELECT:{CL(this,t);break}case z.IN_SELECT_IN_TABLE:{mQ(this,t);break}case z.IN_TEMPLATE:{yQ(this,t);break}case z.AFTER_BODY:{EQ(this,t);break}case z.IN_FRAMESET:{xQ(this,t);break}case z.AFTER_FRAMESET:{vQ(this,t);break}case z.AFTER_AFTER_BODY:{TQ(this,t);break}case z.AFTER_AFTER_FRAMESET:{kQ(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?CQ(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{hc(this,t);break}case z.BEFORE_HTML:{lX(this,t);break}case z.BEFORE_HEAD:{uX(this,t);break}case z.IN_HEAD:{dX(this,t);break}case z.IN_HEAD_NO_SCRIPT:{hX(this,t);break}case z.AFTER_HEAD:{mX(this,t);break}case z.IN_BODY:{wm(this,t);break}case z.TEXT:{eQ(this,t);break}case z.IN_TABLE:{Fu(this,t);break}case z.IN_TABLE_TEXT:{pc(this,t);break}case z.IN_CAPTION:{dQ(this,t);break}case z.IN_COLUMN_GROUP:{fQ(this,t);break}case z.IN_TABLE_BODY:{_1(this,t);break}case z.IN_ROW:{AL(this,t);break}case z.IN_CELL:{pQ(this,t);break}case z.IN_SELECT:{IL(this,t);break}case z.IN_SELECT_IN_TABLE:{gQ(this,t);break}case z.IN_TEMPLATE:{bQ(this,t);break}case z.AFTER_BODY:{OL(this,t);break}case z.IN_FRAMESET:{wQ(this,t);break}case z.AFTER_FRAMESET:{_Q(this,t);break}case z.AFTER_AFTER_BODY:{hh(this,t);break}}}onEof(t){switch(this.insertionMode){case z.INITIAL:{hc(this,t);break}case z.BEFORE_HTML:{Zc(this,t);break}case z.BEFORE_HEAD:{Jc(this,t);break}case z.IN_HEAD:{eu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{tu(this,t);break}case z.AFTER_HEAD:{nu(this,t);break}case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{TL(this,t);break}case z.TEXT:{tQ(this,t);break}case z.IN_TABLE_TEXT:{pc(this,t);break}case z.IN_TEMPLATE:{RL(this,t);break}case z.AFTER_BODY:case z.IN_FRAMESET:case z.AFTER_FRAMESET:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{ox(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===F.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.TEXT:case z.IN_COLUMN_GROUP:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{this._insertCharacters(t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:case z.AFTER_BODY:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{EL(this,t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{a0(this,t);break}case z.IN_TABLE_TEXT:{kL(this,t);break}}}};function ZG(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):_L(e,t),n}function JG(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function eX(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,a=s;a!==n;i++,a=s){s=e.openElements.getCommonAncestor(a);const o=e.activeFormattingElements.getElementEntry(a),l=o&&i>=XG;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=tX(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function tX(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function nX(e,t,n){const r=e.treeAdapter.getTagName(t),s=$l(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===x.TEMPLATE&&i===fe.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function rX(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function ax(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(i);a&&!a.endTag&&e._setEndLocation(i,t)}}}}function aX(e,t){e._setDocumentType(t);const n=t.forceQuirks?Hr.QUIRKS:PG(t);DG(t)||e._err(t,se.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=z.BEFORE_HTML}function hc(e,t){e._err(t,se.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Hr.QUIRKS),e.insertionMode=z.BEFORE_HTML,e._processToken(t)}function oX(e,t){t.tagID===x.HTML?(e._insertElement(t,fe.HTML),e.insertionMode=z.BEFORE_HEAD):Zc(e,t)}function lX(e,t){const n=t.tagID;(n===x.HTML||n===x.HEAD||n===x.BODY||n===x.BR)&&Zc(e,t)}function Zc(e,t){e._insertFakeRootElement(),e.insertionMode=z.BEFORE_HEAD,e._processToken(t)}function cX(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.HEAD:{e._insertElement(t,fe.HTML),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD;break}default:Jc(e,t)}}function uX(e,t){const n=t.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?Jc(e,t):e._err(t,se.endTagWithoutMatchingOpenElement)}function Jc(e,t){e._insertFakeElement(Q.HEAD,x.HEAD),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD,e._processToken(t)}function gs(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{e._appendElement(t,fe.HTML),t.ackSelfClosing=!0;break}case x.TITLE:{e._switchToTextParsing(t,dn.RCDATA);break}case x.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,dn.RAWTEXT):(e._insertElement(t,fe.HTML),e.insertionMode=z.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{e._switchToTextParsing(t,dn.RAWTEXT);break}case x.SCRIPT:{e._switchToTextParsing(t,dn.SCRIPT_DATA);break}case x.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(z.IN_TEMPLATE);break}case x.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:eu(e,t)}}function dX(e,t){switch(t.tagID){case x.HEAD:{e.openElements.pop(),e.insertionMode=z.AFTER_HEAD;break}case x.BODY:case x.BR:case x.HTML:{eu(e,t);break}case x.TEMPLATE:{ro(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function ro(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==x.TEMPLATE&&e._err(t,se.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,se.endTagWithoutMatchingOpenElement)}function eu(e,t){e.openElements.pop(),e.insertionMode=z.AFTER_HEAD,e._processToken(t)}function fX(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.BASEFONT:case x.BGSOUND:case x.HEAD:case x.LINK:case x.META:case x.NOFRAMES:case x.STYLE:{gs(e,t);break}case x.NOSCRIPT:{e._err(t,se.nestedNoscriptInHead);break}default:tu(e,t)}}function hX(e,t){switch(t.tagID){case x.NOSCRIPT:{e.openElements.pop(),e.insertionMode=z.IN_HEAD;break}case x.BR:{tu(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function tu(e,t){const n=t.type===nt.EOF?se.openElementsLeftAfterEof:se.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=z.IN_HEAD,e._processToken(t)}function pX(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.BODY:{e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=z.IN_BODY;break}case x.FRAMESET:{e._insertElement(t,fe.HTML),e.insertionMode=z.IN_FRAMESET;break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{e._err(t,se.abandonedHeadElementChild),e.openElements.push(e.headElement,x.HEAD),gs(e,t),e.openElements.remove(e.headElement);break}case x.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:nu(e,t)}}function mX(e,t){switch(t.tagID){case x.BODY:case x.HTML:case x.BR:{nu(e,t);break}case x.TEMPLATE:{ro(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function nu(e,t){e._insertFakeElement(Q.BODY,x.BODY),e.insertionMode=z.IN_BODY,xm(e,t)}function xm(e,t){switch(t.type){case nt.CHARACTER:{xL(e,t);break}case nt.WHITESPACE_CHARACTER:{EL(e,t);break}case nt.COMMENT:{v1(e,t);break}case nt.START_TAG:{Zn(e,t);break}case nt.END_TAG:{wm(e,t);break}case nt.EOF:{TL(e,t);break}}}function EL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function xL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function gX(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function yX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function bX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_FRAMESET)}function EX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML)}function xX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&w1.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,fe.HTML)}function wX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function vX(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),n||(e.formElement=e.openElements.current))}function _X(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===x.LI&&s===x.LI||(n===x.DD||n===x.DT)&&(s===x.DD||s===x.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==x.ADDRESS&&s!==x.DIV&&s!==x.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML)}function TX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.tokenizer.state=dn.PLAINTEXT}function kX(e,t){e.openElements.hasInScope(x.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.framesetOk=!1}function NX(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Q.A);n&&(ax(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function SX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function AX(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(x.NOBR)&&(ax(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function CX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function IX(e,t){e.treeAdapter.getDocumentMode(e.document)!==Hr.QUIRKS&&e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=z.IN_TABLE}function wL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,fe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function vL(e){const t=uL(e,Oa.TYPE);return t!=null&&t.toLowerCase()===qG}function RX(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,fe.HTML),vL(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function OX(e,t){e._appendElement(t,fe.HTML),t.ackSelfClosing=!0}function LX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._appendElement(t,fe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function MX(e,t){t.tagName=Q.IMG,t.tagID=x.IMG,wL(e,t)}function DX(e,t){e._insertElement(t,fe.HTML),e.skipNextNewLine=!0,e.tokenizer.state=dn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=z.TEXT}function PX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,dn.RAWTEXT)}function jX(e,t){e.framesetOk=!1,e._switchToTextParsing(t,dn.RAWTEXT)}function vk(e,t){e._switchToTextParsing(t,dn.RAWTEXT)}function BX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===z.IN_TABLE||e.insertionMode===z.IN_CAPTION||e.insertionMode===z.IN_TABLE_BODY||e.insertionMode===z.IN_ROW||e.insertionMode===z.IN_CELL?z.IN_SELECT_IN_TABLE:z.IN_SELECT}function FX(e,t){e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML)}function UX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,fe.HTML)}function $X(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(x.RTC),e._insertElement(t,fe.HTML)}function HX(e,t){e._reconstructActiveFormattingElements(),gL(t),ix(t),t.selfClosing?e._appendElement(t,fe.MATHML):e._insertElement(t,fe.MATHML),t.ackSelfClosing=!0}function zX(e,t){e._reconstructActiveFormattingElements(),yL(t),ix(t),t.selfClosing?e._appendElement(t,fe.SVG):e._insertElement(t,fe.SVG),t.ackSelfClosing=!0}function _k(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML)}function Zn(e,t){switch(t.tagID){case x.I:case x.S:case x.B:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.SMALL:case x.STRIKE:case x.STRONG:{SX(e,t);break}case x.A:{NX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{xX(e,t);break}case x.P:case x.DL:case x.OL:case x.UL:case x.DIV:case x.DIR:case x.NAV:case x.MAIN:case x.MENU:case x.ASIDE:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.DETAILS:case x.ADDRESS:case x.ARTICLE:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{EX(e,t);break}case x.LI:case x.DD:case x.DT:{_X(e,t);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{wL(e,t);break}case x.HR:{LX(e,t);break}case x.RB:case x.RTC:{UX(e,t);break}case x.RT:case x.RP:{$X(e,t);break}case x.PRE:case x.LISTING:{wX(e,t);break}case x.XMP:{PX(e,t);break}case x.SVG:{zX(e,t);break}case x.HTML:{gX(e,t);break}case x.BASE:case x.LINK:case x.META:case x.STYLE:case x.TITLE:case x.SCRIPT:case x.BGSOUND:case x.BASEFONT:case x.TEMPLATE:{gs(e,t);break}case x.BODY:{yX(e,t);break}case x.FORM:{vX(e,t);break}case x.NOBR:{AX(e,t);break}case x.MATH:{HX(e,t);break}case x.TABLE:{IX(e,t);break}case x.INPUT:{RX(e,t);break}case x.PARAM:case x.TRACK:case x.SOURCE:{OX(e,t);break}case x.IMAGE:{MX(e,t);break}case x.BUTTON:{kX(e,t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{CX(e,t);break}case x.IFRAME:{jX(e,t);break}case x.SELECT:{BX(e,t);break}case x.OPTION:case x.OPTGROUP:{FX(e,t);break}case x.NOEMBED:case x.NOFRAMES:{vk(e,t);break}case x.FRAMESET:{bX(e,t);break}case x.TEXTAREA:{DX(e,t);break}case x.NOSCRIPT:{e.options.scriptingEnabled?vk(e,t):_k(e,t);break}case x.PLAINTEXT:{TX(e,t);break}case x.COL:case x.TH:case x.TD:case x.TR:case x.HEAD:case x.FRAME:case x.TBODY:case x.TFOOT:case x.THEAD:case x.CAPTION:case x.COLGROUP:break;default:_k(e,t)}}function VX(e,t){if(e.openElements.hasInScope(x.BODY)&&(e.insertionMode=z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function KX(e,t){e.openElements.hasInScope(x.BODY)&&(e.insertionMode=z.AFTER_BODY,OL(e,t))}function YX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function WX(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(x.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(x.FORM):n&&e.openElements.remove(n))}function qX(e){e.openElements.hasInButtonScope(x.P)||e._insertFakeElement(Q.P,x.P),e._closePElement()}function GX(e){e.openElements.hasInListItemScope(x.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(x.LI),e.openElements.popUntilTagNamePopped(x.LI))}function XX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function QX(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function ZX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function JX(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Q.BR,x.BR),e.openElements.pop(),e.framesetOk=!1}function _L(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const i=e.openElements.items[s],a=e.openElements.tagIDs[s];if(r===a&&(r!==x.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,a))break}}function wm(e,t){switch(t.tagID){case x.A:case x.B:case x.I:case x.S:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.NOBR:case x.SMALL:case x.STRIKE:case x.STRONG:{ax(e,t);break}case x.P:{qX(e);break}case x.DL:case x.UL:case x.OL:case x.DIR:case x.DIV:case x.NAV:case x.PRE:case x.MAIN:case x.MENU:case x.ASIDE:case x.BUTTON:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.ADDRESS:case x.ARTICLE:case x.DETAILS:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.LISTING:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{YX(e,t);break}case x.LI:{GX(e);break}case x.DD:case x.DT:{XX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{QX(e);break}case x.BR:{JX(e);break}case x.BODY:{VX(e,t);break}case x.HTML:{KX(e,t);break}case x.FORM:{WX(e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{ZX(e,t);break}case x.TEMPLATE:{ro(e,t);break}default:_L(e,t)}}function TL(e,t){e.tmplInsertionModeStack.length>0?RL(e,t):ox(e,t)}function eQ(e,t){var n;t.tagID===x.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function tQ(e,t){e._err(t,se.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function a0(e,t){if(e.openElements.currentTagId!==void 0&&bL.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=z.IN_TABLE_TEXT,t.type){case nt.CHARACTER:{NL(e,t);break}case nt.WHITESPACE_CHARACTER:{kL(e,t);break}}else Ed(e,t)}function nQ(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_CAPTION}function rQ(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_COLUMN_GROUP}function sQ(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.COLGROUP,x.COLGROUP),e.insertionMode=z.IN_COLUMN_GROUP,lx(e,t)}function iQ(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_TABLE_BODY}function aQ(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.TBODY,x.TBODY),e.insertionMode=z.IN_TABLE_BODY,vm(e,t)}function oQ(e,t){e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function lQ(e,t){vL(t)?e._appendElement(t,fe.HTML):Ed(e,t),t.ackSelfClosing=!0}function cQ(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,fe.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function bl(e,t){switch(t.tagID){case x.TD:case x.TH:case x.TR:{aQ(e,t);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{gs(e,t);break}case x.COL:{sQ(e,t);break}case x.FORM:{cQ(e,t);break}case x.TABLE:{oQ(e,t);break}case x.TBODY:case x.TFOOT:case x.THEAD:{iQ(e,t);break}case x.INPUT:{lQ(e,t);break}case x.CAPTION:{nQ(e,t);break}case x.COLGROUP:{rQ(e,t);break}default:Ed(e,t)}}function Fu(e,t){switch(t.tagID){case x.TABLE:{e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode());break}case x.TEMPLATE:{ro(e,t);break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:Ed(e,t)}}function Ed(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,xm(e,t),e.fosterParentingEnabled=n}function kL(e,t){e.pendingCharacterTokens.push(t)}function NL(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function pc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===x.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===x.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop();break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop();break}case x.SELECT:{e.openElements.hasInSelectScope(x.SELECT)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode());break}case x.TEMPLATE:{ro(e,t);break}}}function mQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e._processStartTag(t)):CL(e,t)}function gQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e.onEndTag(t)):IL(e,t)}function yQ(e,t){switch(t.tagID){case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{gs(e,t);break}case x.CAPTION:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{e.tmplInsertionModeStack[0]=z.IN_TABLE,e.insertionMode=z.IN_TABLE,bl(e,t);break}case x.COL:{e.tmplInsertionModeStack[0]=z.IN_COLUMN_GROUP,e.insertionMode=z.IN_COLUMN_GROUP,lx(e,t);break}case x.TR:{e.tmplInsertionModeStack[0]=z.IN_TABLE_BODY,e.insertionMode=z.IN_TABLE_BODY,vm(e,t);break}case x.TD:case x.TH:{e.tmplInsertionModeStack[0]=z.IN_ROW,e.insertionMode=z.IN_ROW,_m(e,t);break}default:e.tmplInsertionModeStack[0]=z.IN_BODY,e.insertionMode=z.IN_BODY,Zn(e,t)}}function bQ(e,t){t.tagID===x.TEMPLATE&&ro(e,t)}function RL(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ox(e,t)}function EQ(e,t){t.tagID===x.HTML?Zn(e,t):Ep(e,t)}function OL(e,t){var n;if(t.tagID===x.HTML){if(e.fragmentContext||(e.insertionMode=z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===x.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Ep(e,t)}function Ep(e,t){e.insertionMode=z.IN_BODY,xm(e,t)}function xQ(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.FRAMESET:{e._insertElement(t,fe.HTML);break}case x.FRAME:{e._appendElement(t,fe.HTML),t.ackSelfClosing=!0;break}case x.NOFRAMES:{gs(e,t);break}}}function wQ(e,t){t.tagID===x.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==x.FRAMESET&&(e.insertionMode=z.AFTER_FRAMESET))}function vQ(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.NOFRAMES:{gs(e,t);break}}}function _Q(e,t){t.tagID===x.HTML&&(e.insertionMode=z.AFTER_AFTER_FRAMESET)}function TQ(e,t){t.tagID===x.HTML?Zn(e,t):hh(e,t)}function hh(e,t){e.insertionMode=z.IN_BODY,xm(e,t)}function kQ(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.NOFRAMES:{gs(e,t);break}}}function NQ(e,t){t.chars=Vt,e._insertCharacters(t)}function SQ(e,t){e._insertCharacters(t),e.framesetOk=!1}function LL(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==fe.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function AQ(e,t){if(zG(t))LL(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===fe.MATHML?gL(t):r===fe.SVG&&(VG(t),yL(t)),ix(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function CQ(e,t){if(t.tagID===x.P||t.tagID===x.BR){LL(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===fe.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}Q.AREA,Q.BASE,Q.BASEFONT,Q.BGSOUND,Q.BR,Q.COL,Q.EMBED,Q.FRAME,Q.HR,Q.IMG,Q.INPUT,Q.KEYGEN,Q.LINK,Q.META,Q.PARAM,Q.SOURCE,Q.TRACK,Q.WBR;const IQ=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,RQ=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Tk={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function ML(e,t){const n=$Q(e),r=GR("type",{handlers:{root:OQ,element:LQ,text:MQ,comment:PL,doctype:DQ,raw:jQ},unknown:BQ}),s={parser:n?new wk(Tk):wk.getFragmentParser(void 0,Tk),handle(o){r(o,s)},stitches:!1,options:t||{}};r(e,s),Hl(s,Ps());const i=n?s.parser.document:s.parser.getFragment(),a=Hq(i,{file:s.options.file});return s.stitches&&yd(a,"comment",function(o,l,u){const d=o;if(d.value.stitch&&u&&l!==void 0){const f=u.children;return f[l]=d.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function DL(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:nt.CHARACTER,chars:e.value,location:xd(e)};Hl(t,Ps(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function DQ(e,t){const n={type:nt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:xd(e)};Hl(t,Ps(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function PQ(e,t){t.stitches=!0;const n=HQ(e);if("children"in e&&"children"in n){const r=ML({type:"root",children:e.children},t.options);n.children=r.children}PL({type:"comment",value:{stitch:n}},t)}function PL(e,t){const n=e.value,r={type:nt.COMMENT,data:n,location:xd(e)};Hl(t,Ps(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function jQ(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,jL(t,Ps(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(IQ,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function BQ(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))PQ(n,t);else{let r="";throw RQ.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Hl(e,t){jL(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=dn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function jL(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function FQ(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===dn.PLAINTEXT)return;Hl(t,Ps(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:_a.html;s===_a.html&&n==="svg"&&(s=_a.svg);const i=Wq({...e,children:[]},{space:s===_a.svg?"svg":"html"}),a={type:nt.START_TAG,tagName:n,tagID:$l(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:xd(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function UQ(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&tG.includes(n)||t.parser.tokenizer.state===dn.PLAINTEXT)return;Hl(t,pm(e));const r={type:nt.END_TAG,tagName:n,tagID:$l(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:xd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===dn.RCDATA||t.parser.tokenizer.state===dn.RAWTEXT||t.parser.tokenizer.state===dn.SCRIPT_DATA)&&(t.parser.tokenizer.state=dn.DATA)}function $Q(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function xd(e){const t=Ps(e)||{line:void 0,column:void 0,offset:void 0},n=pm(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function HQ(e){return"children"in e?gl({...e,children:[]}):gl(e)}function zQ(e){return function(t,n){return ML(t,{...e,file:n})}}const BL=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function FL(e){if(!e)return!1;try{const t=e.toLowerCase();return BL.some(n=>t.includes(n))}catch{return!1}}function VQ(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(FL(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const s=n.map(i=>(i==null?void 0:i.value)||"").join("").toLowerCase();return BL.some(i=>s.includes(i))}return!1}function KQ({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=v.useState(null),i=(l,u)=>{if(l.src)return l.src;if(u){const d=h=>{var p;if(!h)return null;if(h.type==="source"&&((p=h.properties)!=null&&p.src))return h.properties.src;if(h.children)for(const m of h.children){const b=d(m);if(b)return b}return null},f=d({children:u});if(f)return f}return""},a=l=>{try{const d=new URL(l).pathname.split("/");return d[d.length-1]||"video.mp4"}catch{return"video.mp4"}},o=l=>l?Array.isArray(l)?l.map(u=>(u==null?void 0:u.value)||"").join("")||"video":(l==null?void 0:l.value)||"video":"video";return c.jsxs("div",{className:t?`md ${t}`:"md",children:[c.jsx(qz,{remarkPlugins:[oY],rehypePlugins:n?[zQ,ok]:[ok],components:{a:({node:l,...u})=>{const d=u.href;if(d&&(FL(d)||VQ(l))){const f=d,h=o(l==null?void 0:l.children);return c.jsxs("div",{className:"video-container",children:[c.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[c.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),c.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:c.jsx(Wc,{})})]}),c.jsx("div",{className:"video-caption",children:c.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return c.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:l,src:u,alt:d,...f})=>{const h=c.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?c.jsx(gI,{src:u,children:c.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,c.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:c.jsx(Wc,{})})]})}):h},video:({node:l,src:u,children:d,...f})=>{const h=i({src:u},d);return h?c.jsx("div",{className:"video-container",children:c.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[c.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),c.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:c.jsx(Wc,{})})]})}):c.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&c.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:c.jsxs("div",{className:"video-viewer",onClick:l=>l.stopPropagation(),children:[c.jsxs("div",{className:"video-viewer-header",children:[c.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),c.jsxs("nav",{className:"video-viewer-nav",children:[c.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:c.jsx(TE,{})}),c.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:c.jsx(Gr,{})})]})]}),c.jsx("div",{className:"video-viewer-body",children:c.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const wd=v.memo(KQ),kk=6,Nk=7,YQ={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function T1(e){return YQ[(e||"").trim().toLowerCase()]||"未知"}function Sk(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)?"is-positive":["creating","pending","running","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function WQ(e){if(!e)return"";const t=e.trim(),n=Number(t),r=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function qQ(e){const t=e.replace(/\r\n/g,` +`,...i.current()});return/^[\t ]/.test(u)&&(u=Bu(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}ZR.peek=ZV;function ZR(e){return e.value||""}function ZV(){return"<"}JR.peek=JV;function JR(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function JV(){return"!"}eO.peek=eK;function eO(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function eK(){return"!"}tO.peek=tK;function tO(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}rO.peek=nK;function rO(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(nO(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function nK(e,t,n){return nO(e,n)?"<":"["}sO.peek=rK;function sO(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function rK(){return"["}function GE(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function sK(e){const t=GE(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function iK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function iO(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function aK(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?iK(n):GE(n);const o=e.ordered?a==="."?")":".":sK(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),iO(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return l(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?i:i+" ".repeat(a-i.length))+f}}function cK(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const uK=bd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function dK(e,t,n,r){return(e.children.some(function(a){return uK(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function fK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aO.peek=hK;function aO(e,t,n,r){const s=fK(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=mp(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Bu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=mp(r.after.charCodeAt(0),f,s);h.inside&&(l=l.slice(0,-1)+Bu(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function hK(e,t,n){return n.options.strong||"*"}function pK(e,t,n,r){return n.safe(e.value,r)}function mK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function gK(e,t,n){const r=(iO(n)+(n.options.ruleSpaces?" ":"")).repeat(mK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const oO={blockquote:FV,break:FT,code:KV,definition:WV,emphasis:QR,hardBreak:FT,heading:QV,html:ZR,image:JR,imageReference:eO,inlineCode:tO,link:rO,linkReference:sO,list:aK,listItem:lK,paragraph:cK,root:dK,strong:aO,text:pK,thematicBreak:gK};function yK(){return{enter:{table:bK,tableData:UT,tableHeader:UT,tableRow:xK},exit:{codeText:wK,table:EK,tableData:n0,tableHeader:n0,tableRow:n0}}}function bK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function EK(e){this.exit(e),this.data.inTable=void 0}function xK(e){this.enter({type:"tableRow",children:[]},e)}function n0(e){this.exit(e)}function UT(e){this.enter({type:"tableCell",children:[]},e)}function wK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vK(e,t){return t==="|"?t:e}function _K(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";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:h,table:a,tableCell:l,tableRow:o}};function a(p,m,y,w){return u(d(p,y,w),p.align)}function o(p,m,y,w){const g=f(p,y,w),E=u([g]);return E.slice(0,E.indexOf(` +`))}function l(p,m,y,w){const g=y.enter("tableCell"),E=y.enter("phrasing"),b=y.containerPhrasing(p,{...w,before:i,after:i});return E(),g(),b}function u(p,m){return jV(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,y){const w=p.children;let g=-1;const E=[],b=m.enter("table");for(;++g0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const $K={tokenize:GK,partial:!0};function HK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:YK,continuation:{tokenize:WK},exit:qK}},text:{91:{name:"gfmFootnoteCall",tokenize:KK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zK,resolveTo:VK}}}}function zK(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=fs(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function VK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function KK(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!a||f===null||f===91||At(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(fs(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return At(f)||(a=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function YK(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(a>999||m===93&&!o||m===null||m===91||At(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return i=fs(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return At(m)||(o=!0),a++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(i)||s.push(i),dt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function WK(e,t,n){return e.check(yd,t,e.attempt($K,t,n))}function qK(e){e.exit("gfmFootnoteDefinition")}function GK(e,t,n){const r=this;return dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function XK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(m):(a.consume(m),f++,p);if(f<2&&!n)return l(m);const w=a.exit("strikethroughSequenceTemporary"),g=gl(m);return w._open=!g||g===2&&!!y,w._close=!y||y===2&&!!g,o(m)}}}class QK{constructor(){this.map=[]}add(t,n,r){ZK(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function ZK(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const P=r.events[M][1].type;if(P==="lineEnding"||P==="linePrefix")M--;else break}const B=M>-1?r.events[M][1].type:null,Y=B==="tableHead"||B==="tableRow"?T:l;return Y===T&&r.parser.lazy[r.now().line]?n(I):Y(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):Be(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):it(I)?dt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||At(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,it(I)?dt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):N(I)}function y(I){return it(I)?dt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),g):I===45?(i+=1,g(I)):I===null||Be(I)?_(I):N(I)}function g(I){return I===45?(e.enter("tableDelimiterFiller"),E(I)):N(I)}function E(I){return I===45?(e.consume(I),E):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(I))}function b(I){return it(I)?dt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||Be(I)?!a||s!==i?N(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):N(I)}function N(I){return n(I)}function T(I){return e.enter("tableRow"),A(I)}function A(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),A):I===null||Be(I)?(e.exit("tableRow"),t(I)):it(I)?dt(e,A,"whitespace")(I):(e.enter("data"),k(I))}function k(I){return I===null||I===124||At(I)?(e.exit("data"),A(I)):(e.consume(I),I===92?R:k)}function R(I){return I===92||I===124?(e.consume(I),k):k(I)}}function nY(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,d,f;const h=new QK;for(;++nn[2]+1){const m=n[2]+1,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},bo(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function HT(e,t,n,r,s){const i=[],a=bo(t.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function bo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const rY={name:"tasklistCheck",tokenize:iY};function sY(){return{text:{91:rY}}}function iY(e,t,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return At(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Be(l)?t(l):it(l)?e.check({tokenize:aY},t,n)(l):n(l)}}function aY(e,t,n){return dt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function oY(e){return TR([OK(),HK(),XK(e),eY(),sY()])}const lY={};function cY(e){const t=this,n=e||lY,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(oY(n)),i.push(AK()),a.push(CK(n))}const zT=function(e,t,n){const r=bd(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&l.push(` +`.repeat(u)||" "),u=-1,l.push(d))}return l.join("")}function yO(e,t,n){return e.type==="element"?yY(e,t,n):e.type==="text"?n.whitespace==="normal"?bO(e,n):bY(e):[]}function yY(e,t,n){const r=EO(e,n),s=e.children||[];let i=-1,a=[];if(mY(e))return a;let o,l;for(E1(e)||WT(e)&&zT(t,e,WT)?l=` +`:pY(e)?(o=2,l=2):gO(e)&&(o=1,l=1);++i]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],y=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},N={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[N,f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function NY(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=TY(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function xO(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(o);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],g={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],N=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:y,literal:w,built_in:[...E,...b,"set","shopt",..._,...N]},contains:[p,e.SHEBANG(),m,f,i,a,g,o,l,u,d,n]}}function kY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},g=[f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:g.concat([{begin:/\(/,end:/\)/,keywords:w,contains:g.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function SY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],y=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},N={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[N,f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function AY(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:t,literal:r},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=e.inherit(h,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[u,y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const CY=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),IY=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],RY=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],OY=[...IY,...RY],LY=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),MY=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),DY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),PY=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function jY(e){const t=e.regex,n=CY(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+MY.join("|")+")"},{begin:":(:)?("+DY.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+PY.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:LY.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+OY.join("|")+")\\b"}]}}function BY(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function FY(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"vO(e,t,n-1))}function $Y(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+vO("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,qT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},qT,u]}}const GT="[A-Za-z$_][0-9A-Za-z$_]*",HY=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zY=["true","false","null","undefined","NaN","Infinity"],_O=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],TO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],VY=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],KY=[].concat(NO,_O,TO);function kO(e){const t=e.regex,n=(O,{after:j})=>{const S="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const S=O[0].length+O.index,H=O.input[S];if(H==="<"||H===","){j.ignoreMatch();return}H===">"&&(n(O,{after:S})||j.ignoreMatch());let V;const D=O.input.substring(S);if(V=D.match(/^\s*=/)){j.ignoreMatch();return}if((V=D.match(/^\s+extends\s+/))&&V.index===0){j.ignoreMatch();return}}},o={$pattern:GT,keyword:HY,literal:zY,built_in:KY,"variable.language":VY},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(E,h.contains),N=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._O,...TO]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,B([...NO,"super","import"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,E,{match:/\$\d+/},f,k,{scope:"attr",match:r+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,M,A,U,{match:/\$[(.]/}]}}function SO(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var xo="[0-9](_*[0-9])*",Nf=`\\.(${xo})`,kf="[0-9a-fA-F](_*[0-9a-fA-F])*",YY={className:"number",variants:[{begin:`(\\b(${xo})((${Nf})|\\.)?|(${Nf}))[eE][+-]?(${xo})[fFdD]?\\b`},{begin:`\\b(${xo})((${Nf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Nf})[fFdD]?\\b`},{begin:`\\b(${xo})[fFdD]\\b`},{begin:`\\b0[xX]((${kf})\\.?|(${kf})?\\.(${kf}))[pP][+-]?(${xo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${kf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function WY(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,s]}]};s.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=YY,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,o,l,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const qY=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),GY=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],XY=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],QY=[...GY,...XY],ZY=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),AO=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),CO=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JY=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),eW=AO.concat(CO).sort().reverse();function tW(e){const t=qY(e),n=eW,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],o=[],l=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},u=function(b,_,N){return{className:b,begin:_,relevance:N}},d={$pattern:/[a-z-]+/,keyword:r,attribute:ZY.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:d,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+s,10),u("variable","@\\{"+s+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JY.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},y={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:o,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+s+"\\}"),{begin:"\\b("+QY.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",i,0),u("selector-id","#"+i),u("selector-class","\\."+i,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+AO.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+CO.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,w,E,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function nW(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function IO(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,l];return[u,d,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,i,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},s,r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rW(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function sW(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,i,l],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(y,w,g="\\1")=>{const E=g==="\\1"?g:t.concat(g,w);return t.concat(t.concat("(?:",y,")"),w,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,g,r)},p=(y,w,g)=>t.concat(t.concat("(?:",y,")"),w,/(?:\\.|[^\\\/])*?/,g,r),m=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:m}}function iW(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(P,U)=>{U.data._beginMatch=P[1]||P[2]},"on:end":(P,U)=>{U.data._beginMatch!==P[1]&&U.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,m={scope:"string",variants:[d,u,f,h]},y={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:g,literal:(P=>{const U=[];return P.forEach(C=>{U.push(C),C.toLowerCase()===C?U.push(C.toUpperCase()):U.push(C.toLowerCase())}),U})(w),built_in:E},N=P=>P.map(U=>U.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",N(E).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(r,"\\b(?!\\()"),k={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,k,e.C_BLOCK_COMMENT_MODE,m,y,T]},M={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",N(g).join("\\b|"),"|",N(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(M);const B=[R,k,e.C_BLOCK_COMMENT_MODE,m,y,T],Y={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},a,M,k,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",Y,a,k,e.C_BLOCK_COMMENT_MODE,m,y]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,y]}}function aW(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function oW(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function OO(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${r.join("|")}`,y={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,y,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,y,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[y,g,f]}]}}function lW(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function cW(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function uW(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},y={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},T=[f,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);d.contains=T,y.contains=T;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:T}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(I).concat(u).concat(T)}}function dW(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:o,literal:l,built_in:u},illegal:""},i]}}const fW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),hW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],pW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],mW=[...hW,...pW],gW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),yW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),bW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),EW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xW(e){const t=fW(e),n=bW,r=yW,s="@[a-z-]+",i="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+mW.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+EW.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:gW.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function wW(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function vW(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...l].filter(N=>!d.includes(N)),y={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(N){return t.concat(/\b/,t.either(...N.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:E(h),relevance:0};function _(N,{exceptions:T,when:A}={}){const k=A;return T=T||[],N.map(R=>R.match(/\|\d+$/)||T.includes(R)?R:k(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:N=>N.length<3}),literal:i,type:o,built_in:f},contains:[{scope:"type",match:E(a)},b,g,y,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function LO(e){return e?typeof e=="string"?e:e.source:null}function pc(e){return Tt("(?=",e,")")}function Tt(...e){return e.map(n=>LO(n)).join("")}function _W(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function sr(...e){return"("+(_W(e).capture?"":"?:")+e.map(r=>LO(r)).join("|")+")"}const ZE=e=>Tt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),TW=["Protocol","Type"].map(ZE),XT=["init","self"].map(ZE),NW=["Any","Self"],r0=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],QT=["false","nil","true"],kW=["assignment","associativity","higherThan","left","lowerThan","none","right"],SW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ZT=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],MO=sr(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),DO=sr(MO,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),s0=Tt(MO,DO,"*"),PO=sr(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),gp=sr(PO,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ts=Tt(PO,gp,"*"),Sf=Tt(/[A-Z]/,gp,"*"),AW=["attached","autoclosure",Tt(/convention\(/,sr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Tt(/objc\(/,Ts,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],CW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function IW(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,sr(...TW,...XT)],className:{2:"keyword"}},i={match:Tt(/\./,sr(...r0)),relevance:0},a=r0.filter(ge=>typeof ge=="string").concat(["_|0"]),o=r0.filter(ge=>typeof ge!="string").concat(NW).map(ZE),l={variants:[{className:"keyword",match:sr(...o,...XT)}]},u={$pattern:sr(/\b\w+/,/#\w+/),keyword:a.concat(SW),literal:QT},d=[s,i,l],f={match:Tt(/\./,sr(...ZT)),relevance:0},h={className:"built_in",match:Tt(/\b/,sr(...ZT),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},y={className:"operator",relevance:0,variants:[{match:s0},{match:`\\.(\\.|${DO})+`}]},w=[m,y],g="([0-9]_*)+",E="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(ge="")=>({className:"subst",variants:[{match:Tt(/\\/,ge,/[0\\tnr"']/)},{match:Tt(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),N=(ge="")=>({className:"subst",match:Tt(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(ge="")=>({className:"subst",label:"interpol",begin:Tt(/\\/,ge,/\(/),end:/\)/}),A=(ge="")=>({begin:Tt(ge,/"""/),end:Tt(/"""/,ge),contains:[_(ge),N(ge),T(ge)]}),k=(ge="")=>({begin:Tt(ge,/"/),end:Tt(/"/,ge),contains:[_(ge),T(ge)]}),R={className:"string",variants:[A(),A("#"),A("##"),A("###"),k(),k("#"),k("##"),k("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],M={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},B=ge=>{const Le=Tt(ge,/\//),ve=Tt(/\//,ge);return{begin:Le,end:ve,contains:[...I,{scope:"comment",begin:`#(?!.*${ve})`,end:/$/}]}},Y={scope:"regexp",variants:[B("###"),B("##"),B("#"),M]},P={match:Tt(/`/,Ts,/`/)},U={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${gp}+`},L=[P,U,C],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:CW,contains:[...w,b,R]}]}},j={scope:"keyword",match:Tt(/@/,sr(...AW),pc(sr(/\(/,/\s+/)))},S={scope:"meta",match:Tt(/@/,Ts)},H=[O,j,S],V={match:pc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Tt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,gp,"+")},{className:"type",match:Sf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Tt(/\s+&\s+/,pc(Sf)),relevance:0}]},D={begin://,keywords:u,contains:[...r,...d,...H,m,V]};V.contains.push(D);const ne={match:Tt(Ts,/\s*:/),keywords:"_|0",relevance:0},ee={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ne,...r,Y,...d,...p,...w,b,R,...L,...H,V]},re={begin://,keywords:"repeat each",contains:[...r,V]},de={begin:sr(pc(Tt(Ts,/\s*:/)),pc(Tt(Ts,/\s+/,Ts,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ts}]},G={begin:/\(/,end:/\)/,keywords:u,contains:[de,...r,...d,...w,b,R,...H,V,ee],endsParent:!0,illegal:/["']/},W={match:[/(func|macro)/,/\s+/,sr(P.match,Ts,s0)],className:{1:"keyword",3:"title.function"},contains:[re,G,t],illegal:[/\[/,/%/]},oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[re,G,t],illegal:/\[|%/},he={match:[/operator/,/\s+/,s0],className:{1:"keyword",3:"title"}},J={begin:[/precedencegroup/,/\s+/,Sf],className:{1:"keyword",3:"title"},contains:[V],keywords:[...kW,...QT],end:/}/},ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ts,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[re,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Sf},...d],relevance:0}]};for(const ge of R.variants){const Le=ge.contains.find(Ue=>Ue.label==="interpol");Le.keywords=u;const ve=[...d,...p,...w,b,R,...L];Le.contains=[...ve,{begin:/\(/,end:/\)/,contains:["self",...ve]}]}return{name:"Swift",keywords:u,contains:[...r,W,oe,ce,Ce,Ee,he,J,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Y,...d,...p,...w,b,R,...L,...H,V,ee]}}const yp="[A-Za-z$_][0-9A-Za-z$_]*",jO=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],BO=["true","false","null","undefined","NaN","Infinity"],FO=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],UO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$O=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],HO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zO=[].concat($O,FO,UO);function RW(e){const t=e.regex,n=(O,{after:j})=>{const S="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const S=O[0].length+O.index,H=O.input[S];if(H==="<"||H===","){j.ignoreMatch();return}H===">"&&(n(O,{after:S})||j.ignoreMatch());let V;const D=O.input.substring(S);if(V=D.match(/^\s*=/)){j.ignoreMatch();return}if((V=D.match(/^\s+extends\s+/))&&V.index===0){j.ignoreMatch();return}}},o={$pattern:yp,keyword:jO,literal:BO,built_in:zO,"variable.language":HO},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(E,h.contains),N=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...FO,...UO]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,B([...$O,"super","import"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,E,{match:/\$\d+/},f,k,{scope:"attr",match:r+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,M,A,U,{match:/\$[(.]/}]}}function VO(e){const t=e.regex,n=RW(e),r=yp,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:yp,keyword:jO.concat(l),literal:BO,built_in:zO.concat(s),"variable.language":HO},d={className:"meta",begin:"@"+r},f=(y,w,g)=>{const E=y.contains.findIndex(b=>b.label===w);if(E===-1)throw new Error("can not find mode to replace");y.contains.splice(E,1,g)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(y=>y.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,i,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);const m=n.contains.find(y=>y.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function OW(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,o),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function LW(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,a,s,e.QUOTE_STRING_MODE,l,u,o]}}function MW(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,l,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function KO(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,y,i,a],g=[...w];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const DW={arduino:NY,bash:xO,c:kY,cpp:SY,csharp:AY,css:jY,diff:BY,go:FY,graphql:UY,ini:wO,java:$Y,javascript:kO,json:SO,kotlin:WY,less:tW,lua:nW,makefile:IO,markdown:RO,objectivec:rW,perl:sW,php:iW,"php-template":aW,plaintext:oW,python:OO,"python-repl":lW,r:cW,ruby:uW,rust:dW,scss:xW,shell:wW,sql:vW,swift:IW,typescript:VO,vbnet:OW,wasm:LW,xml:MW,yaml:KO};function YO(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&YO(n)}),e}let JT=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function WO(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Oi(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const PW="",eN=e=>!!e.scope,jW=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class BW{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=WO(t)}openNode(t){if(!eN(t))return;const n=jW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){eN(t)&&(this.buffer+=PW)}value(){return this.buffer}span(t){this.buffer+=``}}const tN=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class JE{constructor(){this.rootNode=tN(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=tN({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{JE._collapse(n)}))}}class FW extends JE{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new BW(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Fu(e){return e?typeof e=="string"?e:e.source:null}function qO(e){return ro("(?=",e,")")}function UW(e){return ro("(?:",e,")*")}function $W(e){return ro("(?:",e,")?")}function ro(...e){return e.map(n=>Fu(n)).join("")}function HW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ex(...e){return"("+(HW(e).capture?"":"?:")+e.map(r=>Fu(r)).join("|")+")"}function GO(e){return new RegExp(e.toString()+"|").exec("").length-1}function zW(e,t){const n=e&&e.exec(t);return n&&n.index===0}const VW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function tx(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Fu(r),a="";for(;i.length>0;){const o=VW.exec(i);if(!o){a+=i;break}a+=i.substring(0,o.index),i=i.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+s):(a+=o[0],o[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const KW=/\b\B/,XO="[a-zA-Z]\\w*",nx="[a-zA-Z_]\\w*",QO="\\b\\d+(\\.\\d+)?",ZO="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",JO="\\b(0b[01]+)",YW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",WW=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=ro(t,/.*\b/,e.binary,/\b.*/)),Oi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Uu={begin:"\\\\[\\s\\S]",relevance:0},qW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Uu]},GW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Uu]},XW={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},wm=function(e,t,n={}){const r=Oi({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=ex("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ro(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},QW=wm("//","$"),ZW=wm("/\\*","\\*/"),JW=wm("#","$"),eq={scope:"number",begin:QO,relevance:0},tq={scope:"number",begin:ZO,relevance:0},nq={scope:"number",begin:JO,relevance:0},rq={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Uu,{begin:/\[/,end:/\]/,relevance:0,contains:[Uu]}]},sq={scope:"title",begin:XO,relevance:0},iq={scope:"title",begin:nx,relevance:0},aq={begin:"\\.\\s*"+nx,relevance:0},oq=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var Af=Object.freeze({__proto__:null,APOS_STRING_MODE:qW,BACKSLASH_ESCAPE:Uu,BINARY_NUMBER_MODE:nq,BINARY_NUMBER_RE:JO,COMMENT:wm,C_BLOCK_COMMENT_MODE:ZW,C_LINE_COMMENT_MODE:QW,C_NUMBER_MODE:tq,C_NUMBER_RE:ZO,END_SAME_AS_BEGIN:oq,HASH_COMMENT_MODE:JW,IDENT_RE:XO,MATCH_NOTHING_RE:KW,METHOD_GUARD:aq,NUMBER_MODE:eq,NUMBER_RE:QO,PHRASAL_WORDS_MODE:XW,QUOTE_STRING_MODE:GW,REGEXP_MODE:rq,RE_STARTERS_RE:YW,SHEBANG:WW,TITLE_MODE:sq,UNDERSCORE_IDENT_RE:nx,UNDERSCORE_TITLE_MODE:iq});function lq(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function cq(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function uq(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=lq,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function dq(e,t){Array.isArray(e.illegal)&&(e.illegal=ex(...e.illegal))}function fq(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function hq(e,t){e.relevance===void 0&&(e.relevance=1)}const pq=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=ro(n.beforeMatch,qO(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},mq=["of","and","for","in","not","or","if","then","parent","list","value"],gq="keyword";function eL(e,t,n=gq){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(i){Object.assign(r,eL(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const l=o.split("|");r[l[0]]=[i,yq(l[0],l[1])]})}}function yq(e,t){return t?Number(t):bq(e)?0:1}function bq(e){return mq.includes(e.toLowerCase())}const nN={},Oa=e=>{console.error(e)},rN=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ho=(e,t)=>{nN[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),nN[`${e}/${t}`]=!0)},bp=new Error;function tL(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let o=1;o<=t.length;o++)a[o+r]=s[o],i[o+r]=!0,r+=GO(t[o-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function Eq(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Oa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),bp;if(typeof e.beginScope!="object"||e.beginScope===null)throw Oa("beginScope must be object"),bp;tL(e,e.begin,{key:"beginScope"}),e.begin=tx(e.begin,{joinWith:""})}}function xq(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Oa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),bp;if(typeof e.endScope!="object"||e.endScope===null)throw Oa("endScope must be object"),bp;tL(e,e.end,{key:"endScope"}),e.end=tx(e.end,{joinWith:""})}}function wq(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function vq(e){wq(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Eq(e),xq(e)}function _q(e){function t(a,o){return new RegExp(Fu(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=GO(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=t(tx(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const u=l.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new n;return this.rules.slice(o).forEach(([u,d])=>l.addRule(u,d)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const o=new r;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function i(a,o){const l=a;if(a.isCompiled)return l;[cq,fq,vq,pq].forEach(d=>d(a,o)),e.compilerExtensions.forEach(d=>d(a,o)),a.__beforeBegin=null,[uq,dq,hq].forEach(d=>d(a,o)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=eL(a.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=Fu(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Tq(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,l)}),a.starts&&i(a.starts,o),l.matcher=s(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Oi(e.classNameAliases||{}),i(e)}function nL(e){return e?e.endsWithParent||nL(e.starts):!1}function Tq(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Oi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:nL(e)?Oi(e,{starts:e.starts?Oi(e.starts):null}):Object.isFrozen(e)?Oi(e):e}var Nq="11.11.1";class kq extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const i0=WO,sN=Oi,iN=Symbol("nomatch"),Sq=7,rL=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:FW};function l(C){return o.noHighlightRe.test(C)}function u(C){let L=C.className+" ";L+=C.parentNode?C.parentNode.className:"";const O=o.languageDetectRe.exec(L);if(O){const j=k(O[1]);return j||(rN(i.replace("{}",O[1])),rN("Falling back to no-highlight mode for this block.",C)),j?O[1]:"no-highlight"}return L.split(/\s+/).find(j=>l(j)||k(j))}function d(C,L,O){let j="",S="";typeof L=="object"?(j=C,O=L.ignoreIllegals,S=L.language):(ho("10.7.0","highlight(lang, code, ...args) has been deprecated."),ho("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),S=C,j=L),O===void 0&&(O=!0);const H={code:j,language:S};P("before:highlight",H);const V=H.result?H.result:f(H.language,H.code,O);return V.code=H.code,P("after:highlight",V),V}function f(C,L,O,j){const S=Object.create(null);function H(K,X){return K.keywords[X]}function V(){if(!ve.keywords){Ie.addText(ae);return}let K=0;ve.keywordPatternRe.lastIndex=0;let X=ve.keywordPatternRe.exec(ae),le="";for(;X;){le+=ae.substring(K,X.index);const Ne=Ee.case_insensitive?X[0].toLowerCase():X[0],Re=H(ve,Ne);if(Re){const[ut,We]=Re;if(Ie.addText(le),le="",S[Ne]=(S[Ne]||0)+1,S[Ne]<=Sq&&(wt+=We),ut.startsWith("_"))le+=X[0];else{const ot=Ee.classNameAliases[ut]||ut;ee(X[0],ot)}}else le+=X[0];K=ve.keywordPatternRe.lastIndex,X=ve.keywordPatternRe.exec(ae)}le+=ae.substring(K),Ie.addText(le)}function D(){if(ae==="")return;let K=null;if(typeof ve.subLanguage=="string"){if(!t[ve.subLanguage]){Ie.addText(ae);return}K=f(ve.subLanguage,ae,!0,Ue[ve.subLanguage]),Ue[ve.subLanguage]=K._top}else K=p(ae,ve.subLanguage.length?ve.subLanguage:null);ve.relevance>0&&(wt+=K.relevance),Ie.__addSublanguage(K._emitter,K.language)}function ne(){ve.subLanguage!=null?D():V(),ae=""}function ee(K,X){K!==""&&(Ie.startScope(X),Ie.addText(K),Ie.endScope())}function re(K,X){let le=1;const Ne=X.length-1;for(;le<=Ne;){if(!K._emit[le]){le++;continue}const Re=Ee.classNameAliases[K[le]]||K[le],ut=X[le];Re?ee(ut,Re):(ae=ut,V(),ae=""),le++}}function de(K,X){return K.scope&&typeof K.scope=="string"&&Ie.openNode(Ee.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(ee(ae,Ee.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),ae=""):K.beginScope._multi&&(re(K.beginScope,X),ae="")),ve=Object.create(K,{parent:{value:ve}}),ve}function G(K,X,le){let Ne=zW(K.endRe,le);if(Ne){if(K["on:end"]){const Re=new JT(K);K["on:end"](X,Re),Re.isMatchIgnored&&(Ne=!1)}if(Ne){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return G(K.parent,X,le)}function W(K){return ve.matcher.regexIndex===0?(ae+=K[0],1):(ct=!0,0)}function oe(K){const X=K[0],le=K.rule,Ne=new JT(le),Re=[le.__beforeBegin,le["on:begin"]];for(const ut of Re)if(ut&&(ut(K,Ne),Ne.isMatchIgnored))return W(X);return le.skip?ae+=X:(le.excludeBegin&&(ae+=X),ne(),!le.returnBegin&&!le.excludeBegin&&(ae=X)),de(le,K),le.returnBegin?0:X.length}function he(K){const X=K[0],le=L.substring(K.index),Ne=G(ve,K,le);if(!Ne)return iN;const Re=ve;ve.endScope&&ve.endScope._wrap?(ne(),ee(X,ve.endScope._wrap)):ve.endScope&&ve.endScope._multi?(ne(),re(ve.endScope,K)):Re.skip?ae+=X:(Re.returnEnd||Re.excludeEnd||(ae+=X),ne(),Re.excludeEnd&&(ae=X));do ve.scope&&Ie.closeNode(),!ve.skip&&!ve.subLanguage&&(wt+=ve.relevance),ve=ve.parent;while(ve!==Ne.parent);return Ne.starts&&de(Ne.starts,K),Re.returnEnd?0:X.length}function J(){const K=[];for(let X=ve;X!==Ee;X=X.parent)X.scope&&K.unshift(X.scope);K.forEach(X=>Ie.openNode(X))}let ce={};function Ce(K,X){const le=X&&X[0];if(ae+=K,le==null)return ne(),0;if(ce.type==="begin"&&X.type==="end"&&ce.index===X.index&&le===""){if(ae+=L.slice(X.index,X.index+1),!s){const Ne=new Error(`0 width match regex (${C})`);throw Ne.languageName=C,Ne.badRule=ce.rule,Ne}return 1}if(ce=X,X.type==="begin")return oe(X);if(X.type==="illegal"&&!O){const Ne=new Error('Illegal lexeme "'+le+'" for mode "'+(ve.scope||"")+'"');throw Ne.mode=ve,Ne}else if(X.type==="end"){const Ne=he(X);if(Ne!==iN)return Ne}if(X.type==="illegal"&&le==="")return ae+=` +`,1;if(vt>1e5&&vt>X.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ae+=le,le.length}const Ee=k(C);if(!Ee)throw Oa(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const ge=_q(Ee);let Le="",ve=j||ge;const Ue={},Ie=new o.__emitter(o);J();let ae="",wt=0,we=0,vt=0,ct=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(L,Ie);else{for(ve.matcher.considerAll();;){vt++,ct?ct=!1:ve.matcher.considerAll(),ve.matcher.lastIndex=we;const K=ve.matcher.exec(L);if(!K)break;const X=L.substring(we,K.index),le=Ce(X,K);we=K.index+le}Ce(L.substring(we))}return Ie.finalize(),Le=Ie.toHTML(),{language:C,value:Le,relevance:wt,illegal:!1,_emitter:Ie,_top:ve}}catch(K){if(K.message&&K.message.includes("Illegal"))return{language:C,value:i0(L),illegal:!0,relevance:0,_illegalBy:{message:K.message,index:we,context:L.slice(we-100,we+100),mode:K.mode,resultSoFar:Le},_emitter:Ie};if(s)return{language:C,value:i0(L),illegal:!1,relevance:0,errorRaised:K,_emitter:Ie,_top:ve};throw K}}function h(C){const L={value:i0(C),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return L._emitter.addText(C),L}function p(C,L){L=L||o.languages||Object.keys(t);const O=h(C),j=L.filter(k).filter(I).map(ne=>f(ne,C,!1));j.unshift(O);const S=j.sort((ne,ee)=>{if(ne.relevance!==ee.relevance)return ee.relevance-ne.relevance;if(ne.language&&ee.language){if(k(ne.language).supersetOf===ee.language)return 1;if(k(ee.language).supersetOf===ne.language)return-1}return 0}),[H,V]=S,D=H;return D.secondBest=V,D}function m(C,L,O){const j=L&&n[L]||O;C.classList.add("hljs"),C.classList.add(`language-${j}`)}function y(C){let L=null;const O=u(C);if(l(O))return;if(P("before:highlightElement",{el:C,language:O}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),o.throwUnescapedHTML))throw new kq("One of your code blocks includes unescaped HTML.",C.innerHTML);L=C;const j=L.textContent,S=O?d(j,{language:O,ignoreIllegals:!0}):p(j);C.innerHTML=S.value,C.dataset.highlighted="yes",m(C,O,S.language),C.result={language:S.language,re:S.relevance,relevance:S.relevance},S.secondBest&&(C.secondBest={language:S.secondBest.language,relevance:S.secondBest.relevance}),P("after:highlightElement",{el:C,result:S,text:j})}function w(C){o=sN(o,C)}const g=()=>{_(),ho("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){_(),ho("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function _(){function C(){_()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",C,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(y)}function N(C,L){let O=null;try{O=L(e)}catch(j){if(Oa("Language definition for '{}' could not be registered.".replace("{}",C)),s)Oa(j);else throw j;O=a}O.name||(O.name=C),t[C]=O,O.rawDefinition=L.bind(null,e),O.aliases&&R(O.aliases,{languageName:C})}function T(C){delete t[C];for(const L of Object.keys(n))n[L]===C&&delete n[L]}function A(){return Object.keys(t)}function k(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:L}){typeof C=="string"&&(C=[C]),C.forEach(O=>{n[O.toLowerCase()]=L})}function I(C){const L=k(C);return L&&!L.disableAutodetect}function M(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=L=>{C["before:highlightBlock"](Object.assign({block:L.el},L))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=L=>{C["after:highlightBlock"](Object.assign({block:L.el},L))})}function B(C){M(C),r.push(C)}function Y(C){const L=r.indexOf(C);L!==-1&&r.splice(L,1)}function P(C,L){const O=C;r.forEach(function(j){j[O]&&j[O](L)})}function U(C){return ho("10.7.0","highlightBlock will be removed entirely in v12.0"),ho("10.7.0","Please use highlightElement now."),y(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:y,highlightBlock:U,configure:w,initHighlighting:g,initHighlightingOnLoad:E,registerLanguage:N,unregisterLanguage:T,listLanguages:A,getLanguage:k,registerAliases:R,autoDetection:I,inherit:sN,addPlugin:B,removePlugin:Y}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Nq,e.regex={concat:ro,lookahead:qO,either:ex,optional:$W,anyNumberOfTimes:UW};for(const C in Af)typeof Af[C]=="object"&&YO(Af[C]);return Object.assign(e,Af),e},bl=rL({});bl.newInstance=()=>rL({});var Aq=bl;bl.HighlightJS=bl;bl.default=bl;const wr=td(Aq),aN={},Cq="hljs-";function Iq(e){const t=wr.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:o};function n(l,u,d){const f=d||aN,h=typeof f.prefix=="string"?f.prefix:Cq;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:Rq,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,y=m.data;return y.language=p.language,y.relevance=p.relevance,m}function r(l,u){const f=(u||aN).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let d;for(d in l)Object.hasOwn(l,d)&&t.registerLanguage(d,l[d])}}function a(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let d;for(d in l)if(Object.hasOwn(l,d)){const f=l[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function o(l){return!!t.getLanguage(l)}}class Rq{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],s=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):r.children.push(...s)}openNode(t){const n=this,r=t.split(".").map(function(a,o){return o?a+"_".repeat(o):n.options.classPrefix+a}),s=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Oq={};function oN(e){const t=e||Oq,n=t.aliases,r=t.detect||!1,s=t.languages||DW,i=t.plainText,a=t.prefix,o=t.subset;let l="hljs";const u=Iq(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");l=d===-1?a:a.slice(0,d)}return function(d,f){Ed(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const y=Lq(h);if(y===!1||!y&&!r||y&&i&&i.includes(y))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(l)||h.properties.className.unshift(l);const w=gY(h,{whitespace:"pre"});let g;try{g=y?u.highlight(y,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:o})}catch(E){const b=E;if(y&&/Unknown language/.test(b.message)){f.message("Cannot highlight as `"+y+"`, it’s not registered",{ancestors:[m,h],cause:b,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!y&&g.data&&g.data.language&&h.properties.className.push("language-"+g.data.language),g.children.length>0&&(h.children=g.children)})}}function Lq(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n-1&&i<=t.length){let a=0;for(;;){let o=n[a];if(o===void 0){const l=uN(t,n[a-1]);o=l===-1?t.length+1:l+1,n[a]=o}if(o>i)return{line:a+1,column:i-(a>0?n[a-1]:0)+1,offset:i};a++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length1?n[i.line-2]:0)+i.column-1;if(a=55296&&e<=57343}function iG(e){return e>=56320&&e<=57343}function aG(e,t){return(e-55296)*1024+9216+t}function cL(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function uL(e){return e>=64976&&e<=65007||sG.has(e)}var se;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(se||(se={}));const oG=65536;class lG{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=oG,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:i}=this,a=s+n,o=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(iG(n))return this.pos++,this._addGap(),aG(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,F.EOF;return this._err(se.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;const r=this.html.charCodeAt(n);return r===F.CARRIAGE_RETURN?F.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;let t=this.html.charCodeAt(this.pos);return t===F.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,F.LINE_FEED):t===F.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,lL(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===F.LINE_FEED||t===F.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){cL(t)?this._err(se.controlCharacterInInputStream):uL(t)&&this._err(se.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const cG=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),uG=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function dG(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=uG.get(e))!==null&&t!==void 0?t:e}var Ln;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ln||(Ln={}));const fG=32;var Li;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Li||(Li={}));function w1(e){return e>=Ln.ZERO&&e<=Ln.NINE}function hG(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_F||e>=Ln.LOWER_A&&e<=Ln.LOWER_F}function pG(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_Z||e>=Ln.LOWER_A&&e<=Ln.LOWER_Z||w1(e)}function mG(e){return e===Ln.EQUALS||pG(e)}var Rn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Rn||(Rn={}));var qs;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(qs||(qs={}));class gG{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Rn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=qs.Strict}startEntity(t){this.decodeMode=t,this.state=Rn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Rn.EntityStart:return t.charCodeAt(n)===Ln.NUM?(this.state=Rn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Rn.NamedEntity,this.stateNamedEntity(t,n));case Rn.NumericStart:return this.stateNumericStart(t,n);case Rn.NumericDecimal:return this.stateNumericDecimal(t,n);case Rn.NumericHex:return this.stateNumericHex(t,n);case Rn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|fG)===Ln.LOWER_X?(this.state=Rn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Rn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(t.substr(n,i),s),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n>14;for(;n>14,i!==0){if(a===Ln.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==qs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&Li.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~Li.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Rn.NamedEntity:return this.result!==0&&(this.decodeMode!==qs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Rn.NumericDecimal:return this.emitNumericEntity(0,2);case Rn.NumericHex:return this.emitNumericEntity(0,3);case Rn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Rn.EntityStart:return 0}}}function yG(e,t,n,r){const s=(t&Li.BRANCH_LENGTH)>>7,i=t&Li.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=s?-1:e[n+l]-1}let a=n,o=a+s-1;for(;a<=o;){const l=a+o>>>1,u=e[l];if(ur)o=l-1;else return e[l+s]}return-1}var fe;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(fe||(fe={}));var La;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(La||(La={}));var zr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(zr||(zr={}));var Q;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Q||(Q={}));var x;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(x||(x={}));const bG=new Map([[Q.A,x.A],[Q.ADDRESS,x.ADDRESS],[Q.ANNOTATION_XML,x.ANNOTATION_XML],[Q.APPLET,x.APPLET],[Q.AREA,x.AREA],[Q.ARTICLE,x.ARTICLE],[Q.ASIDE,x.ASIDE],[Q.B,x.B],[Q.BASE,x.BASE],[Q.BASEFONT,x.BASEFONT],[Q.BGSOUND,x.BGSOUND],[Q.BIG,x.BIG],[Q.BLOCKQUOTE,x.BLOCKQUOTE],[Q.BODY,x.BODY],[Q.BR,x.BR],[Q.BUTTON,x.BUTTON],[Q.CAPTION,x.CAPTION],[Q.CENTER,x.CENTER],[Q.CODE,x.CODE],[Q.COL,x.COL],[Q.COLGROUP,x.COLGROUP],[Q.DD,x.DD],[Q.DESC,x.DESC],[Q.DETAILS,x.DETAILS],[Q.DIALOG,x.DIALOG],[Q.DIR,x.DIR],[Q.DIV,x.DIV],[Q.DL,x.DL],[Q.DT,x.DT],[Q.EM,x.EM],[Q.EMBED,x.EMBED],[Q.FIELDSET,x.FIELDSET],[Q.FIGCAPTION,x.FIGCAPTION],[Q.FIGURE,x.FIGURE],[Q.FONT,x.FONT],[Q.FOOTER,x.FOOTER],[Q.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[Q.FORM,x.FORM],[Q.FRAME,x.FRAME],[Q.FRAMESET,x.FRAMESET],[Q.H1,x.H1],[Q.H2,x.H2],[Q.H3,x.H3],[Q.H4,x.H4],[Q.H5,x.H5],[Q.H6,x.H6],[Q.HEAD,x.HEAD],[Q.HEADER,x.HEADER],[Q.HGROUP,x.HGROUP],[Q.HR,x.HR],[Q.HTML,x.HTML],[Q.I,x.I],[Q.IMG,x.IMG],[Q.IMAGE,x.IMAGE],[Q.INPUT,x.INPUT],[Q.IFRAME,x.IFRAME],[Q.KEYGEN,x.KEYGEN],[Q.LABEL,x.LABEL],[Q.LI,x.LI],[Q.LINK,x.LINK],[Q.LISTING,x.LISTING],[Q.MAIN,x.MAIN],[Q.MALIGNMARK,x.MALIGNMARK],[Q.MARQUEE,x.MARQUEE],[Q.MATH,x.MATH],[Q.MENU,x.MENU],[Q.META,x.META],[Q.MGLYPH,x.MGLYPH],[Q.MI,x.MI],[Q.MO,x.MO],[Q.MN,x.MN],[Q.MS,x.MS],[Q.MTEXT,x.MTEXT],[Q.NAV,x.NAV],[Q.NOBR,x.NOBR],[Q.NOFRAMES,x.NOFRAMES],[Q.NOEMBED,x.NOEMBED],[Q.NOSCRIPT,x.NOSCRIPT],[Q.OBJECT,x.OBJECT],[Q.OL,x.OL],[Q.OPTGROUP,x.OPTGROUP],[Q.OPTION,x.OPTION],[Q.P,x.P],[Q.PARAM,x.PARAM],[Q.PLAINTEXT,x.PLAINTEXT],[Q.PRE,x.PRE],[Q.RB,x.RB],[Q.RP,x.RP],[Q.RT,x.RT],[Q.RTC,x.RTC],[Q.RUBY,x.RUBY],[Q.S,x.S],[Q.SCRIPT,x.SCRIPT],[Q.SEARCH,x.SEARCH],[Q.SECTION,x.SECTION],[Q.SELECT,x.SELECT],[Q.SOURCE,x.SOURCE],[Q.SMALL,x.SMALL],[Q.SPAN,x.SPAN],[Q.STRIKE,x.STRIKE],[Q.STRONG,x.STRONG],[Q.STYLE,x.STYLE],[Q.SUB,x.SUB],[Q.SUMMARY,x.SUMMARY],[Q.SUP,x.SUP],[Q.TABLE,x.TABLE],[Q.TBODY,x.TBODY],[Q.TEMPLATE,x.TEMPLATE],[Q.TEXTAREA,x.TEXTAREA],[Q.TFOOT,x.TFOOT],[Q.TD,x.TD],[Q.TH,x.TH],[Q.THEAD,x.THEAD],[Q.TITLE,x.TITLE],[Q.TR,x.TR],[Q.TRACK,x.TRACK],[Q.TT,x.TT],[Q.U,x.U],[Q.UL,x.UL],[Q.SVG,x.SVG],[Q.VAR,x.VAR],[Q.WBR,x.WBR],[Q.XMP,x.XMP]]);function zl(e){var t;return(t=bG.get(e))!==null&&t!==void 0?t:x.UNKNOWN}const pe=x,EG={[fe.HTML]:new Set([pe.ADDRESS,pe.APPLET,pe.AREA,pe.ARTICLE,pe.ASIDE,pe.BASE,pe.BASEFONT,pe.BGSOUND,pe.BLOCKQUOTE,pe.BODY,pe.BR,pe.BUTTON,pe.CAPTION,pe.CENTER,pe.COL,pe.COLGROUP,pe.DD,pe.DETAILS,pe.DIR,pe.DIV,pe.DL,pe.DT,pe.EMBED,pe.FIELDSET,pe.FIGCAPTION,pe.FIGURE,pe.FOOTER,pe.FORM,pe.FRAME,pe.FRAMESET,pe.H1,pe.H2,pe.H3,pe.H4,pe.H5,pe.H6,pe.HEAD,pe.HEADER,pe.HGROUP,pe.HR,pe.HTML,pe.IFRAME,pe.IMG,pe.INPUT,pe.LI,pe.LINK,pe.LISTING,pe.MAIN,pe.MARQUEE,pe.MENU,pe.META,pe.NAV,pe.NOEMBED,pe.NOFRAMES,pe.NOSCRIPT,pe.OBJECT,pe.OL,pe.P,pe.PARAM,pe.PLAINTEXT,pe.PRE,pe.SCRIPT,pe.SECTION,pe.SELECT,pe.SOURCE,pe.STYLE,pe.SUMMARY,pe.TABLE,pe.TBODY,pe.TD,pe.TEMPLATE,pe.TEXTAREA,pe.TFOOT,pe.TH,pe.THEAD,pe.TITLE,pe.TR,pe.TRACK,pe.UL,pe.WBR,pe.XMP]),[fe.MATHML]:new Set([pe.MI,pe.MO,pe.MN,pe.MS,pe.MTEXT,pe.ANNOTATION_XML]),[fe.SVG]:new Set([pe.TITLE,pe.FOREIGN_OBJECT,pe.DESC]),[fe.XLINK]:new Set,[fe.XML]:new Set,[fe.XMLNS]:new Set},v1=new Set([pe.H1,pe.H2,pe.H3,pe.H4,pe.H5,pe.H6]);Q.STYLE,Q.SCRIPT,Q.XMP,Q.IFRAME,Q.NOEMBED,Q.NOFRAMES,Q.PLAINTEXT;var $;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})($||($={}));const fn={DATA:$.DATA,RCDATA:$.RCDATA,RAWTEXT:$.RAWTEXT,SCRIPT_DATA:$.SCRIPT_DATA,PLAINTEXT:$.PLAINTEXT,CDATA_SECTION:$.CDATA_SECTION};function xG(e){return e>=F.DIGIT_0&&e<=F.DIGIT_9}function Rc(e){return e>=F.LATIN_CAPITAL_A&&e<=F.LATIN_CAPITAL_Z}function wG(e){return e>=F.LATIN_SMALL_A&&e<=F.LATIN_SMALL_Z}function wi(e){return wG(e)||Rc(e)}function fN(e){return wi(e)||xG(e)}function Cf(e){return e+32}function fL(e){return e===F.SPACE||e===F.LINE_FEED||e===F.TABULATION||e===F.FORM_FEED}function hN(e){return fL(e)||e===F.SOLIDUS||e===F.GREATER_THAN_SIGN}function vG(e){return e===F.NULL?se.nullCharacterReference:e>1114111?se.characterReferenceOutsideUnicodeRange:lL(e)?se.surrogateCharacterReference:uL(e)?se.noncharacterCharacterReference:cL(e)||e===F.CARRIAGE_RETURN?se.controlCharacterReference:null}class _G{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=$.DATA,this.returnState=$.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new lG(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new gG(cG,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(se.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(se.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=vG(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(se.endTagWithAttributes),t.selfClosing&&this._err(se.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case nt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case nt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case nt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:nt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=fL(t)?nt.WHITESPACE_CHARACTER:t===F.NULL?nt.NULL_CHARACTER:nt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(nt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=$.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?qs.Attribute:qs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case $.DATA:{this._stateData(t);break}case $.RCDATA:{this._stateRcdata(t);break}case $.RAWTEXT:{this._stateRawtext(t);break}case $.SCRIPT_DATA:{this._stateScriptData(t);break}case $.PLAINTEXT:{this._statePlaintext(t);break}case $.TAG_OPEN:{this._stateTagOpen(t);break}case $.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case $.TAG_NAME:{this._stateTagName(t);break}case $.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case $.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case $.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case $.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case $.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case $.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case $.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case $.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case $.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case $.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case $.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case $.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case $.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case $.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case $.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case $.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case $.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case $.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case $.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case $.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case $.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case $.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case $.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case $.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case $.BOGUS_COMMENT:{this._stateBogusComment(t);break}case $.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case $.COMMENT_START:{this._stateCommentStart(t);break}case $.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case $.COMMENT:{this._stateComment(t);break}case $.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case $.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case $.COMMENT_END:{this._stateCommentEnd(t);break}case $.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case $.DOCTYPE:{this._stateDoctype(t);break}case $.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case $.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case $.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case $.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case $.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case $.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case $.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case $.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case $.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case $.CDATA_SECTION:{this._stateCdataSection(t);break}case $.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case $.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case $.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.TAG_OPEN;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitCodePoint(t);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case F.AMPERSAND:{this._startCharacterReference();break}case F.LESS_THAN_SIGN:{this.state=$.RCDATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.RAWTEXT_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(wi(t))this._createStartTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case F.EXCLAMATION_MARK:{this.state=$.MARKUP_DECLARATION_OPEN;break}case F.SOLIDUS:{this.state=$.END_TAG_OPEN;break}case F.QUESTION_MARK:{this._err(se.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t);break}case F.EOF:{this._err(se.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(se.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(wi(t))this._createEndTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case F.GREATER_THAN_SIGN:{this._err(se.missingEndTagName),this.state=$.DATA;break}case F.EOF:{this._err(se.eofBeforeTagName),this._emitChars("");break}case F.NULL:{this._err(se.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(Yt);break}case F.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===F.SOLIDUS?this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:wi(t)?(this._emitChars("<"),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){wi(t)?(this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case F.NULL:{this._err(se.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Yt);break}case F.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===F.SOLIDUS?(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(hr.SCRIPT,!1)&&hN(this.preprocessor.peek(hr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==fe.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(AG,fe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(SG,fe.HTML)}clearBackToTableRowContext(){this.clearBackTo(kG,fe.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===x.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===x.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case fe.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case fe.SVG:{if(gN.has(s))return!1;break}case fe.MATHML:{if(mN.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ep)}hasInListItemScope(t){return this.hasInDynamicScope(t,TG)}hasInButtonScope(t){return this.hasInDynamicScope(t,NG)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case fe.HTML:{if(v1.has(n))return!0;if(Ep.has(n))return!1;break}case fe.SVG:{if(gN.has(n))return!1;break}case fe.MATHML:{if(mN.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===fe.HTML)switch(this.tagIDs[n]){case t:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===fe.HTML)switch(this.tagIDs[t]){case x.TBODY:case x.THEAD:case x.TFOOT:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===fe.HTML)switch(this.tagIDs[n]){case t:return!0;case x.OPTION:case x.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&hL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&pN.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&pN.has(this.currentTagId);)this.pop()}}const a0=3;var Ss;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ss||(Ss={}));const yN={type:Ss.Marker};class RG{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let o=0;o[a.name,a.value]));let i=0;for(let a=0;as.get(l.name)===l.value)&&(i+=1,i>=a0&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(yN)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ss.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ss.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(yN);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ss.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ss.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ss.Element&&n.element===t)}}const vi={createDocument(){return{nodeName:"#document",mode:zr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};vi.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(vi.isTextNode(n)){n.value+=t;return}}vi.appendChild(e,vi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&vi.isTextNode(r)?r.value+=t:vi.insertBefore(e,vi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function jG(e){return e.name===pL&&e.publicId===null&&(e.systemId===null||e.systemId===OG)}function BG(e){if(e.name!==pL)return zr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===LG)return zr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),DG.has(n))return zr.QUIRKS;let r=t===null?MG:mL;if(bN(n,r))return zr.QUIRKS;if(r=t===null?gL:PG,bN(n,r))return zr.LIMITED_QUIRKS}return zr.NO_QUIRKS}const EN={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},FG="definitionurl",UG="definitionURL",$G=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),HG=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:fe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:fe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:fe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:fe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:fe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:fe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:fe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:fe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:fe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:fe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:fe.XMLNS}]]),zG=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),VG=new Set([x.B,x.BIG,x.BLOCKQUOTE,x.BODY,x.BR,x.CENTER,x.CODE,x.DD,x.DIV,x.DL,x.DT,x.EM,x.EMBED,x.H1,x.H2,x.H3,x.H4,x.H5,x.H6,x.HEAD,x.HR,x.I,x.IMG,x.LI,x.LISTING,x.MENU,x.META,x.NOBR,x.OL,x.P,x.PRE,x.RUBY,x.S,x.SMALL,x.SPAN,x.STRONG,x.STRIKE,x.SUB,x.SUP,x.TABLE,x.TT,x.U,x.UL,x.VAR]);function KG(e){const t=e.tagID;return t===x.FONT&&e.attrs.some(({name:r})=>r===La.COLOR||r===La.SIZE||r===La.FACE)||VG.has(t)}function yL(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let i,a;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,a=this.fragmentContextID):{current:i,currentTagId:a}=this.openElements,this._setContextModes(i,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===fe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,fe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=z.TEXT}switchToPlaintextParsing(){this.insertionMode=z.TEXT,this.originalInsertionMode=z.IN_BODY,this.tokenizer.state=fn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Q.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==fe.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=fn.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=fn.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=fn.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=fn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,fe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,fe.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Q.HTML,fe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,x.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,a=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:l,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:l,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),i=n.type===nt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===x.SVG&&this.treeAdapter.getTagName(n)===Q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===fe.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===x.MGLYPH||t.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,fe.HTML)}_processToken(t){switch(t.type){case nt.CHARACTER:{this.onCharacter(t);break}case nt.NULL_CHARACTER:{this.onNullCharacter(t);break}case nt.COMMENT:{this.onComment(t);break}case nt.DOCTYPE:{this.onDoctype(t);break}case nt.START_TAG:{this._processStartTag(t);break}case nt.END_TAG:{this.onEndTag(t);break}case nt.EOF:{this.onEof(t);break}case nt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return GG(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Ss.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(x.P),this.openElements.popUntilTagNamePopped(x.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case x.TR:{this.insertionMode=z.IN_ROW;return}case x.TBODY:case x.THEAD:case x.TFOOT:{this.insertionMode=z.IN_TABLE_BODY;return}case x.CAPTION:{this.insertionMode=z.IN_CAPTION;return}case x.COLGROUP:{this.insertionMode=z.IN_COLUMN_GROUP;return}case x.TABLE:{this.insertionMode=z.IN_TABLE;return}case x.BODY:{this.insertionMode=z.IN_BODY;return}case x.FRAMESET:{this.insertionMode=z.IN_FRAMESET;return}case x.SELECT:{this._resetInsertionModeForSelect(t);return}case x.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case x.HTML:{this.insertionMode=this.headElement?z.AFTER_HEAD:z.BEFORE_HEAD;return}case x.TD:case x.TH:{if(t>0){this.insertionMode=z.IN_CELL;return}break}case x.HEAD:{if(t>0){this.insertionMode=z.IN_HEAD;return}break}}this.insertionMode=z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===x.TEMPLATE)break;if(r===x.TABLE){this.insertionMode=z.IN_SELECT_IN_TABLE;return}}this.insertionMode=z.IN_SELECT}_isElementCausesFosterParenting(t){return EL.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case x.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===fe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case x.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return EG[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){CQ(this,t);return}switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:{wL(this,t);break}case z.TEXT:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{o0(this,t);break}case z.IN_TABLE_TEXT:{SL(this,t);break}case z.IN_COLUMN_GROUP:{xp(this,t);break}case z.AFTER_BODY:{wp(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){AQ(this,t);return}switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.TEXT:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{o0(this,t);break}case z.IN_COLUMN_GROUP:{xp(this,t);break}case z.AFTER_BODY:{wp(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){_1(this,t);return}switch(this.insertionMode){case z.INITIAL:case z.BEFORE_HTML:case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_TEMPLATE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{_1(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.AFTER_BODY:{aX(this,t);break}case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{oX(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case z.INITIAL:{lX(this,t);break}case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:{this._err(t,se.misplacedDoctype);break}case z.IN_TABLE_TEXT:{gc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,se.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?IQ(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{cX(this,t);break}case z.BEFORE_HEAD:{dX(this,t);break}case z.IN_HEAD:{bs(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pX(this,t);break}case z.AFTER_HEAD:{gX(this,t);break}case z.IN_BODY:{Jn(this,t);break}case z.IN_TABLE:{El(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_CAPTION:{fQ(this,t);break}case z.IN_COLUMN_GROUP:{lx(this,t);break}case z.IN_TABLE_BODY:{Tm(this,t);break}case z.IN_ROW:{Nm(this,t);break}case z.IN_CELL:{mQ(this,t);break}case z.IN_SELECT:{IL(this,t);break}case z.IN_SELECT_IN_TABLE:{yQ(this,t);break}case z.IN_TEMPLATE:{EQ(this,t);break}case z.AFTER_BODY:{wQ(this,t);break}case z.IN_FRAMESET:{vQ(this,t);break}case z.AFTER_FRAMESET:{TQ(this,t);break}case z.AFTER_AFTER_BODY:{kQ(this,t);break}case z.AFTER_AFTER_FRAMESET:{SQ(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?RQ(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{uX(this,t);break}case z.BEFORE_HEAD:{fX(this,t);break}case z.IN_HEAD:{hX(this,t);break}case z.IN_HEAD_NO_SCRIPT:{mX(this,t);break}case z.AFTER_HEAD:{yX(this,t);break}case z.IN_BODY:{_m(this,t);break}case z.TEXT:{nQ(this,t);break}case z.IN_TABLE:{$u(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_CAPTION:{hQ(this,t);break}case z.IN_COLUMN_GROUP:{pQ(this,t);break}case z.IN_TABLE_BODY:{T1(this,t);break}case z.IN_ROW:{CL(this,t);break}case z.IN_CELL:{gQ(this,t);break}case z.IN_SELECT:{RL(this,t);break}case z.IN_SELECT_IN_TABLE:{bQ(this,t);break}case z.IN_TEMPLATE:{xQ(this,t);break}case z.AFTER_BODY:{LL(this,t);break}case z.IN_FRAMESET:{_Q(this,t);break}case z.AFTER_FRAMESET:{NQ(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onEof(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{NL(this,t);break}case z.TEXT:{rQ(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_TEMPLATE:{OL(this,t);break}case z.AFTER_BODY:case z.IN_FRAMESET:case z.AFTER_FRAMESET:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{ox(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===F.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.TEXT:case z.IN_COLUMN_GROUP:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{this._insertCharacters(t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:case z.AFTER_BODY:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{xL(this,t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{o0(this,t);break}case z.IN_TABLE_TEXT:{kL(this,t);break}}}};function eX(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):TL(e,t),n}function tX(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function nX(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,a=s;a!==n;i++,a=s){s=e.openElements.getCommonAncestor(a);const o=e.activeFormattingElements.getElementEntry(a),l=o&&i>=ZG;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=rX(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function rX(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function sX(e,t,n){const r=e.treeAdapter.getTagName(t),s=zl(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===x.TEMPLATE&&i===fe.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function iX(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function ax(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(i);a&&!a.endTag&&e._setEndLocation(i,t)}}}}function lX(e,t){e._setDocumentType(t);const n=t.forceQuirks?zr.QUIRKS:BG(t);jG(t)||e._err(t,se.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=z.BEFORE_HTML}function mc(e,t){e._err(t,se.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,zr.QUIRKS),e.insertionMode=z.BEFORE_HTML,e._processToken(t)}function cX(e,t){t.tagID===x.HTML?(e._insertElement(t,fe.HTML),e.insertionMode=z.BEFORE_HEAD):eu(e,t)}function uX(e,t){const n=t.tagID;(n===x.HTML||n===x.HEAD||n===x.BODY||n===x.BR)&&eu(e,t)}function eu(e,t){e._insertFakeRootElement(),e.insertionMode=z.BEFORE_HEAD,e._processToken(t)}function dX(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.HEAD:{e._insertElement(t,fe.HTML),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD;break}default:tu(e,t)}}function fX(e,t){const n=t.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?tu(e,t):e._err(t,se.endTagWithoutMatchingOpenElement)}function tu(e,t){e._insertFakeElement(Q.HEAD,x.HEAD),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD,e._processToken(t)}function bs(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{e._appendElement(t,fe.HTML),t.ackSelfClosing=!0;break}case x.TITLE:{e._switchToTextParsing(t,fn.RCDATA);break}case x.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,fn.RAWTEXT):(e._insertElement(t,fe.HTML),e.insertionMode=z.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{e._switchToTextParsing(t,fn.RAWTEXT);break}case x.SCRIPT:{e._switchToTextParsing(t,fn.SCRIPT_DATA);break}case x.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(z.IN_TEMPLATE);break}case x.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:nu(e,t)}}function hX(e,t){switch(t.tagID){case x.HEAD:{e.openElements.pop(),e.insertionMode=z.AFTER_HEAD;break}case x.BODY:case x.BR:case x.HTML:{nu(e,t);break}case x.TEMPLATE:{so(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function so(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==x.TEMPLATE&&e._err(t,se.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,se.endTagWithoutMatchingOpenElement)}function nu(e,t){e.openElements.pop(),e.insertionMode=z.AFTER_HEAD,e._processToken(t)}function pX(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BASEFONT:case x.BGSOUND:case x.HEAD:case x.LINK:case x.META:case x.NOFRAMES:case x.STYLE:{bs(e,t);break}case x.NOSCRIPT:{e._err(t,se.nestedNoscriptInHead);break}default:ru(e,t)}}function mX(e,t){switch(t.tagID){case x.NOSCRIPT:{e.openElements.pop(),e.insertionMode=z.IN_HEAD;break}case x.BR:{ru(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function ru(e,t){const n=t.type===nt.EOF?se.openElementsLeftAfterEof:se.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=z.IN_HEAD,e._processToken(t)}function gX(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BODY:{e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=z.IN_BODY;break}case x.FRAMESET:{e._insertElement(t,fe.HTML),e.insertionMode=z.IN_FRAMESET;break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{e._err(t,se.abandonedHeadElementChild),e.openElements.push(e.headElement,x.HEAD),bs(e,t),e.openElements.remove(e.headElement);break}case x.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:su(e,t)}}function yX(e,t){switch(t.tagID){case x.BODY:case x.HTML:case x.BR:{su(e,t);break}case x.TEMPLATE:{so(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function su(e,t){e._insertFakeElement(Q.BODY,x.BODY),e.insertionMode=z.IN_BODY,vm(e,t)}function vm(e,t){switch(t.type){case nt.CHARACTER:{wL(e,t);break}case nt.WHITESPACE_CHARACTER:{xL(e,t);break}case nt.COMMENT:{_1(e,t);break}case nt.START_TAG:{Jn(e,t);break}case nt.END_TAG:{_m(e,t);break}case nt.EOF:{NL(e,t);break}}}function xL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function wL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function bX(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function EX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function xX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_FRAMESET)}function wX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML)}function vX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&v1.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,fe.HTML)}function _X(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function TX(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),n||(e.formElement=e.openElements.current))}function NX(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===x.LI&&s===x.LI||(n===x.DD||n===x.DT)&&(s===x.DD||s===x.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==x.ADDRESS&&s!==x.DIV&&s!==x.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML)}function kX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.tokenizer.state=fn.PLAINTEXT}function SX(e,t){e.openElements.hasInScope(x.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.framesetOk=!1}function AX(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Q.A);n&&(ax(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function CX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function IX(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(x.NOBR)&&(ax(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function RX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function OX(e,t){e.treeAdapter.getDocumentMode(e.document)!==zr.QUIRKS&&e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=z.IN_TABLE}function vL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,fe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function _L(e){const t=dL(e,La.TYPE);return t!=null&&t.toLowerCase()===XG}function LX(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,fe.HTML),_L(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function MX(e,t){e._appendElement(t,fe.HTML),t.ackSelfClosing=!0}function DX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._appendElement(t,fe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function PX(e,t){t.tagName=Q.IMG,t.tagID=x.IMG,vL(e,t)}function jX(e,t){e._insertElement(t,fe.HTML),e.skipNextNewLine=!0,e.tokenizer.state=fn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=z.TEXT}function BX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,fn.RAWTEXT)}function FX(e,t){e.framesetOk=!1,e._switchToTextParsing(t,fn.RAWTEXT)}function vN(e,t){e._switchToTextParsing(t,fn.RAWTEXT)}function UX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===z.IN_TABLE||e.insertionMode===z.IN_CAPTION||e.insertionMode===z.IN_TABLE_BODY||e.insertionMode===z.IN_ROW||e.insertionMode===z.IN_CELL?z.IN_SELECT_IN_TABLE:z.IN_SELECT}function $X(e,t){e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML)}function HX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,fe.HTML)}function zX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(x.RTC),e._insertElement(t,fe.HTML)}function VX(e,t){e._reconstructActiveFormattingElements(),yL(t),ix(t),t.selfClosing?e._appendElement(t,fe.MATHML):e._insertElement(t,fe.MATHML),t.ackSelfClosing=!0}function KX(e,t){e._reconstructActiveFormattingElements(),bL(t),ix(t),t.selfClosing?e._appendElement(t,fe.SVG):e._insertElement(t,fe.SVG),t.ackSelfClosing=!0}function _N(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML)}function Jn(e,t){switch(t.tagID){case x.I:case x.S:case x.B:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.SMALL:case x.STRIKE:case x.STRONG:{CX(e,t);break}case x.A:{AX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{vX(e,t);break}case x.P:case x.DL:case x.OL:case x.UL:case x.DIV:case x.DIR:case x.NAV:case x.MAIN:case x.MENU:case x.ASIDE:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.DETAILS:case x.ADDRESS:case x.ARTICLE:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{wX(e,t);break}case x.LI:case x.DD:case x.DT:{NX(e,t);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{vL(e,t);break}case x.HR:{DX(e,t);break}case x.RB:case x.RTC:{HX(e,t);break}case x.RT:case x.RP:{zX(e,t);break}case x.PRE:case x.LISTING:{_X(e,t);break}case x.XMP:{BX(e,t);break}case x.SVG:{KX(e,t);break}case x.HTML:{bX(e,t);break}case x.BASE:case x.LINK:case x.META:case x.STYLE:case x.TITLE:case x.SCRIPT:case x.BGSOUND:case x.BASEFONT:case x.TEMPLATE:{bs(e,t);break}case x.BODY:{EX(e,t);break}case x.FORM:{TX(e,t);break}case x.NOBR:{IX(e,t);break}case x.MATH:{VX(e,t);break}case x.TABLE:{OX(e,t);break}case x.INPUT:{LX(e,t);break}case x.PARAM:case x.TRACK:case x.SOURCE:{MX(e,t);break}case x.IMAGE:{PX(e,t);break}case x.BUTTON:{SX(e,t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{RX(e,t);break}case x.IFRAME:{FX(e,t);break}case x.SELECT:{UX(e,t);break}case x.OPTION:case x.OPTGROUP:{$X(e,t);break}case x.NOEMBED:case x.NOFRAMES:{vN(e,t);break}case x.FRAMESET:{xX(e,t);break}case x.TEXTAREA:{jX(e,t);break}case x.NOSCRIPT:{e.options.scriptingEnabled?vN(e,t):_N(e,t);break}case x.PLAINTEXT:{kX(e,t);break}case x.COL:case x.TH:case x.TD:case x.TR:case x.HEAD:case x.FRAME:case x.TBODY:case x.TFOOT:case x.THEAD:case x.CAPTION:case x.COLGROUP:break;default:_N(e,t)}}function YX(e,t){if(e.openElements.hasInScope(x.BODY)&&(e.insertionMode=z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function WX(e,t){e.openElements.hasInScope(x.BODY)&&(e.insertionMode=z.AFTER_BODY,LL(e,t))}function qX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function GX(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(x.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(x.FORM):n&&e.openElements.remove(n))}function XX(e){e.openElements.hasInButtonScope(x.P)||e._insertFakeElement(Q.P,x.P),e._closePElement()}function QX(e){e.openElements.hasInListItemScope(x.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(x.LI),e.openElements.popUntilTagNamePopped(x.LI))}function ZX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function JX(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function eQ(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function tQ(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Q.BR,x.BR),e.openElements.pop(),e.framesetOk=!1}function TL(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const i=e.openElements.items[s],a=e.openElements.tagIDs[s];if(r===a&&(r!==x.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,a))break}}function _m(e,t){switch(t.tagID){case x.A:case x.B:case x.I:case x.S:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.NOBR:case x.SMALL:case x.STRIKE:case x.STRONG:{ax(e,t);break}case x.P:{XX(e);break}case x.DL:case x.UL:case x.OL:case x.DIR:case x.DIV:case x.NAV:case x.PRE:case x.MAIN:case x.MENU:case x.ASIDE:case x.BUTTON:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.ADDRESS:case x.ARTICLE:case x.DETAILS:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.LISTING:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{qX(e,t);break}case x.LI:{QX(e);break}case x.DD:case x.DT:{ZX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{JX(e);break}case x.BR:{tQ(e);break}case x.BODY:{YX(e,t);break}case x.HTML:{WX(e,t);break}case x.FORM:{GX(e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{eQ(e,t);break}case x.TEMPLATE:{so(e,t);break}default:TL(e,t)}}function NL(e,t){e.tmplInsertionModeStack.length>0?OL(e,t):ox(e,t)}function nQ(e,t){var n;t.tagID===x.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function rQ(e,t){e._err(t,se.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function o0(e,t){if(e.openElements.currentTagId!==void 0&&EL.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=z.IN_TABLE_TEXT,t.type){case nt.CHARACTER:{SL(e,t);break}case nt.WHITESPACE_CHARACTER:{kL(e,t);break}}else wd(e,t)}function sQ(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_CAPTION}function iQ(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_COLUMN_GROUP}function aQ(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.COLGROUP,x.COLGROUP),e.insertionMode=z.IN_COLUMN_GROUP,lx(e,t)}function oQ(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_TABLE_BODY}function lQ(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.TBODY,x.TBODY),e.insertionMode=z.IN_TABLE_BODY,Tm(e,t)}function cQ(e,t){e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function uQ(e,t){_L(t)?e._appendElement(t,fe.HTML):wd(e,t),t.ackSelfClosing=!0}function dQ(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,fe.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function El(e,t){switch(t.tagID){case x.TD:case x.TH:case x.TR:{lQ(e,t);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{bs(e,t);break}case x.COL:{aQ(e,t);break}case x.FORM:{dQ(e,t);break}case x.TABLE:{cQ(e,t);break}case x.TBODY:case x.TFOOT:case x.THEAD:{oQ(e,t);break}case x.INPUT:{uQ(e,t);break}case x.CAPTION:{sQ(e,t);break}case x.COLGROUP:{iQ(e,t);break}default:wd(e,t)}}function $u(e,t){switch(t.tagID){case x.TABLE:{e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode());break}case x.TEMPLATE:{so(e,t);break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:wd(e,t)}}function wd(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,vm(e,t),e.fosterParentingEnabled=n}function kL(e,t){e.pendingCharacterTokens.push(t)}function SL(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function gc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===x.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===x.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop();break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop();break}case x.SELECT:{e.openElements.hasInSelectScope(x.SELECT)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode());break}case x.TEMPLATE:{so(e,t);break}}}function yQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e._processStartTag(t)):IL(e,t)}function bQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e.onEndTag(t)):RL(e,t)}function EQ(e,t){switch(t.tagID){case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{bs(e,t);break}case x.CAPTION:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{e.tmplInsertionModeStack[0]=z.IN_TABLE,e.insertionMode=z.IN_TABLE,El(e,t);break}case x.COL:{e.tmplInsertionModeStack[0]=z.IN_COLUMN_GROUP,e.insertionMode=z.IN_COLUMN_GROUP,lx(e,t);break}case x.TR:{e.tmplInsertionModeStack[0]=z.IN_TABLE_BODY,e.insertionMode=z.IN_TABLE_BODY,Tm(e,t);break}case x.TD:case x.TH:{e.tmplInsertionModeStack[0]=z.IN_ROW,e.insertionMode=z.IN_ROW,Nm(e,t);break}default:e.tmplInsertionModeStack[0]=z.IN_BODY,e.insertionMode=z.IN_BODY,Jn(e,t)}}function xQ(e,t){t.tagID===x.TEMPLATE&&so(e,t)}function OL(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ox(e,t)}function wQ(e,t){t.tagID===x.HTML?Jn(e,t):wp(e,t)}function LL(e,t){var n;if(t.tagID===x.HTML){if(e.fragmentContext||(e.insertionMode=z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===x.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else wp(e,t)}function wp(e,t){e.insertionMode=z.IN_BODY,vm(e,t)}function vQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.FRAMESET:{e._insertElement(t,fe.HTML);break}case x.FRAME:{e._appendElement(t,fe.HTML),t.ackSelfClosing=!0;break}case x.NOFRAMES:{bs(e,t);break}}}function _Q(e,t){t.tagID===x.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==x.FRAMESET&&(e.insertionMode=z.AFTER_FRAMESET))}function TQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.NOFRAMES:{bs(e,t);break}}}function NQ(e,t){t.tagID===x.HTML&&(e.insertionMode=z.AFTER_AFTER_FRAMESET)}function kQ(e,t){t.tagID===x.HTML?Jn(e,t):mh(e,t)}function mh(e,t){e.insertionMode=z.IN_BODY,vm(e,t)}function SQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.NOFRAMES:{bs(e,t);break}}}function AQ(e,t){t.chars=Yt,e._insertCharacters(t)}function CQ(e,t){e._insertCharacters(t),e.framesetOk=!1}function ML(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==fe.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function IQ(e,t){if(KG(t))ML(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===fe.MATHML?yL(t):r===fe.SVG&&(YG(t),bL(t)),ix(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function RQ(e,t){if(t.tagID===x.P||t.tagID===x.BR){ML(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===fe.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}Q.AREA,Q.BASE,Q.BASEFONT,Q.BGSOUND,Q.BR,Q.COL,Q.EMBED,Q.FRAME,Q.HR,Q.IMG,Q.INPUT,Q.KEYGEN,Q.LINK,Q.META,Q.PARAM,Q.SOURCE,Q.TRACK,Q.WBR;const OQ=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,LQ=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),TN={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function DL(e,t){const n=zQ(e),r=XR("type",{handlers:{root:MQ,element:DQ,text:PQ,comment:jL,doctype:jQ,raw:FQ},unknown:UQ}),s={parser:n?new wN(TN):wN.getFragmentParser(void 0,TN),handle(o){r(o,s)},stitches:!1,options:t||{}};r(e,s),Vl(s,Fs());const i=n?s.parser.document:s.parser.getFragment(),a=Vq(i,{file:s.options.file});return s.stitches&&Ed(a,"comment",function(o,l,u){const d=o;if(d.value.stitch&&u&&l!==void 0){const f=u.children;return f[l]=d.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function PL(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:nt.CHARACTER,chars:e.value,location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function jQ(e,t){const n={type:nt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function BQ(e,t){t.stitches=!0;const n=VQ(e);if("children"in e&&"children"in n){const r=DL({type:"root",children:e.children},t.options);n.children=r.children}jL({type:"comment",value:{stitch:n}},t)}function jL(e,t){const n=e.value,r={type:nt.COMMENT,data:n,location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function FQ(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,BL(t,Fs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(OQ,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function UQ(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))BQ(n,t);else{let r="";throw LQ.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Vl(e,t){BL(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=fn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function BL(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function $Q(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===fn.PLAINTEXT)return;Vl(t,Fs(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Ta.html;s===Ta.html&&n==="svg"&&(s=Ta.svg);const i=Gq({...e,children:[]},{space:s===Ta.svg?"svg":"html"}),a={type:nt.START_TAG,tagName:n,tagID:zl(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:vd(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function HQ(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&rG.includes(n)||t.parser.tokenizer.state===fn.PLAINTEXT)return;Vl(t,gm(e));const r={type:nt.END_TAG,tagName:n,tagID:zl(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:vd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===fn.RCDATA||t.parser.tokenizer.state===fn.RAWTEXT||t.parser.tokenizer.state===fn.SCRIPT_DATA)&&(t.parser.tokenizer.state=fn.DATA)}function zQ(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function vd(e){const t=Fs(e)||{line:void 0,column:void 0,offset:void 0},n=gm(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function VQ(e){return"children"in e?yl({...e,children:[]}):yl(e)}function KQ(e){return function(t,n){return DL(t,{...e,file:n})}}const FL=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function UL(e){if(!e)return!1;try{const t=e.toLowerCase();return FL.some(n=>t.includes(n))}catch{return!1}}function YQ(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(UL(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const s=n.map(i=>(i==null?void 0:i.value)||"").join("").toLowerCase();return FL.some(i=>s.includes(i))}return!1}function WQ({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=v.useState(null),i=(l,u)=>{if(l.src)return l.src;if(u){const d=h=>{var p;if(!h)return null;if(h.type==="source"&&((p=h.properties)!=null&&p.src))return h.properties.src;if(h.children)for(const m of h.children){const y=d(m);if(y)return y}return null},f=d({children:u});if(f)return f}return""},a=l=>{try{const d=new URL(l).pathname.split("/");return d[d.length-1]||"video.mp4"}catch{return"video.mp4"}},o=l=>l?Array.isArray(l)?l.map(u=>(u==null?void 0:u.value)||"").join("")||"video":(l==null?void 0:l.value)||"video":"video";return c.jsxs("div",{className:t?`md ${t}`:"md",children:[c.jsx(Xz,{remarkPlugins:[cY],rehypePlugins:n?[KQ,oN]:[oN],components:{a:({node:l,...u})=>{const d=u.href;if(d&&(UL(d)||YQ(l))){const f=d,h=o(l==null?void 0:l.children);return c.jsxs("div",{className:"video-container",children:[c.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[c.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),c.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]}),c.jsx("div",{className:"video-caption",children:c.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return c.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:l,src:u,alt:d,...f})=>{const h=c.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?c.jsx(yI,{src:u,children:c.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,c.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]})}):h},video:({node:l,src:u,children:d,...f})=>{const h=i({src:u},d);return h?c.jsx("div",{className:"video-container",children:c.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[c.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),c.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]})}):c.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&c.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:c.jsxs("div",{className:"video-viewer",onClick:l=>l.stopPropagation(),children:[c.jsxs("div",{className:"video-viewer-header",children:[c.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),c.jsxs("nav",{className:"video-viewer-nav",children:[c.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:c.jsx(NE,{})}),c.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:c.jsx(Xr,{})})]})]}),c.jsx("div",{className:"video-viewer-body",children:c.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const _d=v.memo(WQ),NN=6,kN=7,qQ={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function N1(e){return qQ[(e||"").trim().toLowerCase()]||"未知"}function SN(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)?"is-positive":["creating","pending","running","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function GQ(e){if(!e)return"";const t=e.trim(),n=Number(t),r=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function XQ(e){const t=e.replace(/\r\n/g,` `);if(!t.startsWith(`--- `))return e;const n=t.indexOf(` --- -`,4);return n>=0?t.slice(n+5).trimStart():e}function GQ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M5.25 7.5h5.25v5.25H5.25zM13.5 7.5h5.25v5.25H13.5zM9.38 15.75h5.24v3H9.38z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M7.88 12.75v1.5c0 .83.67 1.5 1.5 1.5h5.24c.83 0 1.5-.67 1.5-1.5v-1.5M12 4.75V7.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("circle",{cx:"12",cy:"4.75",r:"1",fill:"currentColor"})]})}function XQ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("path",{d:"m17.85 13.85.42 1.13 1.13.42-1.13.42-.42 1.13-.42-1.13-1.13-.42 1.13-.42z",fill:"currentColor"})]})}function QQ(){return c.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:c.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Ak({direction:e}){return c.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:c.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function k1(){return c.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function Ck({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return c.jsxs("footer",{className:"skillcenter-pager",children:[c.jsxs("span",{children:["共 ",t," 项"]}),c.jsxs("div",{className:"skillcenter-pager-actions",children:[c.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:c.jsx(Ak,{direction:"left"})}),c.jsxs("span",{children:[e," / ",s]}),c.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:c.jsx(Ak,{direction:"right"})})]})]})}function ph({children:e}){return c.jsx("div",{className:"skillcenter-empty",children:e})}function ZQ({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return v.useEffect(()=>{const o=l=>{l.key==="Escape"&&a()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a]),c.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:c.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:o=>o.stopPropagation(),children:[c.jsxs("header",{className:"skill-detail-head",children:[c.jsxs("div",{className:"skill-detail-heading",children:[c.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:c.jsx(XQ,{})}),c.jsxs("div",{children:[c.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),c.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),c.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:c.jsx(QQ,{})})]}),c.jsxs("dl",{className:"skill-detail-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"技能 ID"}),c.jsx("dd",{title:e.skillId,children:e.skillId})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"版本"}),c.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"状态"}),c.jsx("dd",{children:T1(e.skillStatus)})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"技能空间"}),c.jsx("dd",{title:t.name,children:t.name})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Project"}),c.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"地域"}),c.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),c.jsxs("div",{className:"skill-detail-content",children:[c.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?c.jsxs("div",{className:"skillcenter-loading",children:[c.jsx(k1,{}),"正在读取技能内容…"]}):i?c.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?c.jsx(wd,{text:qQ(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):c.jsx(ph,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function JQ({onClick:e}){return c.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"技能中心",title:"技能中心",children:[c.jsx(GQ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"技能中心"})]})}function eZ(){const[e,t]=v.useState("cn-beijing"),[n,r]=v.useState([]),[s,i]=v.useState(1),[a,o]=v.useState(0),[l,u]=v.useState(!1),[d,f]=v.useState(""),[h,p]=v.useState(null),[m,b]=v.useState([]),[w,g]=v.useState(1),[E,y]=v.useState(0),[_,k]=v.useState(!1),[T,C]=v.useState(""),[N,R]=v.useState(null),[I,M]=v.useState(null),[B,Y]=v.useState(!1),[P,U]=v.useState(""),A=v.useRef(0);v.useEffect(()=>{let H=!0;return u(!0),f(""),fU({region:e,page:s,pageSize:kk}).then(V=>{if(!H)return;const D=V.items||[];r(D),o(V.totalCount||0),p(ne=>D.find(J=>J.id===(ne==null?void 0:ne.id))||null)}).catch(V=>{H&&(r([]),o(0),p(null),f(V instanceof Error?V.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{H&&u(!1)}),()=>{H=!1}},[e,s]),v.useEffect(()=>{if(!h){b([]),y(0);return}let H=!0;return k(!0),C(""),pU(h.id,{region:e,page:w,pageSize:Nk,project:h.projectName}).then(V=>{H&&(b(V.items||[]),y(V.totalCount||0))}).catch(V=>{H&&(b([]),y(0),C(V instanceof Error?V.message:"读取技能失败,请稍后重试"))}).finally(()=>{H&&k(!1)}),()=>{H=!1}},[e,h,w]);const L=H=>{H!==e&&(j(),t(H),i(1),g(1),p(null),b([]))},O=H=>{j(),p(H),g(1)},j=()=>{A.current+=1,R(null),M(null),U(""),Y(!1)},S=async H=>{if(!h)return;const V=A.current+1;A.current=V,R(H),M(null),U(""),Y(!0);try{const D=await mU(h.id,H.skillId,H.version,e,h.projectName);A.current===V&&M(D)}catch(D){A.current===V&&U(D instanceof Error?D.message:"读取技能详情失败,请稍后重试")}finally{A.current===V&&Y(!1)}};return c.jsxs("section",{className:"skillcenter",children:[c.jsxs("div",{className:"skillcenter-browser",children:[c.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[c.jsxs("header",{className:"skillcenter-panel-head",children:[c.jsxs("div",{children:[c.jsx("h2",{children:"技能空间"}),c.jsx("span",{className:"skillcenter-count-badge",children:a})]}),c.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[c.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>L("cn-beijing"),children:"北京"}),c.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>L("cn-shanghai"),children:"上海"})]})]}),c.jsxs("div",{className:"skillcenter-listwrap",children:[l&&c.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[c.jsx(k1,{}),"正在读取技能空间…"]}),d?c.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!l?c.jsx(ph,{children:"当前地域暂无可访问的技能空间"}):c.jsx("div",{className:"skillcenter-list",children:n.map(H=>c.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===H.id?"active":""}`,onClick:()=>O(H),children:c.jsxs("span",{className:"skillcenter-item-body",children:[c.jsx("span",{className:"skillcenter-item-title",title:H.name,children:H.name}),c.jsx("span",{className:"skillcenter-item-description",children:H.description||"暂无描述"}),c.jsxs("span",{className:"skillcenter-item-meta",children:[c.jsx("span",{className:`skillcenter-status ${Sk(H.status)}`,children:T1(H.status)}),c.jsxs("span",{className:"skillcenter-meta-text",title:H.projectName||"default",children:["Project · ",H.projectName||"default"]}),c.jsxs("span",{className:"skillcenter-meta-text",children:[H.skillCount??0," 个技能"]}),H.updatedAt&&c.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",WQ(H.updatedAt)]})]})]})},`${H.projectName||"default"}:${H.id}`))})]}),c.jsx(Ck,{page:s,total:a,pageSize:kk,onPage:i})]}),c.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"skillcenter-panel-head",children:[c.jsx("div",{children:c.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),c.jsx("span",{children:E})]}),c.jsxs("div",{className:"skillcenter-listwrap",children:[_&&c.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[c.jsx(k1,{}),"正在读取技能…"]}),T?c.jsx("div",{className:"skillcenter-error",children:T}):m.length===0&&!_?c.jsx(ph,{children:"这个空间中暂无技能"}):c.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(H=>c.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void S(H),children:c.jsxs("span",{className:"skillcenter-item-body",children:[c.jsx("span",{className:"skillcenter-item-title",title:H.skillName,children:H.skillName}),c.jsx("span",{className:"skillcenter-item-description",children:H.skillDescription||"暂无描述"}),c.jsxs("span",{className:"skillcenter-item-meta",children:[c.jsx("span",{className:`skillcenter-status ${Sk(H.skillStatus)}`,children:T1(H.skillStatus)}),c.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",H.version||"—"]})]})]})},`${H.skillId}:${H.version}`))})]}),c.jsx(Ck,{page:w,total:E,pageSize:Nk,onPage:g})]}):c.jsx(ph,{children:"点击 Skill 空间以查看详情"})})]}),N&&h&&c.jsx(ZQ,{skill:N,space:h,region:e,detail:I,loading:B,error:P,onClose:j})]})}const tZ=50,Ik=48;function nZ(e){return(e.events??[]).flatMap(t=>{var s,i;const r=(((s=t.content)==null?void 0:s.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return r?[{text:r,role:t.author??((i=t.content)==null?void 0:i.role)??"",ts:t.timestamp}]:[]})}function rZ(e){var t,n;for(const r of e.events??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const s=(((n=r.content)==null?void 0:n.parts)??[]).map(i=>i.text).find(Boolean);if(s)return s}return"未命名会话"}function sZ(e,t,n){const r=Math.max(0,t-Ik),s=Math.min(e.length,t+n+Ik);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var l;if((l=o.events)!=null&&l.length)return o;try{return await cp(t,e,o.id)}catch{return o}})),a=[];for(const o of i)for(const{text:l,role:u,ts:d}of nZ(o)){const f=l.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:o.id,title:rZ(o),snippet:sZ(l,f,r.length),role:u,ts:d??o.lastUpdateTime});break}}return a.sort((o,l)=>(l.ts??0)-(o.ts??0)),a.slice(0,tZ)}async function aZ(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await qI(e,t.trim())}catch(a){const o=String(a);return{results:[],note:o.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${o}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,o)=>({type:"web",index:o,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function oZ(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await WI(t,e,r.trim(),n);if(!s.mounted)return{results:[],note:e==="knowledge"?"该 Agent 未挂载知识库。":"该 Agent 未挂载长期记忆。"};if(s.error)return{results:[],note:s.error};const i=s.sourceName??(e==="knowledge"?"知识库":"长期记忆");return{results:s.results.map((a,o)=>e==="knowledge"?{type:"knowledge",index:o,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:o,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function lZ(e,t,n){return e==="session"?{results:await iZ(n.userId,n.appId,t)}:e==="web"?aZ(n.appId,t):oZ(e,n.appId,n.userId,t)}function UL({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),c.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function cZ({open:e}){return c.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function uZ({onClick:e}){return c.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"智能搜索",title:"智能搜索",children:[c.jsx(UL,{}),c.jsx("span",{className:"sidebar-nav-label",children:"智能搜索"})]})}function dZ(e,t,n){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),i=a=>r?n?"正在检测 Agent 能力":`当前 Agent 未挂载${a}`:"请选择 Agent";return[{id:"session",label:"会话",ready:r,unavailableLabel:"请选择 Agent"},{id:"web",label:"网络",ready:r&&s.has("web"),description:"通过 web_search 工具检索",unavailableLabel:i(" web_search 工具")},{id:"knowledge",label:"知识库",ready:r&&s.has("knowledge"),unavailableLabel:i("知识库")},{id:"memory",label:"长期记忆",ready:r&&s.has("memory"),unavailableLabel:i("长期记忆")}]}function xp(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function Rk(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function fZ({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var U,A;const[a,o]=v.useState("session"),[l,u]=v.useState(""),[d,f]=v.useState([]),[h,p]=v.useState(),[m,b]=v.useState(!1),[w,g]=v.useState(!1),[E,y]=v.useState(!1),_=v.useRef(0),k=v.useRef(null),T=dZ(t,n,r),C=T.find(L=>L.id===a),N=a==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(L=>L.source==="knowledgebase"||L.kind==="knowledgebase"):a==="memory"?(A=n==null?void 0:n.components)==null?void 0:A.find(L=>L.source==="long_term_memory"||L.kind==="memory"):void 0;v.useEffect(()=>{_.current+=1,o("session"),f([]),p(void 0),g(!1),b(!1),y(!1)},[t]),v.useEffect(()=>{if(!E)return;function L(O){var j;(j=k.current)!=null&&j.contains(O.target)||y(!1)}return document.addEventListener("pointerdown",L),()=>document.removeEventListener("pointerdown",L)},[E]);async function R(L,O){var V;const j=L.trim();if(!j||!((V=T.find(D=>D.id===O))!=null&&V.ready))return;const S=++_.current;b(!0),g(!0);let H;try{H=await lZ(O,j,{userId:e,appId:t})}catch(D){const ne=D instanceof Error?D.message:String(D);H={results:[],note:`搜索失败:${ne}`}}S===_.current&&(f(H.results),p(H.note),b(!1))}function I(L){_.current+=1,u(L),f([]),p(void 0),g(!1),b(!1)}function M(L){_.current+=1,o(L),y(!1),f([]),p(void 0),g(!1),b(!1)}const B=!!(C!=null&&C.ready),Y=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(N==null?void 0:N.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(N==null?void 0:N.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",P=N!=null&&N.backend?xp(N.backend):"";return c.jsxs("div",{className:"search",children:[c.jsxs("div",{className:"search-box",children:[c.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[c.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(C==null?void 0:C.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":E,onClick:()=>y(L=>!L),children:[c.jsx("span",{children:(C==null?void 0:C.label)??"搜索类型"}),P&&c.jsx("small",{children:P}),c.jsx(cZ,{open:E})]}),E&&c.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:T.map(L=>{var S,H;const O=L.id==="knowledge"?(S=n==null?void 0:n.components)==null?void 0:S.find(V=>V.source==="knowledgebase"||V.kind==="knowledgebase"):L.id==="memory"?(H=n==null?void 0:n.components)==null?void 0:H.find(V=>V.source==="long_term_memory"||V.kind==="memory"):void 0,j=O?[O.name,O.backend?xp(O.backend):""].filter(Boolean).join(" · "):L.ready?L.description:L.unavailableLabel;return c.jsxs("button",{type:"button",role:"option","aria-selected":a===L.id,disabled:!L.ready,onClick:()=>M(L.id),children:[c.jsx("span",{children:L.label}),j&&c.jsx("small",{children:j})]},L.id)})})]}),c.jsx("span",{className:"search-box-divider","aria-hidden":!0}),c.jsx("input",{className:"search-input",value:l,onChange:L=>I(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),R(l,a))},placeholder:Y,disabled:!B,autoFocus:!0}),c.jsx("button",{className:"search-go",onClick:()=>void R(l,a),disabled:!l.trim()||m,"aria-label":"搜索",children:m?c.jsx(wt,{className:"icon spin"}):c.jsx(UL,{className:"icon"})})]}),c.jsx("div",{className:"search-results",children:B?w?m?null:h?c.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?c.jsxs("div",{className:"search-empty",children:["未找到匹配「",l.trim(),"」的结果。"]}):d.map((L,O)=>c.jsx(hZ,{result:L,agentLabel:s,onOpen:i},O)):c.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):c.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(C==null?void 0:C.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function hZ({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return c.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[c.jsx(OI,{className:"search-result-icon"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsx("span",{className:"search-result-title",children:e.title}),c.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Rk(e.ts)}`:""]})]}),c.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return c.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[c.jsx(lm,{className:"search-result-icon"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsx("span",{className:"search-result-title",children:e.title||e.url}),c.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&c.jsx(kE,{className:"search-result-ext"})]})]}),e.summary&&c.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return c.jsxs("div",{className:"search-result search-result-static",children:[c.jsx(Ok,{source:"knowledge"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),c.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${xp(e.sourceType)}`:""]})]}),c.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return c.jsxs("div",{className:"search-result search-result-static",children:[c.jsx(Ok,{source:"memory"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),c.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${xp(e.sourceType)}`:"",e.ts?` · ${Rk(e.ts)}`:""]})]}),c.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function Ok({source:e,className:t="search-result-icon"}){return e==="knowledge"?c.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),c.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):c.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),c.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}const $L="veadk_agentkit_connections";function Gs(){try{const e=localStorage.getItem($L);return e?JSON.parse(e):[]}catch{return[]}}function Tm(e){try{localStorage.setItem($L,JSON.stringify(e))}catch{}}function Va(e,t){return`agentkit:${e}:${t}`}function HL(e){try{return new URL(e).host}catch{return e}}function zl(e){FI();for(const t of e)for(const n of t.apps)BI(Va(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function zL(e,t,n,r,s){const i={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s},a=[...Gs().filter(o=>o.runtimeId!==e),i];return Tm(a),zl(a),i}async function cx(e,t,n){let r;try{r=await eR(e,n)}catch(a){throw a instanceof ud&&N1(e),a}if(!r||r.length===0)throw N1(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const s=Object.fromEntries(r.map(a=>[a,t])),i=zL(e,t,n,r,s);return Va(i.id,r[0])}async function VL(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await dm(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||HL(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},o=[...Gs().filter(l=>l.base!==s),a];return Tm(o),zl(o),a}function pZ(e){const t=Gs().filter(n=>n.id!==e);return Tm(t),zl(t),t}function N1(e){const t=Gs().filter(n=>n.runtimeId!==e);return Tm(t),zl(t),t}function KL(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var o;const a=((o=s.appLabels)==null?void 0:o[i])??i;return{id:Va(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:HL(s.base??"")}}));return[...n,...r]}const Lk=Object.freeze(Object.defineProperty({__proto__:null,addConnection:VL,addRuntimeConnection:zL,buildAgentEntries:KL,connectRuntime:cx,loadConnections:Gs,registerConnections:zl,remoteAppId:Va,removeConnection:pZ,removeRuntimeConnection:N1},Symbol.toStringTag,{value:"Module"}));function Uu({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),c.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),c.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),c.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),c.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),c.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),c.jsx("path",{d:"m12 7.55 1.28 3.17L16.45 12l-3.17 1.28L12 16.45l-1.28-3.17L7.55 12l3.17-1.28L12 7.55Z",fill:"currentColor",stroke:"none"})]})}function mZ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),c.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),c.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),c.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function gZ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m4.7 7.2 7.3-3 7.3 3-7.3 3.1Z"}),c.jsx("path",{d:"M7.2 9.2v4.2c0 1.7 2.15 3.05 4.8 3.05s4.8-1.35 4.8-3.05V9.2"}),c.jsx("path",{d:"M19.3 7.2v5.25"}),c.jsx("circle",{cx:"19.3",cy:"14.4",r:"1.15",fill:"currentColor",stroke:"none"})]})}function YL({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),c.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),c.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),c.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),c.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const Mk=15,yZ=1e4,bZ=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function EZ(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function WL(e){const t=e.toLowerCase();return t.includes("invalidagentkitruntime.notfound")||t.includes("specified agentkitruntime does not exist")?"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。":t.includes("accessdenied")||t.includes("forbidden")||t.includes("permission")||t.includes("(401)")||t.includes("(403)")?"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。":t.includes("agent-info failed: 404")||t.includes("读取 agent 列表失败 (404)")?"该 Agent Server 版本暂不支持信息预览。":"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。"}function o0(e,t=yZ){return new Promise((n,r)=>{const s=setTimeout(()=>r(new Error("加载超时,请重试")),t);e.then(i=>{clearTimeout(s),n(i)},i=>{clearTimeout(s),r(i)})})}function xZ({open:e,onClose:t,anchorTop:n=0,agentsSource:r,localApps:s,currentId:i,currentRuntime:a,runtimeScope:o,onSelect:l}){const[u,d]=v.useState([]),[f,h]=v.useState([""]),[p,m]=v.useState(0),[b,w]=v.useState(o==="mine"),[g,E]=v.useState(null),[y,_]=v.useState("cn-beijing"),[k,T]=v.useState(!1),[C,N]=v.useState(""),[R,I]=v.useState(""),[M,B]=v.useState(null),[Y,P]=v.useState(new Set),[U,A]=v.useState(),[L,O]=v.useState("agent"),j=v.useRef(!1);function S(W){A(ae=>(ae==null?void 0:ae.runtimeId)===W.runtimeId?void 0:{runtimeId:W.runtimeId,name:W.name,region:W.region})}const H=v.useCallback(async W=>{if(u[W]){m(W);return}const ae=f[W];if(ae!==void 0){T(!0),N("");try{const he=await o0(ch({nextToken:ae,pageSize:Mk,region:y,scope:"all"}));d(Z=>{const ce=[...Z];return ce[W]=he.runtimes,ce}),h(Z=>{const ce=[...Z];return he.nextToken&&(ce[W+1]=he.nextToken),ce}),m(W)}catch(he){N(he instanceof Error?he.message:String(he))}finally{T(!1)}}},[f,u,y]),V=v.useCallback(async()=>{T(!0),N("");try{const W=[];let ae="";do{const he=await o0(ch({scope:"mine",nextToken:ae,pageSize:100,region:y}));W.push(...he.runtimes),ae=he.nextToken}while(ae&&W.length<2e3);E(W)}catch(W){N(W instanceof Error?W.message:String(W))}finally{T(!1)}},[y]);v.useEffect(()=>{w(o==="mine"),d([]),h([""]),m(0),E(null),j.current=!1},[o]),v.useEffect(()=>{e&&r==="cloud"&&!b&&!j.current&&(j.current=!0,H(0))},[e,r,b,H]),v.useEffect(()=>{b&&g===null&&r==="cloud"&&V()},[b,g,r,V]),v.useEffect(()=>{e&&(A(void 0),O("agent"))},[e]);function D(){P(new Set),b?(E(null),V()):(d([]),h([""]),m(0),j.current=!0,T(!0),N(""),o0(ch({nextToken:"",pageSize:Mk,region:y,scope:"all"})).then(W=>{d([W.runtimes]),h(W.nextToken?["",W.nextToken]:[""])}).catch(W=>N(W instanceof Error?W.message:String(W))).finally(()=>T(!1)))}function ne(W){W!==y&&(_(W),d([]),h([""]),m(0),E(null),P(new Set),j.current=!1)}const J=!b&&(u[p+1]!==void 0||f[p+1]!==void 0);function re(W){B(W.runtimeId),cx(W.runtimeId,W.name,W.region).then(ae=>{l(ae),t()}).catch(ae=>{if(ae instanceof ud){N(ae.message);return}if(ae instanceof Ru){ae.unsupported&&P(he=>new Set(he).add(W.runtimeId)),N(ae.message);return}P(he=>new Set(he).add(W.runtimeId))}).finally(()=>B(null))}if(!e)return null;const G=(b?g??[]:u[p]??[]).filter(W=>R?W.name.toLowerCase().includes(R.toLowerCase()):!0);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:t}),c.jsxs("div",{className:`agentsel ${U?"has-detail":""}`,role:"dialog","aria-label":"选择 Agent",style:{top:n,height:`min(640px, calc(100dvh - ${n}px - 10px))`},children:[c.jsxs("div",{className:"agentsel-main",children:[c.jsxs("div",{className:"agentsel-head",children:[c.jsxs("span",{className:"agentsel-title",children:[c.jsx(Uu,{})," 选择 Agent"]}),c.jsxs("div",{className:"agentsel-head-actions",children:[r==="cloud"&&c.jsx("button",{className:"agentsel-refresh",onClick:D,title:"刷新",disabled:k,children:c.jsx(SE,{className:`icon ${k?"spin":""}`})}),c.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:c.jsx(Gr,{className:"icon"})})]})]}),r==="local"?c.jsx("div",{className:"agentsel-body",children:s.length===0?c.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):c.jsx("ul",{className:"agentsel-list",children:s.map(W=>c.jsx("li",{children:c.jsxs("button",{className:`agentsel-item ${W===i?"active":""}`,onClick:()=>{l(W),t()},children:[c.jsx(Uu,{}),c.jsx("span",{className:"agentsel-item-name",children:W})]})},W))})}):c.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[c.jsxs("div",{className:"agentsel-tools",children:[c.jsxs("div",{className:"agentsel-search",children:[c.jsx(e1,{className:"icon"}),c.jsx("input",{value:R,onChange:W=>I(W.target.value),placeholder:"搜索 Runtime 名称"})]}),c.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:bZ.map(W=>c.jsx("button",{type:"button",className:y===W.value?"active":"","aria-pressed":y===W.value,onClick:()=>ne(W.value),children:W.label},W.value))}),o==="all"&&c.jsxs("label",{className:"agentsel-mine",children:[c.jsx("input",{type:"checkbox",checked:b,onChange:W=>w(W.target.checked)}),"只看我创建的"]})]}),C&&c.jsx("div",{className:"agentsel-error",children:C}),c.jsxs("div",{className:"agentsel-listwrap",children:[G.length===0&&!k?c.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):c.jsx("ul",{className:"agentsel-list",children:G.map(W=>{const ae=Y.has(W.runtimeId),he=M===W.runtimeId,Z=(a==null?void 0:a.runtimeId)===W.runtimeId,ce=(U==null?void 0:U.runtimeId)===W.runtimeId;return c.jsx("li",{children:c.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${Z?"active":""} ${ce?"is-previewed":""}`,title:W.runtimeId,children:[c.jsx(YL,{}),c.jsxs("div",{className:"agentsel-item-main",children:[c.jsx("span",{className:"agentsel-item-name",title:W.name,children:W.name}),c.jsxs("div",{className:"agentsel-item-meta",children:[c.jsx("span",{className:`agentsel-status is-${ae?"bad":SZ(W.status)}`,children:ae?"不支持":qL(W.status)}),W.isMine&&c.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),c.jsxs("div",{className:"agentsel-item-actions",children:[c.jsx("button",{type:"button",className:"agentsel-connect",disabled:he||Z,onClick:()=>re(W),children:he?"连接中…":Z?"已连接":ae?"重试":"连接"}),c.jsx("button",{type:"button",className:`agentsel-info ${ce?"active":""}`,"aria-label":`查看 ${W.name} 信息`,"aria-pressed":ce,title:"查看信息",onClick:()=>S(W),children:c.jsx(cd,{className:"icon"})})]})]})},W.runtimeId)})}),k&&c.jsxs("div",{className:"agentsel-loading",children:[c.jsx(wt,{className:"icon spin"})," 加载中…"]})]}),c.jsxs("div",{className:"agentsel-pager",children:[c.jsx("button",{disabled:b||p===0||k,onClick:()=>void H(p-1),"aria-label":"上一页",children:c.jsx(aF,{className:"icon"})}),c.jsx("span",{className:"agentsel-pager-label",children:b?1:p+1}),c.jsx("button",{disabled:b||!J||k,onClick:()=>void H(p+1),"aria-label":"下一页",children:c.jsx(or,{className:"icon"})})]})]})]}),r==="cloud"&&U&&c.jsx(TZ,{runtime:U,tab:L,onTabChange:O})]})]})}const wZ={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function vZ(e){return wZ[e.toLowerCase()]??e}function _Z(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function TZ({runtime:e,tab:t,onTabChange:n}){return c.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[c.jsx("div",{className:"agentsel-head agentsel-preview-head",children:c.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[c.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),c.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),c.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),c.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:c.jsx(kZ,{runtime:e})}),c.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:c.jsx(NZ,{runtime:e})})]})}function kZ({runtime:e}){const[t,n]=v.useState(null),[r,s]=v.useState(!0),[i,a]=v.useState(""),o=e.runtimeId,l=e.region;v.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),YI(o,l).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(WL(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[o,l]);const u=(t==null?void 0:t.components)??[];return c.jsx("div",{className:"agentsel-detail-body",children:r?c.jsxs("div",{className:"agentsel-panel-state",children:[c.jsx(wt,{className:"icon spin"})," 读取 Agent 信息…"]}):i?c.jsxs("div",{className:"agentsel-panel-empty",children:[c.jsx("span",{children:"暂时无法读取 Agent 信息"}),c.jsx("small",{title:i,children:i})]}):t?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"agentsel-identity",children:[c.jsx(Uu,{className:"agentsel-identity-icon"}),c.jsxs("div",{className:"agentsel-identity-copy",children:[c.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&c.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsx("h3",{children:"描述"}),c.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&c.jsx(Dk,{icon:c.jsx(LI,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&c.jsx(Dk,{icon:c.jsx(mZ,{}),title:"工具",values:t.tools}),t.skills.length>0&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[c.jsx(gZ,{})," 技能"]}),c.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>c.jsxs("div",{className:"agentsel-info-list-item",children:[c.jsx("strong",{title:d.name,children:d.name}),d.description&&c.jsx("span",{title:d.description,children:d.description})]},d.name))})]}),u.length>0&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[c.jsx(vI,{className:"icon"})," 挂载组件"]}),c.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>c.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[c.jsxs("div",{className:"agentsel-component-head",children:[c.jsx("strong",{title:d.name,children:d.name}),c.jsxs("span",{children:[vZ(d.kind),d.backend?` · ${_Z(d.backend)}`:""]})]}),d.description&&c.jsx("span",{title:d.description,children:d.description})]},`${d.kind}:${d.name}:${f}`))})]}),!t.description&&t.subAgents.length===0&&t.tools.length===0&&t.skills.length===0&&u.length===0&&c.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function Dk({icon:e,title:t,values:n}){return c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[e,t]}),c.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>c.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function NZ({runtime:e}){const[t,n]=v.useState(null),[r,s]=v.useState(!0),[i,a]=v.useState(""),o=e.runtimeId,l=e.region;v.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),ME(o,l).then(f=>d&&n(f)).catch(f=>d&&a(WL(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[o,l]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",qL(t.status)]),t.region&&u.push(["区域",EZ(t.region)]);const d=t.resources,f=[d.cpuMilli!=null?`CPU ${d.cpuMilli}m`:"",d.memoryMb!=null?`内存 ${d.memoryMb}MB`:"",d.minInstance!=null||d.maxInstance!=null?`实例 ${d.minInstance??"?"}~${d.maxInstance??"?"}`:""].filter(Boolean).join(" · ");f&&u.push(["资源",f]),t.currentVersion!=null&&u.push(["版本",String(t.currentVersion)])}return c.jsxs("div",{className:"agentsel-detail-body",children:[c.jsxs("div",{className:"agentsel-runtime-identity",children:[c.jsx(YL,{}),c.jsxs("div",{children:[c.jsx("strong",{title:e.name,children:e.name}),c.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?c.jsxs("div",{className:"agentsel-apps-note",children:[c.jsx(wt,{className:"icon spin"})," 读取详情…"]}):i?c.jsx("div",{className:"agentsel-error",children:i}):t?c.jsxs(c.Fragment,{children:[c.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>c.jsxs("div",{className:"agentsel-kv-row",children:[c.jsx("dt",{children:d}),c.jsx("dd",{children:f})]},d))}),t.envs.length>0&&c.jsxs("div",{className:"agentsel-envs",children:[c.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>c.jsxs("div",{className:"agentsel-env",children:[c.jsx("span",{className:"agentsel-env-k",children:d.key}),c.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function SZ(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}const AZ={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function qL(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return AZ[t]??(e||"-")}const ux="/assets/volcengine-DM14a-L-.svg",Pk="(max-width: 860px)",CZ=54;function IZ(){return c.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M12.5 3 5.5 13h5l-1 8 8-11h-5l.5-7z",fill:"currentColor",stroke:"none"}),c.jsx("path",{d:"M19 4.5v3M17.5 6h3",opacity:"0.85"})]})}function RZ(){return c.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("circle",{cx:"8.25",cy:"7.75",r:"3.15"}),c.jsx("path",{d:"M2.9 19.2c.45-3.45 2.48-5.35 5.35-5.35 2.4 0 4.2 1.28 4.98 3.66"}),c.jsx("path",{d:"M17.4 4.5v15M14.8 9h5.2M14.8 15.3h5.2"}),c.jsx("circle",{cx:"17.4",cy:"9",r:"1.15",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"17.4",cy:"15.3",r:"1.15",fill:"currentColor",stroke:"none"})]})}function OZ(e){let t=2166136261;for(const r of e)t^=r.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const LZ={admin:"管理员",developer:"开发者",user:"普通用户"};function jk({role:e}){const t=LZ[e];return c.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function MZ({access:e,userInfo:t,onLogout:n}){const[r,s]=v.useState(!1),[i,a]=v.useState("");if(!t)return null;const o=QF(t),l=typeof t.email=="string"?t.email:"",u=(o||"U").slice(0,1).toUpperCase(),d=OZ(o||l||u),f=ZF(t),h=f===i?"":f;return c.jsxs("div",{className:"sidebar-user",children:[c.jsxs("button",{className:"sidebar-user-btn",onClick:()=>s(p=>!p),title:l?`${o} -${l}`:o,children:[c.jsxs("span",{className:`account-avatar${h?" has-image":""}`,style:d,children:[u,h?c.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),c.jsxs("span",{className:"sidebar-user-identity",children:[c.jsxs("span",{className:"sidebar-user-primary",children:[c.jsx("span",{className:"sidebar-user-name",children:o}),c.jsx(jk,{role:e.role})]}),l&&l!==o&&c.jsx("span",{className:"sidebar-user-email",children:l})]})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>s(!1)}),c.jsxs("div",{className:"account-pop sidebar-user-pop",children:[c.jsxs("div",{className:"account-head",children:[c.jsxs("span",{className:`account-avatar account-avatar--lg${h?" has-image":""}`,style:d,children:[u,h?c.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),c.jsxs("div",{className:"account-id",children:[c.jsxs("div",{className:"account-name-row",children:[c.jsx("div",{className:"account-name",children:o}),c.jsx(jk,{role:e.role})]}),l&&l!==o&&c.jsx("div",{className:"account-sub",children:l})]})]}),c.jsxs("button",{className:"account-logout",onClick:()=>{s(!1),n()},children:[c.jsx(NF,{className:"icon"})," 退出登录"]})]})]})]})}function DZ({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,agentsSource:a="local",localApps:o=[],currentAgentId:l="",currentAgentLabel:u="",currentRuntime:d,onSelectAgent:f,onNewChat:h,onSearch:p,onQuickCreate:m,onSkillCenter:b,onAddAgent:w,onManageAgents:g,onPickSession:E,onDeleteSession:y,userInfo:_,onLogout:k}){const T=L=>(r==null?void 0:r[L])!==!1,[C,N]=v.useState(null),[R,I]=v.useState(!1),M=v.useRef(typeof window<"u"&&window.matchMedia(Pk).matches),[B,Y]=v.useState(M.current),P=()=>{I(L=>!L)},U=[...t].sort((L,O)=>(O.lastUpdateTime??0)-(L.lastUpdateTime??0)),A=()=>{M.current=!1,Y(L=>!L),I(!1),N(null)};return v.useEffect(()=>{const L=window.matchMedia(Pk),O=j=>{j.matches?Y(S=>S||(M.current=!0,!0)):M.current&&(M.current=!1,Y(!1))};return L.addEventListener("change",O),()=>L.removeEventListener("change",O)},[]),c.jsxs("aside",{className:`sidebar ${B?"is-collapsed":""}`,children:[c.jsxs("div",{className:"sidebar-top",children:[c.jsxs("div",{className:"sidebar-brand-row",children:[c.jsxs("div",{className:"brand",children:[c.jsx("img",{className:"brand-logo",src:e.logoUrl||ux,width:20,height:20,alt:"","aria-hidden":!0}),c.jsx("span",{className:"brand-title",children:e.title})]}),c.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:A,"aria-label":B?"展开侧边栏":"收起侧边栏",title:B?"展开侧边栏":"收起侧边栏",children:B?c.jsx(RF,{className:"icon"}):c.jsx(IF,{className:"icon"})})]}),f&&(()=>{const L=a==="cloud"&&!l,O=a==="cloud"&&!L&&!!d,j=a==="cloud"&&!L&&(d!=null&&d.region)?d.region==="cn-beijing"?"北京":d.region==="cn-shanghai"?"上海":d.region:"";return c.jsxs("button",{className:`agent-row ${L?"agent-row--empty":""} ${O?"agent-row--connected":""}`,onClick:P,"aria-label":L?"请选择 Agent":u||"选择 Agent",title:"切换 Agent",children:[c.jsx(Uu,{className:"icon agent-row-lead"}),c.jsx("span",{className:"agent-row-name",children:L?"请选择 Agent":u||"选择 Agent"}),j&&c.jsx("span",{className:"agent-row-region",children:j}),c.jsx(or,{className:`icon agent-row-chev ${R?"open":""}`})]})})(),f&&c.jsx(xZ,{open:R,onClose:()=>I(!1),anchorTop:CZ,agentsSource:a,localApps:o,currentId:l,currentRuntime:d,runtimeScope:s.capabilities.runtimeScope,onSelect:f}),T("newChat")&&c.jsxs("button",{className:"new-chat",onClick:h,"aria-label":"新会话",title:"新会话",children:[c.jsx(hs,{className:"icon"}),c.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),T("search")&&c.jsx(uZ,{onClick:p}),T("skillCenter")&&c.jsx(JQ,{onClick:b}),s.capabilities.createAgents&&T("addAgent")&&c.jsxs("button",{className:"new-chat",onClick:m,"aria-label":"添加 Agent",title:"添加 Agent",children:[c.jsx(IZ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"添加 Agent"})]}),s.capabilities.manageAgents&&T("manageAgents")&&c.jsxs("button",{className:"new-chat",onClick:g,"aria-label":"管理 Agent",title:"管理 Agent",children:[c.jsx(RZ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"管理 Agent"})]})]}),T("history")&&c.jsxs("div",{className:"sidebar-history",children:[c.jsxs("div",{className:"history-head",children:[c.jsx("span",{children:"历史会话"}),T("newChat")&&c.jsx("button",{type:"button",className:"history-new-chat",onClick:h,"aria-label":"新建会话",title:"新建会话",children:c.jsx(hs,{className:"icon"})})]}),c.jsxs("div",{className:"history-list",children:[U.length===0&&c.jsx("div",{className:"history-empty",children:"暂无会话"}),U.map(L=>{const O=aR(L.events);return c.jsxs("div",{className:`history-item ${L.id===n?"active":""}`,children:[c.jsxs("button",{className:"history-item-btn",onClick:()=>E(L.id),title:O,children:[(i==null?void 0:i.has(L.id))&&c.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),c.jsx("span",{className:"history-title",children:O})]}),c.jsx("button",{className:"history-more",title:"更多",onClick:()=>N(j=>j===L.id?null:L.id),children:c.jsx(uF,{className:"icon"})}),C===L.id&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>N(null)}),c.jsx("div",{className:"history-menu",children:c.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{N(null),y(L.id)},children:[c.jsx(jl,{className:"icon"})," 删除"]})})]})]},L.id)})]})]}),c.jsx(MZ,{access:s,userInfo:_,onLogout:k})]})}function PZ({apps:e,appName:t,onAppChange:n,agentLabel:r,title:s,crumbs:i,rightContent:a}){return c.jsxs("div",{className:"navbar",children:[c.jsxs("div",{className:"navbar-left",children:[c.jsx("div",{className:"navbar-default",children:i&&i.length>0?c.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:i.map((o,l)=>c.jsxs(v.Fragment,{children:[l>0&&c.jsx(or,{className:"crumb-sep"}),o.onClick?c.jsx("button",{className:"crumb crumb-link",onClick:o.onClick,children:o.label}):c.jsx("span",{className:"crumb crumb-current",children:o.label})]},l))}):s?c.jsx("div",{className:"navbar-title",title:s,children:s}):c.jsx(jZ,{apps:e,appName:t,onAppChange:n,agentLabel:r})}),c.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),c.jsxs("div",{className:"navbar-right",children:[c.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),a]})]})}function jZ({apps:e,appName:t,onAppChange:n,agentLabel:r}){const[s,i]=v.useState(!1),[a,o]=v.useState(null),[l,u]=v.useState({}),[d,f]=v.useState(0),h=v.useRef({}),p=w=>r?r(w):w;function m(w){o(w);const g=h.current[w];if(g){const E=g.getBoundingClientRect(),y=g.closest(".agent-dd");if(y){const _=y.getBoundingClientRect();f(E.top-_.top)}}l[w]===void 0&&(u(E=>({...E,[w]:"loading"})),dd(w).then(E=>u(y=>({...y,[w]:E}))).catch(()=>u(E=>({...E,[w]:"error"}))))}function b(){i(!1),o(null)}return c.jsxs("div",{className:"agent-dd",children:[c.jsxs("button",{className:"agent-dd-trigger",onClick:()=>i(w=>!w),children:[c.jsx("span",{className:"agent-dd-current",children:t?p(t):"选择 Agent"}),c.jsx(ip,{className:`agent-dd-chev ${s?"open":""}`})]}),s&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:b}),c.jsx("div",{className:"agent-dd-menu",children:e.map(w=>c.jsx("div",{ref:g=>h.current[w]=g,className:"agent-dd-row",onMouseEnter:()=>m(w),onMouseLeave:()=>o(g=>g===w?null:g),children:c.jsxs("button",{className:`agent-dd-item ${w===t?"active":""}`,onClick:()=>{n(w),b()},children:[c.jsx("span",{className:"agent-dd-item-name",children:p(w)}),w===t&&c.jsx("span",{className:"agent-dd-item-dot","aria-label":"当前"})]})},w))}),a&&c.jsx(BZ,{state:l[a],top:d})]})]})}function BZ({state:e,top:t}){return c.jsx("div",{className:"agent-dd-flyout",style:{top:`${t}px`},children:e===void 0||e==="loading"?c.jsxs("div",{className:"agent-dd-fly-loading",children:[c.jsx(wt,{className:"icon spin"})," 加载中…"]}):e==="error"?c.jsx("div",{className:"agent-dd-fly-loading",children:"读取信息失败"}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"agent-dd-fly-name",children:e.name}),e.description&&c.jsx("div",{className:"agent-dd-fly-desc",children:e.description}),c.jsxs("div",{className:"agent-dd-fly-field",children:[c.jsx(TI,{className:"icon"}),c.jsx("span",{className:"agent-dd-fly-model",children:e.model})]}),e.tools.length>0&&c.jsxs("div",{className:"agent-dd-fly-field agent-dd-fly-field--tools",children:[c.jsx(CE,{className:"icon"}),c.jsx("div",{className:"agent-dd-fly-chips",children:e.tools.map(n=>c.jsx("span",{className:"agent-dd-chip",children:n},n))})]}),e.subAgents.length>0&&c.jsxs("div",{className:"agent-dd-fly-field",children:[c.jsx("span",{className:"agent-dd-fly-label",children:"子 Agent"}),c.jsx("span",{className:"agent-dd-fly-model",children:e.subAgents.join("、")})]})]})})}const Bk={llm:{icon:$a,label:"LLM"},sequential:{icon:CI,label:"顺序"},parallel:{icon:DI,label:"并行"},loop:{icon:AE,label:"循环"},a2a:{icon:lm,label:"A2A"}};function GL(e){return 1+e.children.reduce((t,n)=>t+GL(n),0)}function El(e){return e.id||e.name}function FZ(e,t){const n=El(e);if(e.id&&e.name&&e.name!==n)return e.name;if(t&&n==="agent")return"主 Agent";const r=/^agent_sub_(\d+)$/.exec(n);return r?`子 Agent ${r[1]}`:e.name||n}function XL(e,t=!0){return{...e,id:El(e),name:FZ(e,t),children:e.children.map(n=>XL(n,!1))}}function QL(e,t){t.set(El(e),e.name||El(e)),e.children.forEach(n=>QL(n,t))}function ZL({node:e,activeAgent:t,seen:n,path:r}){const s=Bk[e.type]??Bk.llm,i=s.icon,a=El(e),o=!!a,l=o&&a===t,u=o&&!l&&r.has(a),d=o&&!l&&!u&&n.has(a);return c.jsxs("div",{className:"topo-branch",children:[c.jsxs("div",{className:`topo-node topo-type-${e.type} ${l?"is-active":""} ${u?"is-onpath":""} ${d?"is-done":""}`,title:e.description||e.name,children:[c.jsx(i,{className:"topo-icon"}),c.jsx("span",{className:"topo-name",children:e.name||"(未命名)"}),c.jsx("span",{className:"topo-badge",children:s.label})]}),l&&e.type==="a2a"&&c.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&c.jsx("div",{className:"topo-children",children:e.children.map((f,h)=>c.jsx(ZL,{node:f,activeAgent:t,seen:n,path:r},`${El(f)}-${h}`))})]})}function Fk({appName:e,activeAgent:t,seenAgents:n,execPath:r=[]}){const[s,i]=v.useState(null);if(v.useEffect(()=>{let l=!1;if(i(null),!!e)return dd(e).then(u=>{l||i(u.graph?XL(u.graph):null)}).catch(()=>{l||i(null)}),()=>{l=!0}},[e]),!s||s.children.length===0)return null;const a=new Set(r),o=new Map;return QL(s,o),c.jsxs("aside",{className:"topo","aria-label":"Agent 拓扑",children:[c.jsxs("div",{className:"topo-head",children:[c.jsx("span",{className:"topo-head-title",children:"Agent 拓扑"}),c.jsxs("span",{className:"topo-head-sub",children:[GL(s)," 个"]})]}),r.length>0&&c.jsx("div",{className:"topo-path","aria-label":"执行路径",children:r.map((l,u)=>c.jsxs("span",{className:"topo-path-seg",children:[u>0&&c.jsx(or,{className:"topo-path-sep"}),c.jsx("span",{className:u===r.length-1?"topo-path-name is-current":"topo-path-name",children:o.get(l)??l})]},`${l}-${u}`))}),c.jsx("div",{className:"topo-tree",children:c.jsx(ZL,{node:s,activeAgent:t,seen:n,path:a})})]})}function UZ({onAdded:e,onCancel:t}){const[n,r]=v.useState(""),[s,i]=v.useState(""),[a,o]=v.useState(""),[l,u]=v.useState(!1),[d,f]=v.useState(""),h=n.trim().length>0&&s.trim().length>0&&!l;async function p(){if(h){u(!0),f("");try{const m=await VL(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(Va(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return c.jsx("div",{className:"addagent",children:c.jsxs("div",{className:"addagent-card",children:[c.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),c.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),c.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"API Key"}),c.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),c.jsx("input",{className:"addagent-input",value:a,onChange:m=>o(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&c.jsx("div",{className:"addagent-error",children:d}),c.jsxs("div",{className:"addagent-actions",children:[c.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:l,children:"取消"}),c.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[l?c.jsx(wt,{className:"icon spin"}):null,l?"连接中…":"连接并添加"]})]})]})})}function $Z({currentRuntimeId:e,onConnect:t}){const[n,r]=v.useState([]),[s,i]=v.useState(!0),[a,o]=v.useState(""),[l,u]=v.useState(null),[d,f]=v.useState(null),[h,p]=v.useState(null),[m,b]=v.useState({}),[w,g]=v.useState("cn-beijing"),[E,y]=v.useState(!1),_=v.useCallback(async()=>{i(!0),o("");try{r(await XI(w))}catch(R){o(R instanceof Error?R.message:String(R))}finally{i(!1)}},[w]);v.useEffect(()=>{_()},[_]);async function k(R){b(M=>({...M,[R.runtimeId]:{loading:!0}}));const I={loading:!1};try{I.detail=await ME(R.runtimeId,R.region)}catch(M){I.error=M instanceof Error?M.message:String(M)}I.detail&&(I.graphs=[{name:I.detail.name,description:I.detail.description,type:"llm",model:I.detail.model,tools:[],skills:[],path:[I.detail.name],mentionable:!1,children:[]}],I.graphNote="仅显示主 Agent(控制面信息)。"),b(M=>({...M,[R.runtimeId]:I}))}function T(R){const I=h===R.runtimeId;p(I?null:R.runtimeId),!I&&!m[R.runtimeId]&&k(R)}async function C(R){if(!l&&window.confirm(`确定删除 Agent "${R.name}"?该 Runtime 将被永久删除。`)){u(R.runtimeId),o("");try{await tR(R.runtimeId,R.region),r(I=>I.filter(M=>M.runtimeId!==R.runtimeId))}catch(I){o(I instanceof Error?I.message:String(I))}finally{u(null)}}}async function N(R){if(!(d||e===R.runtimeId)){f(R.runtimeId),o("");try{await t(R)}catch(I){o(I instanceof Error?I.message:String(I))}finally{f(null)}}}return c.jsxs("div",{className:"manage",children:[c.jsxs("div",{className:"manage-head",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"manage-title",children:"管理 Agent"}),c.jsx("p",{className:"manage-sub",children:"列出你有权管理的 AgentKit Runtime"})]}),c.jsxs("div",{className:"manage-head-actions",children:[c.jsxs("div",{className:"manage-region-picker",onKeyDown:R=>{R.key==="Escape"&&y(!1)},children:[c.jsxs("button",{type:"button",className:"manage-region",onClick:()=>y(R=>!R),title:"按区域筛选","aria-label":"区域筛选","aria-haspopup":"listbox","aria-expanded":E,children:[c.jsx("span",{children:w==="cn-beijing"?"北京":"上海"}),c.jsx(ip,{className:`manage-region-chevron${E?" is-open":""}`})]}),E&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>y(!1)}),c.jsx("div",{className:"manage-region-menu",role:"listbox","aria-label":"区域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(R=>{const I=R.value===w;return c.jsxs("button",{type:"button",role:"option","aria-selected":I,className:`manage-region-option${I?" is-selected":""}`,onClick:()=>{g(R.value),y(!1)},children:[c.jsx("span",{children:R.label}),I&&c.jsx(Ds,{"aria-hidden":"true"})]},R.value)})})]})]}),c.jsxs("button",{type:"button",className:"manage-refresh",onClick:()=>void _(),disabled:s,title:"刷新",children:[c.jsx(SE,{className:`icon ${s?"spin":""}`}),"刷新"]})]})]}),a&&c.jsx("div",{className:"manage-error",children:a}),s?c.jsxs("div",{className:"manage-empty",children:[c.jsx(wt,{className:"icon spin"})," 加载中…"]}):n.length===0?c.jsx("div",{className:"manage-empty",children:"暂无你部署的 Agent。"}):c.jsx("ul",{className:"manage-list",children:n.map(R=>{const I=h===R.runtimeId,M=m[R.runtimeId];return c.jsxs("li",{className:"manage-item",children:[c.jsxs("div",{className:"manage-item-row",children:[c.jsxs("button",{type:"button",className:"manage-item-toggle",onClick:()=>T(R),"aria-expanded":I,children:[I?c.jsx(ip,{className:"icon"}):c.jsx(or,{className:"icon"}),c.jsxs("span",{className:"manage-item-main",children:[c.jsx("span",{className:"manage-item-name",children:R.name}),c.jsx("span",{className:`manage-badge is-${YZ(R.status)}`,children:R.status||"-"})]})]}),c.jsxs("div",{className:"manage-item-actions",children:[c.jsxs("button",{type:"button",className:"manage-connect",onClick:()=>void N(R),disabled:d!==null||e===R.runtimeId,children:[d===R.runtimeId?c.jsx(wt,{className:"icon spin"}):c.jsx(vF,{className:"icon"}),e===R.runtimeId?"已连接":"连接到此 Agent"]}),c.jsx("button",{type:"button",className:"manage-del",onClick:()=>void C(R),disabled:l===R.runtimeId,title:"删除该 Runtime",children:l===R.runtimeId?c.jsx(wt,{className:"icon spin"}):c.jsx(jl,{className:"icon"})})]})]}),c.jsxs("div",{className:"manage-item-meta",children:[c.jsx("span",{className:"manage-item-id",title:R.runtimeId,children:R.runtimeId}),c.jsx("span",{className:"manage-item-dot",children:"·"}),c.jsx("span",{children:R.region}),R.createdAt&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"manage-item-dot",children:"·"}),c.jsx("span",{children:eM(R.createdAt)})]})]}),I&&c.jsx("div",{className:"manage-detail",children:!M||M.loading?c.jsxs("div",{className:"manage-detail-loading",children:[c.jsx(wt,{className:"icon spin"})," 读取详情…"]}):c.jsxs(c.Fragment,{children:[M.error&&c.jsx("div",{className:"manage-error",children:M.error}),M.detail&&c.jsx(VZ,{detail:M.detail}),c.jsx("div",{className:"manage-tree-head",children:"Agent 结构"}),M.graphs&&M.graphs.length>0?M.graphs.map((B,Y)=>c.jsx(JL,{node:B},Y)):c.jsx("div",{className:"manage-tree-note",children:M.graphNote})]})})]},R.runtimeId)})})]})}const HZ=/KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL/i;function zZ({envKey:e,value:t}){const[n,r]=v.useState(!1);return!HZ.test(e)||n?c.jsx("code",{className:"manage-env-v",children:t}):c.jsx("button",{type:"button",className:"manage-env-v manage-env-masked",title:"敏感值已隐藏,点击显示","aria-label":`显示 ${e} 的值`,onClick:()=>r(!0),children:"••••••••"})}function VZ({detail:e}){const t=e.resources,n=[];e.model&&n.push(["模型",e.model]),e.description&&n.push(["描述",e.description]),e.statusMessage&&n.push(["状态信息",e.statusMessage]),e.project&&n.push(["Project",e.project]),e.currentVersion!=null&&n.push(["版本",String(e.currentVersion)]);const r=[t.cpuMilli!=null?`CPU ${t.cpuMilli}m`:"",t.memoryMb!=null?`内存 ${t.memoryMb}MB`:"",t.minInstance!=null||t.maxInstance!=null?`实例 ${t.minInstance??"?"}~${t.maxInstance??"?"}`:"",t.maxConcurrency!=null?`并发 ${t.maxConcurrency}`:""].filter(Boolean).join(" · ");return r&&n.push(["资源",r]),e.memoryId&&n.push(["Memory",e.memoryId]),e.toolId&&n.push(["Tool",e.toolId]),e.knowledgeId&&n.push(["Knowledge",e.knowledgeId]),e.mcpToolsetId&&n.push(["MCP Toolset",e.mcpToolsetId]),e.updatedAt&&n.push(["更新时间",eM(e.updatedAt)]),c.jsxs("div",{className:"manage-detail-card",children:[c.jsx("dl",{className:"manage-kv",children:n.map(([s,i])=>c.jsxs("div",{className:"manage-kv-row",children:[c.jsx("dt",{children:s}),c.jsx("dd",{children:i})]},s))}),e.envs.length>0&&c.jsxs("div",{className:"manage-envs",children:[c.jsx("div",{className:"manage-envs-head",children:"环境变量"}),e.envs.map(s=>c.jsxs("div",{className:"manage-env",children:[c.jsx("code",{className:"manage-env-k",children:s.key}),c.jsx(zZ,{envKey:s.key,value:s.value})]},s.key))]})]})}const KZ={llm:"LLM",sequential:"Sequential",parallel:"Parallel",loop:"Loop",a2a:"A2A"};function JL({node:e,depth:t=0}){return c.jsxs("div",{className:"manage-tree",style:{marginLeft:t?16:0},children:[c.jsxs("div",{className:"manage-tree-node",children:[c.jsx("span",{className:"manage-tree-name",children:e.name||"(未命名)"}),c.jsx("span",{className:"manage-tree-type",children:KZ[e.type]||e.type}),e.model&&c.jsx("span",{className:"manage-tree-model",children:e.model})]}),e.tools.length>0&&c.jsx("div",{className:"manage-tree-tools",children:e.tools.map(n=>c.jsx("span",{className:"manage-tree-tool",children:n},n))}),e.children.map((n,r)=>c.jsx(JL,{node:n,depth:t+1},r))]})}function YZ(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}function eM(e){const t=Number(e),n=Number.isFinite(t)&&String(t)===e?new Date(t*1e3):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()}const WZ={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function qZ(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(const s of n){if(r==null||typeof r!="object")return;r=r[s]}return r}function GZ(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function XZ(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dx(e,t){if(GZ(e))return qZ(t,e.path);if(XZ(e)){const n=WZ[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=dx(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function QZ(e,t){const n=dx(e,t);return n==null?"":typeof n=="string"?n:String(n)}const tM=new Map;function so(e,t){tM.set(e,t)}function ZZ(e){return tM.get(e)}function JZ(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;idx(r,e.dataModel),resolveString:r=>QZ(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=ZZ(s.component)??eJ;return c.jsx(i,{node:s,ctx:n},r)}};return c.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function rM(e){const t=v.useRef(null),n=v.useRef(!0),r=28,s=v.useCallback(()=>{const i=t.current;i&&(n.current=i.scrollHeight-i.scrollTop-i.clientHeight{const i=t.current;i&&n.current&&(i.scrollTop=i.scrollHeight)},[e]),{ref:t,onScroll:s}}function fx({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:c.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>c.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[c.jsx(Ha,{"aria-hidden":!0}),c.jsxs("span",{children:["/",r.name]}),t?c.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:c.jsx(Gr,{})}):null]},r.name)),e.targetAgent?c.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[c.jsx(wI,{"aria-hidden":!0}),c.jsx("span",{children:e.targetAgent.name}),n?c.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:c.jsx(Gr,{})}):null]}):null]})}function hx(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function sM(e){var n,r,s,i;const t=hx(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((r=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:r.toUpperCase())??"VIDEO":t==="image"?((i=(s=e.mimeType)==null?void 0:s.split("/")[1])==null?void 0:i.toUpperCase())??"IMAGE":"TXT"}function iM(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function aM(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?zI(t,e.uri):""}function nJ({kind:e}){return e==="image"?c.jsx(II,{}):e==="video"?c.jsx(SI,{}):e==="pdf"?c.jsx(pF,{}):c.jsx(NI,{})}function px({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=v.useState(null);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const o=hx(a.mimeType),l=aM(a,e),u=a.status==="uploading"||a.status==="error"||!l,d=c.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[o==="image"&&l?c.jsx("img",{className:"media-card-image",src:l,alt:a.name??"图片",loading:"lazy"}):o==="video"&&l?c.jsxs("div",{className:"media-card-video-container",children:[c.jsx("video",{className:"media-card-video",src:l,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),c.jsx("span",{className:"media-card-video-play",children:c.jsx(LF,{})})]}):c.jsx("span",{className:"media-card-icon",children:c.jsx(nJ,{kind:o})}),c.jsxs("span",{className:"media-card-copy",children:[c.jsx("span",{className:"media-card-name",children:a.name??"附件"}),c.jsxs("span",{className:"media-card-meta",children:[c.jsx("span",{className:"media-card-type",children:sM(a)}),a.status==="uploading"?c.jsxs(c.Fragment,{children:[c.jsx(wt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":iM(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?c.jsx(Wc,{className:"media-card-open"}):null]});return c.jsxs(Wt.div,{className:`media-card media-card--${o}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[o==="image"&&!u?c.jsx(gI,{src:l,children:d}):d,r?c.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:c.jsx(Gr,{})}):null]},a.id)})}),c.jsx($i,{children:s?c.jsx(rJ,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function rJ({appName:e,item:t,onClose:n}){const r=v.useMemo(()=>aM(t,e),[e,t]),s=hx(t.mimeType),[i,a]=v.useState(""),[o,l]=v.useState(s==="text"||s==="markdown"),[u,d]=v.useState("");return v.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),v.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const f=new AbortController;return l(!0),d(""),fetch(r,{signal:f.signal}).then(h=>{if(!h.ok)throw new Error(`HTTP ${h.status}`);return h.text()}).then(a).catch(h=>{f.signal.aborted||d(h instanceof Error?h.message:String(h))}).finally(()=>{f.signal.aborted||l(!1)}),()=>f.abort()},[s,r]),c.jsx(Wt.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":t.name??"附件预览",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&n()},children:c.jsxs(Wt.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[c.jsxs("header",{className:"media-viewer-header",children:[c.jsxs("div",{children:[c.jsx("strong",{children:t.name??"附件"}),c.jsxs("span",{children:[sM(t),t.sizeBytes?` · ${iM(t.sizeBytes)}`:""]})]}),c.jsxs("nav",{children:[c.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:c.jsx(TE,{})}),c.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:c.jsx(Gr,{})})]})]}),c.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?c.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?c.jsx("div",{className:"media-viewer-video-wrapper",children:c.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?c.jsx("iframe",{src:r,title:t.name??"PDF"}):null,o?c.jsxs("div",{className:"media-viewer-loading",children:[c.jsx(wt,{})," 正在读取文档…"]}):null,!o&&u?c.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!o&&s==="markdown"?c.jsx("div",{className:"media-document",children:c.jsx(wd,{text:i})}):null,!o&&s==="text"?c.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Vl({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const o=Math.min(Math.max(r,5),45);return c.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-o}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+o}%)`,animationDuration:`${n}s`},...a,children:s})}function sJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),c.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function iJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),c.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),c.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),c.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function aJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"3.25",y:"5.5",width:"16.25",height:"13",rx:"2.4"}),c.jsx("path",{d:"m10.2 9.2 4.4 2.8-4.4 2.8V9.2Z"}),c.jsx("path",{d:"m19.25 2.5.42 1.2 1.2.42-1.2.42-.42 1.2-.42-1.2-1.2-.42 1.2-.42.42-1.2Z",fill:"currentColor",stroke:"none"})]})}function oJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),c.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),c.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function lJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),c.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),c.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),c.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function oM(e){return c.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:c.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function cJ({definition:e,done:t,open:n,onToggle:r}){const s=e.icon;return c.jsxs("button",{type:"button",className:`builtin-tool-head${t?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":n,children:[c.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:c.jsx(s,{})}),t?c.jsx("span",{className:"builtin-tool-label",children:e.doneLabel}):c.jsx(Vl,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:e.runningLabel}),c.jsx(oM,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}const uJ={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:sJ},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:iJ},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:aJ},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:oJ},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:lJ}};function dJ(e){return uJ[e]}const lM="send_a2ui_json_to_client";function fJ({className:e}){return c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.jsx("path",{d:"M12 2.2l1.7 5.1a3 3 0 0 0 1.9 1.9L20.8 11l-5.1 1.7a3 3 0 0 0-1.9 1.9L12 19.8l-1.7-5.1a3 3 0 0 0-1.9-1.9L3.2 11l5.1-1.7a3 3 0 0 0 1.9-1.9L12 2.2z"})})}function hJ(){return c.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function cM({text:e,done:t}){const[n,r]=v.useState(!t),s=v.useRef(!1);v.useEffect(()=>{s.current||r(!t)},[t]);const i=()=>{s.current=!0,r(u=>!u)},a=e.replace(/^\s+/,""),{ref:o,onScroll:l}=rM(a);return c.jsxs("div",{className:"block-thinking",children:[c.jsxs("button",{className:"think-head",onClick:i,type:"button",children:[c.jsx("span",{className:"think-icon","aria-hidden":"true",children:c.jsx(fJ,{className:`spark ${t?"":"pulse"}`})}),t?c.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):c.jsx(Vl,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),c.jsx(or,{className:`chev ${n?"open":""}`})]}),c.jsx("div",{className:`think-collapse ${n&&a?"open":""}`,children:c.jsx("div",{className:"think-collapse-inner",children:c.jsx("div",{className:"think-body scroll",ref:o,onScroll:l,children:a})})})]})}function uM(){return c.jsx(cM,{text:"",done:!1})}function pJ({name:e,args:t,response:n,done:r}){const[s,i]=v.useState(!1),a=e===lM?"渲染 UI":e,o=dJ(e),l=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),u=l&&l.length>2e3?l.slice(0,2e3)+` -…(已截断)`:l;return c.jsxs(Wt.div,{className:`block-tool${o?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o?c.jsx(cJ,{definition:o,done:r,open:s,onToggle:()=>i(d=>!d)}):c.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[c.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:c.jsx(hJ,{})}),r?c.jsx("span",{className:"tool-name",children:a}):c.jsx(Vl,{className:"tool-name",duration:2.2,spread:15,children:a}),c.jsx(oM,{className:`tool-chevron${s?" is-open":""}`})]}),c.jsx("div",{className:`think-collapse ${s?"open":""}`,children:c.jsx("div",{className:"think-collapse-inner",children:c.jsxs("div",{className:"tool-detail",children:[t!=null&&c.jsxs("div",{className:"tool-section",children:[c.jsx("div",{className:"tool-section-label",children:"参数"}),c.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&c.jsxs("div",{className:"tool-section",children:[c.jsx("div",{className:"tool-section-label",children:"返回"}),c.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function mJ({block:e,onAuth:t}){const[n,r]=v.useState(e.done?"done":"idle"),[s,i]=v.useState(""),a=e.label||"MCP 工具集",o=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),l=async()=>{if(t){i(""),r("authorizing");try{await t(e),r("done")}catch(d){i(d instanceof Error?d.message:String(d)),r("idle")}}};return e.done||n==="done"?c.jsxs(Wt.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[c.jsx(F_,{className:"auth-card-icon auth-card-icon--done"}),c.jsxs("span",{children:["已授权 · ",a]})]}):c.jsxs(Wt.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[c.jsxs("div",{className:"auth-card-head",children:[c.jsx(F_,{className:"auth-card-icon"}),c.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),c.jsxs("p",{className:"auth-card-desc",children:["工具集 ",c.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",o&&c.jsxs(c.Fragment,{children:[" ","将跳转至 ",c.jsx("code",{className:"auth-card-code",children:o})," 完成登录,"]}),"授权完成后对话自动继续。"]}),c.jsx("button",{className:"auth-card-btn",onClick:l,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?c.jsxs(c.Fragment,{children:[c.jsx(wt,{className:"cw-i spin"})," 等待授权…"]}):c.jsx(c.Fragment,{children:"去授权"})}),!e.authUri&&c.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&c.jsx("div",{className:"auth-card-err",children:s})]})}function mx({blocks:e,appName:t="",onAction:n,onAuth:r}){return c.jsx(c.Fragment,{children:e.map((s,i)=>{switch(s.kind){case"thinking":return c.jsx(cM,{text:s.text,done:s.done},i);case"text":{const a=s.text.replace(/^\s+/,"");return a?c.jsx("div",{className:"bubble",children:c.jsx(wd,{text:a})},i):null}case"attachment":return c.jsx(px,{appName:t,items:s.files},i);case"invocation":return c.jsx(fx,{value:s.value},i);case"tool":return s.name===lM&&s.done?null:c.jsx(pJ,{name:s.name,args:s.args,response:s.response,done:s.done},i);case"auth":return c.jsx(mJ,{block:s,onAuth:r},i);case"a2ui":return nM(s.messages).filter(a=>a.components[a.rootId]).map(a=>c.jsx(Wt.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:c.jsx(tJ,{surface:a,onAction:n})},`${i}-${a.surfaceId}`));default:return null}})})}function gJ(e){return e.isComposing||e.keyCode===229}const ws=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"临时会话",description:"在 AgentKit 沙箱中执行一次性任务"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}];function Uk({mode:e}){return e==="skill-create"?c.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M10 2.2l1.35 4.1 4.15 1.35-4.15 1.35L10 13.1 8.65 9 4.5 7.65 8.65 6.3 10 2.2Z"}),c.jsx("path",{d:"M15.6 12.2l.6 1.8 1.8.6-1.8.6-.6 1.8-.6-1.8-1.8-.6 1.8-.6.6-1.8Z"})]}):e==="temporary"?c.jsx("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M4.1 4.2h11.8v8.7H9l-3.5 2.8v-2.8H4.1z",strokeDasharray:"2.25 1.9"})}):c.jsx(Uu,{className:"new-chat-mode__agent-icon"})}function yJ({value:e,agentName:t,onChange:n,disabled:r=!1,temporaryEnabled:s,skillCreateEnabled:i}){const[a,o]=v.useState(!1),[l,u]=v.useState(()=>ws.findIndex(E=>E.value===e)),d=v.useRef(null),f=v.useRef(null),h=ws.find(E=>E.value===e)??ws[0];function p(E){return E.value==="temporary"?s:E.value==="skill-create"?i:!0}function m(E){return p(E)!==!0}function b(E){const y=p(E);return y===void 0?"正在检查配置":y?E.description:"管理员未配置"}v.useEffect(()=>{if(!a)return;const E=y=>{var _;(_=d.current)!=null&&_.contains(y.target)||o(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[a]);function w(E){let y=l;do y=(y+E+ws.length)%ws.length;while(m(ws[y]));u(y)}function g(E){var y;m(E)||(n(E.value),o(!1),(y=f.current)==null||y.focus())}return c.jsxs("div",{className:"new-chat-mode",ref:d,children:[c.jsxs("button",{ref:f,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":a,disabled:r,onClick:()=>{u(ws.findIndex(E=>E.value===e)),o(E=>!E)},onKeyDown:E=>{E.key==="ArrowDown"||E.key==="ArrowUp"?(E.preventDefault(),a?w(E.key==="ArrowDown"?1:-1):o(!0)):a&&(E.key==="Enter"||E.key===" ")?(E.preventDefault(),g(ws[l])):a&&E.key==="Escape"&&(E.preventDefault(),o(!1))},children:[c.jsx("span",{className:"new-chat-mode__icon",children:c.jsx(Uk,{mode:h.value})}),c.jsx("span",{className:"new-chat-mode__current",title:h.value==="agent"?t:void 0,children:h.value==="agent"?t:h.label}),c.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:c.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),a?c.jsx("div",{className:"new-chat-mode__menu",role:"listbox","aria-label":"新会话模式",tabIndex:-1,onKeyDown:E=>{var y;E.key==="ArrowDown"||E.key==="ArrowUp"?(E.preventDefault(),w(E.key==="ArrowDown"?1:-1)):E.key==="Enter"?(E.preventDefault(),g(ws[l])):E.key==="Escape"&&(E.preventDefault(),o(!1),(y=f.current)==null||y.focus())},children:ws.map((E,y)=>c.jsxs("button",{type:"button",role:"option","aria-selected":e===E.value,"aria-disabled":m(E),disabled:m(E),className:`new-chat-mode__option${y===l?" is-active":""}`,onMouseEnter:()=>u(y),onClick:()=>g(E),children:[c.jsx("span",{className:"new-chat-mode__option-icon",children:c.jsx(Uk,{mode:E.value})}),c.jsxs("span",{className:"new-chat-mode__copy",children:[c.jsxs("span",{className:"new-chat-mode__label",children:[E.value==="agent"?t:E.label,E.value==="skill-create"?c.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),c.jsx("span",{children:b(E)})]}),e===E.value?c.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:c.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},E.value))}):null]})}const gx=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function bJ({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:o,busy:l,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:b=!0,onInvocationChange:w,onAddFiles:g,onRemoveAttachment:E,newChatMode:y="agent",newChatLayout:_=!1,showModeSelector:k=!1,onModeChange:T,temporaryEnabled:C,skillCreateEnabled:N}){const R=v.useRef(null),I=v.useRef(null),M=v.useRef(null),B=v.useRef(null),[Y,P]=v.useState(!1),[U,A]=v.useState(null),[L,O]=v.useState(0),[j,S]=v.useState(!1);async function H(){if(e)try{await navigator.clipboard.writeText(e),S(!0),setTimeout(()=>S(!1),1500)}catch{S(!1)}}v.useLayoutEffect(()=>{const Z=R.current;Z&&(Z.style.height="auto",Z.style.height=`${Math.min(Z.scrollHeight,200)}px`)},[s]);const V=y==="skill-create";v.useEffect(()=>{V&&(P(!1),A(null))},[V]);const D=!V&&d.some(Z=>Z.status!=="ready"),ne=!o&&!l&&!D&&(s.trim().length>0||!V&&d.length>0),J=(U==null?void 0:U.query.toLocaleLowerCase())??"",re=(U==null?void 0:U.kind)==="skill"?f.filter(Z=>!p.skills.some(ce=>ce.name===Z.name)).filter(Z=>`${Z.name} ${Z.description}`.toLocaleLowerCase().includes(J)).map(Z=>({kind:"skill",value:Z})):(U==null?void 0:U.kind)==="agent"?h.filter(Z=>`${Z.name} ${Z.description}`.toLocaleLowerCase().includes(J)).map(Z=>({kind:"agent",value:Z})):[];function de(Z){var ce;P(!1),A(null),(ce=Z.current)==null||ce.click()}function G(Z,ce){const Ce=Z.slice(0,ce),Ee=/(^|\s)([/@])([^\s/@]*)$/.exec(Ce);if(!Ee){A(null);return}const ge=Ee[2].length+Ee[3].length,Me={kind:Ee[2]==="/"?"skill":"agent",query:Ee[3],start:ce-ge,end:ce},ve=!U||U.kind!==Me.kind||U.query!==Me.query||U.start!==Me.start||U.end!==Me.end;A(Me),ve&&O(0),P(!1)}function W(Z){if(!U)return;const ce=s.slice(0,U.start)+s.slice(U.end);i(ce),Z.kind==="skill"?w({...p,skills:[...p.skills,Z.value]}):w({skills:[],targetAgent:Z.value});const Ce=U.start;A(null),requestAnimationFrame(()=>{var Ee,ge;(Ee=R.current)==null||Ee.focus(),(ge=R.current)==null||ge.setSelectionRange(Ce,Ce)})}function ae(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function he(Z){const ce=Z.target.files?Array.from(Z.target.files):[];ce.length&&g(ce),Z.target.value=""}return c.jsxs("div",{className:`composer${_?" composer--new-chat":""}`,children:[V?null:c.jsx(fx,{value:p,onRemoveSkill:Z=>w({...p,skills:p.skills.filter(ce=>ce.name!==Z)}),onRemoveAgent:()=>w({skills:[]})}),!V&&d.length>0&&c.jsx(px,{appName:n,compact:!0,items:d,onRemove:E}),c.jsxs("div",{className:"composer-box",children:[U?c.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":U.kind==="skill"?"可用技能":"可用子 Agent",children:[c.jsxs("div",{className:"composer-command-head",children:[U.kind==="skill"?c.jsx(Ha,{}):c.jsx(wI,{}),c.jsx("span",{children:U.kind==="skill"?"调用技能":"使用子 Agent"}),c.jsx("kbd",{children:U.kind==="skill"?"/":"@"})]}),m?c.jsxs("div",{className:"composer-command-empty",children:[c.jsx(wt,{className:"spin"})," 正在读取 Agent 能力…"]}):re.length===0?c.jsx("div",{className:"composer-command-empty",children:U.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):c.jsx("div",{className:"composer-command-list",children:re.map((Z,ce)=>c.jsxs("button",{type:"button",role:"option","aria-selected":ce===L,className:`composer-command-item${ce===L?" is-active":""}`,onMouseDown:Ce=>{Ce.preventDefault(),W(Z)},onMouseEnter:()=>O(ce),children:[c.jsx("span",{className:`composer-command-icon composer-command-icon--${Z.kind}`,children:Z.kind==="skill"?c.jsx(Ha,{}):c.jsx($a,{})}),c.jsxs("span",{className:"composer-command-copy",children:[c.jsxs("strong",{children:[Z.kind==="skill"?"/":"@",Z.value.name]}),c.jsx("span",{children:Z.value.description||(Z.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),c.jsx("kbd",{children:ce===L?"↵":Z.kind==="skill"?"技能":"Agent"})]},`${Z.kind}-${Z.value.name}`))})]}):null,V?null:c.jsxs("div",{className:"composer-menu-wrap",children:[c.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:o||!b,onClick:()=>{A(null),P(Z=>!Z)},children:c.jsx(hs,{className:"icon"})}),Y&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>P(!1)}),c.jsxs("div",{className:"composer-menu",role:"menu",children:[c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(I),children:[c.jsx(II,{className:"icon"}),"上传图片"]}),c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(M),children:[c.jsx(NI,{className:"icon"}),"上传文档或 PDF"]}),c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(B),children:[c.jsx(SI,{className:"icon"}),"上传视频"]})]})]})]}),c.jsx("div",{className:"composer-input-stack",children:c.jsx("textarea",{ref:R,className:"comp-input scroll",rows:_?4:1,value:s,disabled:o,placeholder:V?`描述你想创建的 Skill,将使用 ${gx.join(" 和 ")} 并行创建…`:o?"请选择 Agent":`向 ${r} 发消息…`,"aria-expanded":!!U,onChange:Z=>{i(Z.target.value),V||G(Z.target.value,Z.target.selectionStart)},onSelect:Z=>{V||G(Z.currentTarget.value,Z.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>A(null),0),onKeyDown:Z=>{if(!gJ(Z.nativeEvent)){if(U){if(Z.key==="ArrowDown"&&re.length>0){Z.preventDefault(),O(ce=>(ce+1)%re.length);return}if(Z.key==="ArrowUp"&&re.length>0){Z.preventDefault(),O(ce=>(ce-1+re.length)%re.length);return}if((Z.key==="Enter"||Z.key==="Tab")&&re[L]){Z.preventDefault(),W(re[L]);return}if(Z.key==="Escape"){Z.preventDefault(),A(null);return}}if(Z.key==="Backspace"&&!s&&Z.currentTarget.selectionStart===0&&Z.currentTarget.selectionEnd===0){ae();return}Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),ne&&a())}}})}),k&&T?c.jsx(yJ,{value:y,agentName:r,onChange:T,disabled:l,temporaryEnabled:C,skillCreateEnabled:N}):null,c.jsx(Wt.button,{type:"button",className:"comp-send",disabled:!ne,onClick:a,"aria-label":"发送",whileTap:ne?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:l?c.jsx(wt,{className:"icon spin"}):c.jsx(xI,{className:"icon"})})]}),u&&c.jsxs("div",{className:"composer-meta",children:[c.jsxs("span",{className:"composer-session-line",children:["会话 ID:",c.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&c.jsx("button",{type:"button",className:"composer-session-copy",title:j?"已复制":"复制会话 ID","aria-label":j?"已复制会话 ID":"复制会话 ID",onClick:()=>void H(),children:j?c.jsx(Ds,{}):c.jsx(_E,{})})]}),c.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),c.jsx("span",{children:"回答仅供参考"})]}),c.jsx("input",{ref:I,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:he}),c.jsx("input",{ref:M,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:he}),c.jsx("input",{ref:B,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:he})]})}function dM({title:e,sub:t,cards:n,footer:r}){return c.jsxs("div",{className:"stk",children:[c.jsxs("div",{className:"stk-head",children:[c.jsx("h1",{className:"stk-title",children:e}),t&&c.jsx("p",{className:"stk-sub",children:t})]}),c.jsx("div",{className:"stk-list",children:n.map((s,i)=>c.jsxs(Wt.button,{type:"button",className:`stk-card ${s.disabled?"stk-card-disabled":""}`,onClick:s.disabled?void 0:s.onClick,disabled:s.disabled,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18,ease:"easeOut",delay:i*.04},children:[c.jsx("span",{className:"stk-card-icon",children:c.jsx(s.icon,{})}),c.jsxs("span",{className:"stk-card-text",children:[c.jsx("span",{className:"stk-card-title",children:s.title}),c.jsx("span",{className:"stk-card-desc",children:s.desc})]}),c.jsx(or,{className:"stk-card-arrow"})]},s.key))}),r&&c.jsx("div",{className:"stk-footer",children:r})]})}const yx=Symbol.for("yaml.alias"),S1=Symbol.for("yaml.document"),Hi=Symbol.for("yaml.map"),fM=Symbol.for("yaml.pair"),Ms=Symbol.for("yaml.scalar"),Kl=Symbol.for("yaml.seq"),Xr=Symbol.for("yaml.node.type"),Yl=e=>!!e&&typeof e=="object"&&e[Xr]===yx,vd=e=>!!e&&typeof e=="object"&&e[Xr]===S1,_d=e=>!!e&&typeof e=="object"&&e[Xr]===Hi,pn=e=>!!e&&typeof e=="object"&&e[Xr]===fM,Pt=e=>!!e&&typeof e=="object"&&e[Xr]===Ms,Td=e=>!!e&&typeof e=="object"&&e[Xr]===Kl;function fn(e){if(e&&typeof e=="object")switch(e[Xr]){case Hi:case Kl:return!0}return!1}function hn(e){if(e&&typeof e=="object")switch(e[Xr]){case yx:case Hi:case Ms:case Kl:return!0}return!1}const hM=e=>(Pt(e)||fn(e))&&!!e.anchor,pa=Symbol("break visit"),EJ=Symbol("skip children"),ru=Symbol("remove node");function Wl(e,t){const n=xJ(t);vd(e)?Uo(null,e.contents,n,Object.freeze([e]))===ru&&(e.contents=null):Uo(null,e,n,Object.freeze([]))}Wl.BREAK=pa;Wl.SKIP=EJ;Wl.REMOVE=ru;function Uo(e,t,n,r){const s=wJ(e,t,n,r);if(hn(s)||pn(s))return vJ(e,r,s),Uo(e,s,n,r);if(typeof s!="symbol"){if(fn(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>_J[t]);class sr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},sr.defaultYaml,t),this.tags=Object.assign({},sr.defaultTags,n)}clone(){const t=new sr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new sr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:sr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},sr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:sr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},sr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,a]=r;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const a=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,a),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+TJ(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&hn(t.contents)){const i={};Wl(t.contents,(a,o)=>{hn(o)&&o.tag&&(i[o.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(o=>o.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` -`)}}sr.defaultYaml={explicit:!1,version:"1.2"};sr.defaultTags={"!!":"tag:yaml.org,2002:"};function pM(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function mM(e){const t=new Set;return Wl(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function gM(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function kJ(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=mM(e));const a=gM(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(Pt(a.node)||fn(a.node)))a.node.anchor=a.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=i,o}}},sourceObjects:r}}function $o(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;sYr(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!hM(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class bx{constructor(t){Object.defineProperty(this,Xr,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!vd(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=Yr(this,"",a);if(typeof s=="function")for(const{count:l,res:u}of a.anchors.values())s(u,l);return typeof i=="function"?$o(i,{"":o},"",o):o}}class Ex extends bx{constructor(t){super(yx),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Wl(t,{Node:(i,a)=>{(Yl(a)||hM(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,a=this.resolve(s,n);if(!a){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=r.get(a);if(o||(Yr(a,null,n),o=r.get(a)),(o==null?void 0:o.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=mh(s,a,r)),o.count*o.aliasCount>i)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(pM(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function mh(e,t,n){if(Yl(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(fn(t)){let r=0;for(const s of t.items){const i=mh(e,s,n);i>r&&(r=i)}return r}else if(pn(t)){const r=mh(e,t.key,n),s=mh(e,t.value,n);return Math.max(r,s)}return 1}const yM=e=>!e||typeof e!="function"&&typeof e!="object";class Xe extends bx{constructor(t){super(Ms),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Yr(this.value,t,n)}toString(){return String(this.value)}}Xe.BLOCK_FOLDED="BLOCK_FOLDED";Xe.BLOCK_LITERAL="BLOCK_LITERAL";Xe.PLAIN="PLAIN";Xe.QUOTE_DOUBLE="QUOTE_DOUBLE";Xe.QUOTE_SINGLE="QUOTE_SINGLE";const NJ="tag:yaml.org,2002:";function SJ(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function $u(e,t,n){var f,h,p;if(vd(e)&&(e=e.contents),hn(e))return e;if(pn(e)){const m=(h=(f=n.schema[Hi]).createNode)==null?void 0:h.call(f,n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:a,sourceObjects:o}=n;let l;if(r&&e&&typeof e=="object"){if(l=o.get(e),l)return l.anchor??(l.anchor=s(e)),new Ex(l.anchor);l={anchor:null,node:null},o.set(e,l)}t!=null&&t.startsWith("!!")&&(t=NJ+t.slice(2));let u=SJ(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new Xe(e);return l&&(l.node=m),m}u=e instanceof Map?a[Hi]:Symbol.iterator in Object(e)?a[Kl]:a[Hi]}i&&(i(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((p=u==null?void 0:u.nodeClass)==null?void 0:p.from)=="function"?u.nodeClass.from(n.schema,e,n):new Xe(e);return t?d.tag=t:u.default||(d.tag=u.tag),l&&(l.node=d),d}function wp(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const a=[];a[i]=r,r=a}else r=new Map([[i,r]])}return $u(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ic=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class bM extends bx{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>hn(r)||pn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ic(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(fn(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,wp(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(fn(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&Pt(i)?i.value:i:fn(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!pn(n))return!1;const r=n.value;return r==null||t&&Pt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return fn(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(fn(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,wp(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const AJ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Xs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ta=(e,t,n)=>e.endsWith(` -`)?Xs(n,t):n.includes(` +`,4);return n>=0?t.slice(n+5).trimStart():e}function QQ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M5.25 7.5h5.25v5.25H5.25zM13.5 7.5h5.25v5.25H13.5zM9.38 15.75h5.24v3H9.38z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M7.88 12.75v1.5c0 .83.67 1.5 1.5 1.5h5.24c.83 0 1.5-.67 1.5-1.5v-1.5M12 4.75V7.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("circle",{cx:"12",cy:"4.75",r:"1",fill:"currentColor"})]})}function ZQ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("path",{d:"m17.85 13.85.42 1.13 1.13.42-1.13.42-.42 1.13-.42-1.13-1.13-.42 1.13-.42z",fill:"currentColor"})]})}function JQ(){return c.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:c.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function AN({direction:e}){return c.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:c.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function k1(){return c.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function CN({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return c.jsxs("footer",{className:"skillcenter-pager",children:[c.jsxs("span",{children:["共 ",t," 项"]}),c.jsxs("div",{className:"skillcenter-pager-actions",children:[c.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:c.jsx(AN,{direction:"left"})}),c.jsxs("span",{children:[e," / ",s]}),c.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:c.jsx(AN,{direction:"right"})})]})]})}function gh({children:e}){return c.jsx("div",{className:"skillcenter-empty",children:e})}function eZ({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return v.useEffect(()=>{const o=l=>{l.key==="Escape"&&a()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a]),c.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:c.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:o=>o.stopPropagation(),children:[c.jsxs("header",{className:"skill-detail-head",children:[c.jsxs("div",{className:"skill-detail-heading",children:[c.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:c.jsx(ZQ,{})}),c.jsxs("div",{children:[c.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),c.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),c.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:c.jsx(JQ,{})})]}),c.jsxs("dl",{className:"skill-detail-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"技能 ID"}),c.jsx("dd",{title:e.skillId,children:e.skillId})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"版本"}),c.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"状态"}),c.jsx("dd",{children:N1(e.skillStatus)})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"技能空间"}),c.jsx("dd",{title:t.name,children:t.name})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Project"}),c.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"地域"}),c.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),c.jsxs("div",{className:"skill-detail-content",children:[c.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?c.jsxs("div",{className:"skillcenter-loading",children:[c.jsx(k1,{}),"正在读取技能内容…"]}):i?c.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?c.jsx(_d,{text:XQ(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):c.jsx(gh,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function tZ({onClick:e}){return c.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"技能中心",title:"技能中心",children:[c.jsx(QQ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"技能中心"})]})}function nZ(){const[e,t]=v.useState("cn-beijing"),[n,r]=v.useState([]),[s,i]=v.useState(1),[a,o]=v.useState(0),[l,u]=v.useState(!1),[d,f]=v.useState(""),[h,p]=v.useState(null),[m,y]=v.useState([]),[w,g]=v.useState(1),[E,b]=v.useState(0),[_,N]=v.useState(!1),[T,A]=v.useState(""),[k,R]=v.useState(null),[I,M]=v.useState(null),[B,Y]=v.useState(!1),[P,U]=v.useState(""),C=v.useRef(0);v.useEffect(()=>{let H=!0;return u(!0),f(""),pU({region:e,page:s,pageSize:NN}).then(V=>{if(!H)return;const D=V.items||[];r(D),o(V.totalCount||0),p(ne=>D.find(ee=>ee.id===(ne==null?void 0:ne.id))||null)}).catch(V=>{H&&(r([]),o(0),p(null),f(V instanceof Error?V.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{H&&u(!1)}),()=>{H=!1}},[e,s]),v.useEffect(()=>{if(!h){y([]),b(0);return}let H=!0;return N(!0),A(""),gU(h.id,{region:e,page:w,pageSize:kN,project:h.projectName}).then(V=>{H&&(y(V.items||[]),b(V.totalCount||0))}).catch(V=>{H&&(y([]),b(0),A(V instanceof Error?V.message:"读取技能失败,请稍后重试"))}).finally(()=>{H&&N(!1)}),()=>{H=!1}},[e,h,w]);const L=H=>{H!==e&&(j(),t(H),i(1),g(1),p(null),y([]))},O=H=>{j(),p(H),g(1)},j=()=>{C.current+=1,R(null),M(null),U(""),Y(!1)},S=async H=>{if(!h)return;const V=C.current+1;C.current=V,R(H),M(null),U(""),Y(!0);try{const D=await yU(h.id,H.skillId,H.version,e,h.projectName);C.current===V&&M(D)}catch(D){C.current===V&&U(D instanceof Error?D.message:"读取技能详情失败,请稍后重试")}finally{C.current===V&&Y(!1)}};return c.jsxs("section",{className:"skillcenter",children:[c.jsxs("div",{className:"skillcenter-browser",children:[c.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[c.jsxs("header",{className:"skillcenter-panel-head",children:[c.jsxs("div",{children:[c.jsx("h2",{children:"技能空间"}),c.jsx("span",{className:"skillcenter-count-badge",children:a})]}),c.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[c.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>L("cn-beijing"),children:"北京"}),c.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>L("cn-shanghai"),children:"上海"})]})]}),c.jsxs("div",{className:"skillcenter-listwrap",children:[l&&c.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[c.jsx(k1,{}),"正在读取技能空间…"]}),d?c.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!l?c.jsx(gh,{children:"当前地域暂无可访问的技能空间"}):c.jsx("div",{className:"skillcenter-list",children:n.map(H=>c.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===H.id?"active":""}`,onClick:()=>O(H),children:c.jsxs("span",{className:"skillcenter-item-body",children:[c.jsx("span",{className:"skillcenter-item-title",title:H.name,children:H.name}),c.jsx("span",{className:"skillcenter-item-description",children:H.description||"暂无描述"}),c.jsxs("span",{className:"skillcenter-item-meta",children:[c.jsx("span",{className:`skillcenter-status ${SN(H.status)}`,children:N1(H.status)}),c.jsxs("span",{className:"skillcenter-meta-text",title:H.projectName||"default",children:["Project · ",H.projectName||"default"]}),c.jsxs("span",{className:"skillcenter-meta-text",children:[H.skillCount??0," 个技能"]}),H.updatedAt&&c.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",GQ(H.updatedAt)]})]})]})},`${H.projectName||"default"}:${H.id}`))})]}),c.jsx(CN,{page:s,total:a,pageSize:NN,onPage:i})]}),c.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"skillcenter-panel-head",children:[c.jsx("div",{children:c.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),c.jsx("span",{children:E})]}),c.jsxs("div",{className:"skillcenter-listwrap",children:[_&&c.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[c.jsx(k1,{}),"正在读取技能…"]}),T?c.jsx("div",{className:"skillcenter-error",children:T}):m.length===0&&!_?c.jsx(gh,{children:"这个空间中暂无技能"}):c.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(H=>c.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void S(H),children:c.jsxs("span",{className:"skillcenter-item-body",children:[c.jsx("span",{className:"skillcenter-item-title",title:H.skillName,children:H.skillName}),c.jsx("span",{className:"skillcenter-item-description",children:H.skillDescription||"暂无描述"}),c.jsxs("span",{className:"skillcenter-item-meta",children:[c.jsx("span",{className:`skillcenter-status ${SN(H.skillStatus)}`,children:N1(H.skillStatus)}),c.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",H.version||"—"]})]})]})},`${H.skillId}:${H.version}`))})]}),c.jsx(CN,{page:w,total:E,pageSize:kN,onPage:g})]}):c.jsx(gh,{children:"点击 Skill 空间以查看详情"})})]}),k&&h&&c.jsx(eZ,{skill:k,space:h,region:e,detail:I,loading:B,error:P,onClose:j})]})}const rZ=50,IN=48;function sZ(e){return(e.events??[]).flatMap(t=>{var s,i;const r=(((s=t.content)==null?void 0:s.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return r?[{text:r,role:t.author??((i=t.content)==null?void 0:i.role)??"",ts:t.timestamp}]:[]})}function iZ(e){var t,n;for(const r of e.events??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const s=(((n=r.content)==null?void 0:n.parts)??[]).map(i=>i.text).find(Boolean);if(s)return s}return"未命名会话"}function aZ(e,t,n){const r=Math.max(0,t-IN),s=Math.min(e.length,t+n+IN);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var l;if((l=o.events)!=null&&l.length)return o;try{return await dp(t,e,o.id)}catch{return o}})),a=[];for(const o of i)for(const{text:l,role:u,ts:d}of sZ(o)){const f=l.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:o.id,title:iZ(o),snippet:aZ(l,f,r.length),role:u,ts:d??o.lastUpdateTime});break}}return a.sort((o,l)=>(l.ts??0)-(o.ts??0)),a.slice(0,rZ)}async function lZ(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await GI(e,t.trim())}catch(a){const o=String(a);return{results:[],note:o.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${o}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,o)=>({type:"web",index:o,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function cZ(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await qI(t,e,r.trim(),n);if(!s.mounted)return{results:[],note:e==="knowledge"?"该 Agent 未挂载知识库。":"该 Agent 未挂载长期记忆。"};if(s.error)return{results:[],note:s.error};const i=s.sourceName??(e==="knowledge"?"知识库":"长期记忆");return{results:s.results.map((a,o)=>e==="knowledge"?{type:"knowledge",index:o,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:o,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function uZ(e,t,n){return e==="session"?{results:await oZ(n.userId,n.appId,t)}:e==="web"?lZ(n.appId,t):cZ(e,n.appId,n.userId,t)}function $L({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),c.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function dZ({open:e}){return c.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function fZ({onClick:e}){return c.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"智能搜索",title:"智能搜索",children:[c.jsx($L,{}),c.jsx("span",{className:"sidebar-nav-label",children:"智能搜索"})]})}function hZ(e,t,n){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),i=a=>r?n?"正在检测 Agent 能力":`当前 Agent 未挂载${a}`:"请选择 Agent";return[{id:"session",label:"会话",ready:r,unavailableLabel:"请选择 Agent"},{id:"web",label:"网络",ready:r&&s.has("web"),description:"通过 web_search 工具检索",unavailableLabel:i(" web_search 工具")},{id:"knowledge",label:"知识库",ready:r&&s.has("knowledge"),unavailableLabel:i("知识库")},{id:"memory",label:"长期记忆",ready:r&&s.has("memory"),unavailableLabel:i("长期记忆")}]}function vp(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function RN(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function pZ({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var U,C;const[a,o]=v.useState("session"),[l,u]=v.useState(""),[d,f]=v.useState([]),[h,p]=v.useState(),[m,y]=v.useState(!1),[w,g]=v.useState(!1),[E,b]=v.useState(!1),_=v.useRef(0),N=v.useRef(null),T=hZ(t,n,r),A=T.find(L=>L.id===a),k=a==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(L=>L.source==="knowledgebase"||L.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(L=>L.source==="long_term_memory"||L.kind==="memory"):void 0;v.useEffect(()=>{_.current+=1,o("session"),f([]),p(void 0),g(!1),y(!1),b(!1)},[t]),v.useEffect(()=>{if(!E)return;function L(O){var j;(j=N.current)!=null&&j.contains(O.target)||b(!1)}return document.addEventListener("pointerdown",L),()=>document.removeEventListener("pointerdown",L)},[E]);async function R(L,O){var V;const j=L.trim();if(!j||!((V=T.find(D=>D.id===O))!=null&&V.ready))return;const S=++_.current;y(!0),g(!0);let H;try{H=await uZ(O,j,{userId:e,appId:t})}catch(D){const ne=D instanceof Error?D.message:String(D);H={results:[],note:`搜索失败:${ne}`}}S===_.current&&(f(H.results),p(H.note),y(!1))}function I(L){_.current+=1,u(L),f([]),p(void 0),g(!1),y(!1)}function M(L){_.current+=1,o(L),b(!1),f([]),p(void 0),g(!1),y(!1)}const B=!!(A!=null&&A.ready),Y=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(k==null?void 0:k.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(k==null?void 0:k.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",P=k!=null&&k.backend?vp(k.backend):"";return c.jsxs("div",{className:"search",children:[c.jsxs("div",{className:"search-box",children:[c.jsxs("div",{className:"search-source-picker-wrap",ref:N,children:[c.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(A==null?void 0:A.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":E,onClick:()=>b(L=>!L),children:[c.jsx("span",{children:(A==null?void 0:A.label)??"搜索类型"}),P&&c.jsx("small",{children:P}),c.jsx(dZ,{open:E})]}),E&&c.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:T.map(L=>{var S,H;const O=L.id==="knowledge"?(S=n==null?void 0:n.components)==null?void 0:S.find(V=>V.source==="knowledgebase"||V.kind==="knowledgebase"):L.id==="memory"?(H=n==null?void 0:n.components)==null?void 0:H.find(V=>V.source==="long_term_memory"||V.kind==="memory"):void 0,j=O?[O.name,O.backend?vp(O.backend):""].filter(Boolean).join(" · "):L.ready?L.description:L.unavailableLabel;return c.jsxs("button",{type:"button",role:"option","aria-selected":a===L.id,disabled:!L.ready,onClick:()=>M(L.id),children:[c.jsx("span",{children:L.label}),j&&c.jsx("small",{children:j})]},L.id)})})]}),c.jsx("span",{className:"search-box-divider","aria-hidden":!0}),c.jsx("input",{className:"search-input",value:l,onChange:L=>I(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),R(l,a))},placeholder:Y,disabled:!B,autoFocus:!0}),c.jsx("button",{className:"search-go",onClick:()=>void R(l,a),disabled:!l.trim()||m,"aria-label":"搜索",children:m?c.jsx(bt,{className:"icon spin"}):c.jsx($L,{className:"icon"})})]}),c.jsx("div",{className:"search-results",children:B?w?m?null:h?c.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?c.jsxs("div",{className:"search-empty",children:["未找到匹配「",l.trim(),"」的结果。"]}):d.map((L,O)=>c.jsx(mZ,{result:L,agentLabel:s,onOpen:i},O)):c.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):c.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(A==null?void 0:A.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function mZ({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return c.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[c.jsx(LI,{className:"search-result-icon"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsx("span",{className:"search-result-title",children:e.title}),c.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${RN(e.ts)}`:""]})]}),c.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return c.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[c.jsx(um,{className:"search-result-icon"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsx("span",{className:"search-result-title",children:e.title||e.url}),c.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&c.jsx(kE,{className:"search-result-ext"})]})]}),e.summary&&c.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return c.jsxs("div",{className:"search-result search-result-static",children:[c.jsx(ON,{source:"knowledge"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),c.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${vp(e.sourceType)}`:""]})]}),c.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return c.jsxs("div",{className:"search-result search-result-static",children:[c.jsx(ON,{source:"memory"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),c.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${vp(e.sourceType)}`:"",e.ts?` · ${RN(e.ts)}`:""]})]}),c.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function ON({source:e,className:t="search-result-icon"}){return e==="knowledge"?c.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),c.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):c.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),c.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}const HL="veadk_agentkit_connections";function Zs(){try{const e=localStorage.getItem(HL);return e?JSON.parse(e):[]}catch{return[]}}function km(e){try{localStorage.setItem(HL,JSON.stringify(e))}catch{}}function Ka(e,t){return`agentkit:${e}:${t}`}function zL(e){try{return new URL(e).host}catch{return e}}function Kl(e){UI();for(const t of e)for(const n of t.apps)FI(Ka(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function VL(e,t,n,r,s){const i={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s},a=[...Zs().filter(o=>o.runtimeId!==e),i];return km(a),Kl(a),i}async function cx(e,t,n){let r;try{r=await tR(e,n)}catch(a){throw a instanceof fd&&S1(e),a}if(!r||r.length===0)throw S1(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const s=Object.fromEntries(r.map(a=>[a,t])),i=VL(e,t,n,r,s);return Ka(i.id,r[0])}async function KL(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await hm(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||zL(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},o=[...Zs().filter(l=>l.base!==s),a];return km(o),Kl(o),a}function gZ(e){const t=Zs().filter(n=>n.id!==e);return km(t),Kl(t),t}function S1(e){const t=Zs().filter(n=>n.runtimeId!==e);return km(t),Kl(t),t}function YL(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var o;const a=((o=s.appLabels)==null?void 0:o[i])??i;return{id:Ka(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:zL(s.base??"")}}));return[...n,...r]}const LN=Object.freeze(Object.defineProperty({__proto__:null,addConnection:KL,addRuntimeConnection:VL,buildAgentEntries:YL,connectRuntime:cx,loadConnections:Zs,registerConnections:Kl,remoteAppId:Ka,removeConnection:gZ,removeRuntimeConnection:S1},Symbol.toStringTag,{value:"Module"}));function Hu({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),c.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),c.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),c.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),c.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),c.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),c.jsx("path",{d:"m12 7.55 1.28 3.17L16.45 12l-3.17 1.28L12 16.45l-1.28-3.17L7.55 12l3.17-1.28L12 7.55Z",fill:"currentColor",stroke:"none"})]})}function yZ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),c.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),c.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),c.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function bZ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m4.7 7.2 7.3-3 7.3 3-7.3 3.1Z"}),c.jsx("path",{d:"M7.2 9.2v4.2c0 1.7 2.15 3.05 4.8 3.05s4.8-1.35 4.8-3.05V9.2"}),c.jsx("path",{d:"M19.3 7.2v5.25"}),c.jsx("circle",{cx:"19.3",cy:"14.4",r:"1.15",fill:"currentColor",stroke:"none"})]})}function WL({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),c.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),c.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),c.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),c.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const MN=15,EZ=1e4,xZ=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function wZ(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function qL(e){const t=e.toLowerCase();return t.includes("invalidagentkitruntime.notfound")||t.includes("specified agentkitruntime does not exist")?"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。":t.includes("accessdenied")||t.includes("forbidden")||t.includes("permission")||t.includes("(401)")||t.includes("(403)")?"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。":t.includes("agent-info failed: 404")||t.includes("读取 agent 列表失败 (404)")?"该 Agent Server 版本暂不支持信息预览。":"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。"}function l0(e,t=EZ){return new Promise((n,r)=>{const s=setTimeout(()=>r(new Error("加载超时,请重试")),t);e.then(i=>{clearTimeout(s),n(i)},i=>{clearTimeout(s),r(i)})})}function vZ({open:e,onClose:t,anchorTop:n=0,agentsSource:r,localApps:s,currentId:i,currentRuntime:a,runtimeScope:o,onSelect:l}){const[u,d]=v.useState([]),[f,h]=v.useState([""]),[p,m]=v.useState(0),[y,w]=v.useState(o==="mine"),[g,E]=v.useState(null),[b,_]=v.useState("cn-beijing"),[N,T]=v.useState(!1),[A,k]=v.useState(""),[R,I]=v.useState(""),[M,B]=v.useState(null),[Y,P]=v.useState(new Set),[U,C]=v.useState(),[L,O]=v.useState("agent"),j=v.useRef(!1);function S(W){C(oe=>(oe==null?void 0:oe.runtimeId)===W.runtimeId?void 0:{runtimeId:W.runtimeId,name:W.name,region:W.region})}const H=v.useCallback(async W=>{if(u[W]){m(W);return}const oe=f[W];if(oe!==void 0){T(!0),k("");try{const he=await l0(dh({nextToken:oe,pageSize:MN,region:b,scope:"all"}));d(J=>{const ce=[...J];return ce[W]=he.runtimes,ce}),h(J=>{const ce=[...J];return he.nextToken&&(ce[W+1]=he.nextToken),ce}),m(W)}catch(he){k(he instanceof Error?he.message:String(he))}finally{T(!1)}}},[f,u,b]),V=v.useCallback(async()=>{T(!0),k("");try{const W=[];let oe="";do{const he=await l0(dh({scope:"mine",nextToken:oe,pageSize:100,region:b}));W.push(...he.runtimes),oe=he.nextToken}while(oe&&W.length<2e3);E(W)}catch(W){k(W instanceof Error?W.message:String(W))}finally{T(!1)}},[b]);v.useEffect(()=>{w(o==="mine"),d([]),h([""]),m(0),E(null),j.current=!1},[o]),v.useEffect(()=>{e&&r==="cloud"&&!y&&!j.current&&(j.current=!0,H(0))},[e,r,y,H]),v.useEffect(()=>{y&&g===null&&r==="cloud"&&V()},[y,g,r,V]),v.useEffect(()=>{e&&(C(void 0),O("agent"))},[e]);function D(){P(new Set),y?(E(null),V()):(d([]),h([""]),m(0),j.current=!0,T(!0),k(""),l0(dh({nextToken:"",pageSize:MN,region:b,scope:"all"})).then(W=>{d([W.runtimes]),h(W.nextToken?["",W.nextToken]:[""])}).catch(W=>k(W instanceof Error?W.message:String(W))).finally(()=>T(!1)))}function ne(W){W!==b&&(_(W),d([]),h([""]),m(0),E(null),P(new Set),j.current=!1)}const ee=!y&&(u[p+1]!==void 0||f[p+1]!==void 0);function re(W){B(W.runtimeId),cx(W.runtimeId,W.name,W.region).then(oe=>{l(oe),t()}).catch(oe=>{if(oe instanceof fd){k(oe.message);return}if(oe instanceof Lu){oe.unsupported&&P(he=>new Set(he).add(W.runtimeId)),k(oe.message);return}P(he=>new Set(he).add(W.runtimeId))}).finally(()=>B(null))}if(!e)return null;const G=(y?g??[]:u[p]??[]).filter(W=>R?W.name.toLowerCase().includes(R.toLowerCase()):!0);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:t}),c.jsxs("div",{className:`agentsel ${U?"has-detail":""}`,role:"dialog","aria-label":"选择 Agent",style:{top:n,height:`min(640px, calc(100dvh - ${n}px - 10px))`},children:[c.jsxs("div",{className:"agentsel-main",children:[c.jsxs("div",{className:"agentsel-head",children:[c.jsxs("span",{className:"agentsel-title",children:[c.jsx(Hu,{})," 选择 Agent"]}),c.jsxs("div",{className:"agentsel-head-actions",children:[r==="cloud"&&c.jsx("button",{className:"agentsel-refresh",onClick:D,title:"刷新",disabled:N,children:c.jsx(dm,{className:`icon ${N?"spin":""}`})}),c.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:c.jsx(Xr,{className:"icon"})})]})]}),r==="local"?c.jsx("div",{className:"agentsel-body",children:s.length===0?c.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):c.jsx("ul",{className:"agentsel-list",children:s.map(W=>c.jsx("li",{children:c.jsxs("button",{className:`agentsel-item ${W===i?"active":""}`,onClick:()=>{l(W),t()},children:[c.jsx(Hu,{}),c.jsx("span",{className:"agentsel-item-name",children:W})]})},W))})}):c.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[c.jsxs("div",{className:"agentsel-tools",children:[c.jsxs("div",{className:"agentsel-search",children:[c.jsx(t1,{className:"icon"}),c.jsx("input",{value:R,onChange:W=>I(W.target.value),placeholder:"搜索 Runtime 名称"})]}),c.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:xZ.map(W=>c.jsx("button",{type:"button",className:b===W.value?"active":"","aria-pressed":b===W.value,onClick:()=>ne(W.value),children:W.label},W.value))}),o==="all"&&c.jsxs("label",{className:"agentsel-mine",children:[c.jsx("input",{type:"checkbox",checked:y,onChange:W=>w(W.target.checked)}),"只看我创建的"]})]}),A&&c.jsx("div",{className:"agentsel-error",children:A}),c.jsxs("div",{className:"agentsel-listwrap",children:[G.length===0&&!N?c.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):c.jsx("ul",{className:"agentsel-list",children:G.map(W=>{const oe=Y.has(W.runtimeId),he=M===W.runtimeId,J=(a==null?void 0:a.runtimeId)===W.runtimeId,ce=(U==null?void 0:U.runtimeId)===W.runtimeId;return c.jsx("li",{children:c.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${J?"active":""} ${ce?"is-previewed":""}`,title:W.runtimeId,children:[c.jsx(WL,{}),c.jsxs("div",{className:"agentsel-item-main",children:[c.jsx("span",{className:"agentsel-item-name",title:W.name,children:W.name}),c.jsxs("div",{className:"agentsel-item-meta",children:[c.jsx("span",{className:`agentsel-status is-${oe?"bad":CZ(W.status)}`,children:oe?"不支持":GL(W.status)}),W.isMine&&c.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),c.jsxs("div",{className:"agentsel-item-actions",children:[c.jsx("button",{type:"button",className:"agentsel-connect",disabled:he||J,onClick:()=>re(W),children:he?"连接中…":J?"已连接":oe?"重试":"连接"}),c.jsx("button",{type:"button",className:`agentsel-info ${ce?"active":""}`,"aria-label":`查看 ${W.name} 信息`,"aria-pressed":ce,title:"查看信息",onClick:()=>S(W),children:c.jsx(Bl,{className:"icon"})})]})]})},W.runtimeId)})}),N&&c.jsxs("div",{className:"agentsel-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]})]}),c.jsxs("div",{className:"agentsel-pager",children:[c.jsx("button",{disabled:y||p===0||N,onClick:()=>void H(p-1),"aria-label":"上一页",children:c.jsx(lF,{className:"icon"})}),c.jsx("span",{className:"agentsel-pager-label",children:y?1:p+1}),c.jsx("button",{disabled:y||!ee||N,onClick:()=>void H(p+1),"aria-label":"下一页",children:c.jsx(Xn,{className:"icon"})})]})]})]}),r==="cloud"&&U&&c.jsx(kZ,{runtime:U,tab:L,onTabChange:O})]})]})}const _Z={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function TZ(e){return _Z[e.toLowerCase()]??e}function NZ(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function kZ({runtime:e,tab:t,onTabChange:n}){return c.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[c.jsx("div",{className:"agentsel-head agentsel-preview-head",children:c.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[c.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),c.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),c.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),c.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:c.jsx(SZ,{runtime:e})}),c.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:c.jsx(AZ,{runtime:e})})]})}function SZ({runtime:e}){const[t,n]=v.useState(null),[r,s]=v.useState(!0),[i,a]=v.useState(""),o=e.runtimeId,l=e.region;v.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),WI(o,l).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(qL(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[o,l]);const u=(t==null?void 0:t.components)??[];return c.jsx("div",{className:"agentsel-detail-body",children:r?c.jsxs("div",{className:"agentsel-panel-state",children:[c.jsx(bt,{className:"icon spin"})," 读取 Agent 信息…"]}):i?c.jsxs("div",{className:"agentsel-panel-empty",children:[c.jsx("span",{children:"暂时无法读取 Agent 信息"}),c.jsx("small",{title:i,children:i})]}):t?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"agentsel-identity",children:[c.jsx(Hu,{className:"agentsel-identity-icon"}),c.jsxs("div",{className:"agentsel-identity-copy",children:[c.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&c.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsx("h3",{children:"描述"}),c.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&c.jsx(DN,{icon:c.jsx(MI,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&c.jsx(DN,{icon:c.jsx(yZ,{}),title:"工具",values:t.tools}),t.skills.length>0&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[c.jsx(bZ,{})," 技能"]}),c.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>c.jsxs("div",{className:"agentsel-info-list-item",children:[c.jsx("strong",{title:d.name,children:d.name}),d.description&&c.jsx("span",{title:d.description,children:d.description})]},d.name))})]}),u.length>0&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[c.jsx(_I,{className:"icon"})," 挂载组件"]}),c.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>c.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[c.jsxs("div",{className:"agentsel-component-head",children:[c.jsx("strong",{title:d.name,children:d.name}),c.jsxs("span",{children:[TZ(d.kind),d.backend?` · ${NZ(d.backend)}`:""]})]}),d.description&&c.jsx("span",{title:d.description,children:d.description})]},`${d.kind}:${d.name}:${f}`))})]}),!t.description&&t.subAgents.length===0&&t.tools.length===0&&t.skills.length===0&&u.length===0&&c.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function DN({icon:e,title:t,values:n}){return c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[e,t]}),c.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>c.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function AZ({runtime:e}){const[t,n]=v.useState(null),[r,s]=v.useState(!0),[i,a]=v.useState(""),o=e.runtimeId,l=e.region;v.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),ME(o,l).then(f=>d&&n(f)).catch(f=>d&&a(qL(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[o,l]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",GL(t.status)]),t.region&&u.push(["区域",wZ(t.region)]);const d=t.resources,f=[d.cpuMilli!=null?`CPU ${d.cpuMilli}m`:"",d.memoryMb!=null?`内存 ${d.memoryMb}MB`:"",d.minInstance!=null||d.maxInstance!=null?`实例 ${d.minInstance??"?"}~${d.maxInstance??"?"}`:""].filter(Boolean).join(" · ");f&&u.push(["资源",f]),t.currentVersion!=null&&u.push(["版本",String(t.currentVersion)])}return c.jsxs("div",{className:"agentsel-detail-body",children:[c.jsxs("div",{className:"agentsel-runtime-identity",children:[c.jsx(WL,{}),c.jsxs("div",{children:[c.jsx("strong",{title:e.name,children:e.name}),c.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?c.jsxs("div",{className:"agentsel-apps-note",children:[c.jsx(bt,{className:"icon spin"})," 读取详情…"]}):i?c.jsx("div",{className:"agentsel-error",children:i}):t?c.jsxs(c.Fragment,{children:[c.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>c.jsxs("div",{className:"agentsel-kv-row",children:[c.jsx("dt",{children:d}),c.jsx("dd",{children:f})]},d))}),t.envs.length>0&&c.jsxs("div",{className:"agentsel-envs",children:[c.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>c.jsxs("div",{className:"agentsel-env",children:[c.jsx("span",{className:"agentsel-env-k",children:d.key}),c.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function CZ(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}const IZ={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function GL(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return IZ[t]??(e||"-")}const ux="/assets/volcengine-DM14a-L-.svg",PN="(max-width: 860px)",RZ=54;function OZ(){return c.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M12.5 3 5.5 13h5l-1 8 8-11h-5l.5-7z",fill:"currentColor",stroke:"none"}),c.jsx("path",{d:"M19 4.5v3M17.5 6h3",opacity:"0.85"})]})}function LZ(){return c.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("circle",{cx:"8.25",cy:"7.75",r:"3.15"}),c.jsx("path",{d:"M2.9 19.2c.45-3.45 2.48-5.35 5.35-5.35 2.4 0 4.2 1.28 4.98 3.66"}),c.jsx("path",{d:"M17.4 4.5v15M14.8 9h5.2M14.8 15.3h5.2"}),c.jsx("circle",{cx:"17.4",cy:"9",r:"1.15",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"17.4",cy:"15.3",r:"1.15",fill:"currentColor",stroke:"none"})]})}function MZ(e){let t=2166136261;for(const r of e)t^=r.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const DZ={admin:"管理员",developer:"开发者",user:"普通用户"};function jN({role:e}){const t=DZ[e];return c.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function PZ({access:e,userInfo:t,onLogout:n}){const[r,s]=v.useState(!1),[i,a]=v.useState("");if(!t)return null;const o=JF(t),l=typeof t.email=="string"?t.email:"",u=(o||"U").slice(0,1).toUpperCase(),d=MZ(o||l||u),f=eU(t),h=f===i?"":f;return c.jsxs("div",{className:"sidebar-user",children:[c.jsxs("button",{className:"sidebar-user-btn",onClick:()=>s(p=>!p),title:l?`${o} +${l}`:o,children:[c.jsxs("span",{className:`account-avatar${h?" has-image":""}`,style:d,children:[u,h?c.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),c.jsxs("span",{className:"sidebar-user-identity",children:[c.jsxs("span",{className:"sidebar-user-primary",children:[c.jsx("span",{className:"sidebar-user-name",children:o}),c.jsx(jN,{role:e.role})]}),l&&l!==o&&c.jsx("span",{className:"sidebar-user-email",children:l})]})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>s(!1)}),c.jsxs("div",{className:"account-pop sidebar-user-pop",children:[c.jsxs("div",{className:"account-head",children:[c.jsxs("span",{className:`account-avatar account-avatar--lg${h?" has-image":""}`,style:d,children:[u,h?c.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),c.jsxs("div",{className:"account-id",children:[c.jsxs("div",{className:"account-name-row",children:[c.jsx("div",{className:"account-name",children:o}),c.jsx(jN,{role:e.role})]}),l&&l!==o&&c.jsx("div",{className:"account-sub",children:l})]})]}),c.jsxs("button",{className:"account-logout",onClick:()=>{s(!1),n()},children:[c.jsx(AF,{className:"icon"})," 退出登录"]})]})]})]})}function jZ({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,agentsSource:a="local",localApps:o=[],currentAgentId:l="",currentAgentLabel:u="",currentRuntime:d,onSelectAgent:f,onNewChat:h,onSearch:p,onQuickCreate:m,onSkillCenter:y,onAddAgent:w,onManageAgents:g,onPickSession:E,onDeleteSession:b,userInfo:_,onLogout:N}){const T=L=>(r==null?void 0:r[L])!==!1,[A,k]=v.useState(null),[R,I]=v.useState(!1),M=v.useRef(typeof window<"u"&&window.matchMedia(PN).matches),[B,Y]=v.useState(M.current),P=()=>{I(L=>!L)},U=[...t].sort((L,O)=>(O.lastUpdateTime??0)-(L.lastUpdateTime??0)),C=()=>{M.current=!1,Y(L=>!L),I(!1),k(null)};return v.useEffect(()=>{const L=window.matchMedia(PN),O=j=>{j.matches?Y(S=>S||(M.current=!0,!0)):M.current&&(M.current=!1,Y(!1))};return L.addEventListener("change",O),()=>L.removeEventListener("change",O)},[]),c.jsxs("aside",{className:`sidebar ${B?"is-collapsed":""}`,children:[c.jsxs("div",{className:"sidebar-top",children:[c.jsxs("div",{className:"sidebar-brand-row",children:[c.jsxs("div",{className:"brand",children:[c.jsx("img",{className:"brand-logo",src:e.logoUrl||ux,width:20,height:20,alt:"","aria-hidden":!0}),c.jsx("span",{className:"brand-title",children:e.title})]}),c.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:C,"aria-label":B?"展开侧边栏":"收起侧边栏",title:B?"展开侧边栏":"收起侧边栏",children:B?c.jsx(LF,{className:"icon"}):c.jsx(OF,{className:"icon"})})]}),f&&(()=>{const L=a==="cloud"&&!l,O=a==="cloud"&&!L&&!!d,j=a==="cloud"&&!L&&(d!=null&&d.region)?d.region==="cn-beijing"?"北京":d.region==="cn-shanghai"?"上海":d.region:"";return c.jsxs("button",{className:`agent-row ${L?"agent-row--empty":""} ${O?"agent-row--connected":""}`,onClick:P,"aria-label":L?"请选择 Agent":u||"选择 Agent",title:"切换 Agent",children:[c.jsx(Hu,{className:"icon agent-row-lead"}),c.jsx("span",{className:"agent-row-name",children:L?"请选择 Agent":u||"选择 Agent"}),j&&c.jsx("span",{className:"agent-row-region",children:j}),c.jsx(Xn,{className:`icon agent-row-chev ${R?"open":""}`})]})})(),f&&c.jsx(vZ,{open:R,onClose:()=>I(!1),anchorTop:RZ,agentsSource:a,localApps:o,currentId:l,currentRuntime:d,runtimeScope:s.capabilities.runtimeScope,onSelect:f}),T("newChat")&&c.jsxs("button",{className:"new-chat",onClick:h,"aria-label":"新会话",title:"新会话",children:[c.jsx(ms,{className:"icon"}),c.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),T("search")&&c.jsx(fZ,{onClick:p}),T("skillCenter")&&c.jsx(tZ,{onClick:y}),s.capabilities.createAgents&&T("addAgent")&&c.jsxs("button",{className:"new-chat",onClick:m,"aria-label":"添加 Agent",title:"添加 Agent",children:[c.jsx(OZ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"添加 Agent"})]}),s.capabilities.manageAgents&&T("manageAgents")&&c.jsxs("button",{className:"new-chat",onClick:g,"aria-label":"管理 Agent",title:"管理 Agent",children:[c.jsx(LZ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"管理 Agent"})]})]}),T("history")&&c.jsxs("div",{className:"sidebar-history",children:[c.jsxs("div",{className:"history-head",children:[c.jsx("span",{children:"历史会话"}),T("newChat")&&c.jsx("button",{type:"button",className:"history-new-chat",onClick:h,"aria-label":"新建会话",title:"新建会话",children:c.jsx(ms,{className:"icon"})})]}),c.jsxs("div",{className:"history-list",children:[U.length===0&&c.jsx("div",{className:"history-empty",children:"暂无会话"}),U.map(L=>{const O=oR(L.events);return c.jsxs("div",{className:`history-item ${L.id===n?"active":""}`,children:[c.jsxs("button",{className:"history-item-btn",onClick:()=>E(L.id),title:O,children:[(i==null?void 0:i.has(L.id))&&c.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),c.jsx("span",{className:"history-title",children:O})]}),c.jsx("button",{className:"history-more",title:"更多",onClick:()=>k(j=>j===L.id?null:L.id),children:c.jsx(fF,{className:"icon"})}),A===L.id&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>k(null)}),c.jsx("div",{className:"history-menu",children:c.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{k(null),b(L.id)},children:[c.jsx(Fl,{className:"icon"})," 删除"]})})]})]},L.id)})]})]}),c.jsx(PZ,{access:s,userInfo:_,onLogout:N})]})}function BZ({apps:e,appName:t,onAppChange:n,agentLabel:r,title:s,crumbs:i,rightContent:a}){return c.jsxs("div",{className:"navbar",children:[c.jsxs("div",{className:"navbar-left",children:[c.jsx("div",{className:"navbar-default",children:i&&i.length>0?c.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:i.map((o,l)=>c.jsxs(v.Fragment,{children:[l>0&&c.jsx(Xn,{className:"crumb-sep"}),o.onClick?c.jsx("button",{className:"crumb crumb-link",onClick:o.onClick,children:o.label}):c.jsx("span",{className:"crumb crumb-current",children:o.label})]},l))}):s?c.jsx("div",{className:"navbar-title",title:s,children:s}):c.jsx(FZ,{apps:e,appName:t,onAppChange:n,agentLabel:r})}),c.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),c.jsxs("div",{className:"navbar-right",children:[c.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),a]})]})}function FZ({apps:e,appName:t,onAppChange:n,agentLabel:r}){const[s,i]=v.useState(!1),[a,o]=v.useState(null),[l,u]=v.useState({}),[d,f]=v.useState(0),h=v.useRef({}),p=w=>r?r(w):w;function m(w){o(w);const g=h.current[w];if(g){const E=g.getBoundingClientRect(),b=g.closest(".agent-dd");if(b){const _=b.getBoundingClientRect();f(E.top-_.top)}}l[w]===void 0&&(u(E=>({...E,[w]:"loading"})),hd(w).then(E=>u(b=>({...b,[w]:E}))).catch(()=>u(E=>({...E,[w]:"error"}))))}function y(){i(!1),o(null)}return c.jsxs("div",{className:"agent-dd",children:[c.jsxs("button",{className:"agent-dd-trigger",onClick:()=>i(w=>!w),children:[c.jsx("span",{className:"agent-dd-current",children:t?p(t):"选择 Agent"}),c.jsx(op,{className:`agent-dd-chev ${s?"open":""}`})]}),s&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:y}),c.jsx("div",{className:"agent-dd-menu",children:e.map(w=>c.jsx("div",{ref:g=>h.current[w]=g,className:"agent-dd-row",onMouseEnter:()=>m(w),onMouseLeave:()=>o(g=>g===w?null:g),children:c.jsxs("button",{className:`agent-dd-item ${w===t?"active":""}`,onClick:()=>{n(w),y()},children:[c.jsx("span",{className:"agent-dd-item-name",children:p(w)}),w===t&&c.jsx("span",{className:"agent-dd-item-dot","aria-label":"当前"})]})},w))}),a&&c.jsx(UZ,{state:l[a],top:d})]})]})}function UZ({state:e,top:t}){return c.jsx("div",{className:"agent-dd-flyout",style:{top:`${t}px`},children:e===void 0||e==="loading"?c.jsxs("div",{className:"agent-dd-fly-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]}):e==="error"?c.jsx("div",{className:"agent-dd-fly-loading",children:"读取信息失败"}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"agent-dd-fly-name",children:e.name}),e.description&&c.jsx("div",{className:"agent-dd-fly-desc",children:e.description}),c.jsxs("div",{className:"agent-dd-fly-field",children:[c.jsx(NI,{className:"icon"}),c.jsx("span",{className:"agent-dd-fly-model",children:e.model})]}),e.tools.length>0&&c.jsxs("div",{className:"agent-dd-fly-field agent-dd-fly-field--tools",children:[c.jsx(CE,{className:"icon"}),c.jsx("div",{className:"agent-dd-fly-chips",children:e.tools.map(n=>c.jsx("span",{className:"agent-dd-chip",children:n},n))})]}),e.subAgents.length>0&&c.jsxs("div",{className:"agent-dd-fly-field",children:[c.jsx("span",{className:"agent-dd-fly-label",children:"子 Agent"}),c.jsx("span",{className:"agent-dd-fly-model",children:e.subAgents.join("、")})]})]})})}const BN={llm:{icon:Ha,label:"LLM"},sequential:{icon:II,label:"顺序"},parallel:{icon:PI,label:"并行"},loop:{icon:AE,label:"循环"},a2a:{icon:um,label:"A2A"}};function XL(e){return 1+e.children.reduce((t,n)=>t+XL(n),0)}function xl(e){return e.id||e.name}function $Z(e,t){const n=xl(e);if(e.id&&e.name&&e.name!==n)return e.name;if(t&&n==="agent")return"主 Agent";const r=/^agent_sub_(\d+)$/.exec(n);return r?`子 Agent ${r[1]}`:e.name||n}function QL(e,t=!0){return{...e,id:xl(e),name:$Z(e,t),children:e.children.map(n=>QL(n,!1))}}function ZL(e,t){t.set(xl(e),e.name||xl(e)),e.children.forEach(n=>ZL(n,t))}function JL({node:e,activeAgent:t,seen:n,path:r}){const s=BN[e.type]??BN.llm,i=s.icon,a=xl(e),o=!!a,l=o&&a===t,u=o&&!l&&r.has(a),d=o&&!l&&!u&&n.has(a);return c.jsxs("div",{className:"topo-branch",children:[c.jsxs("div",{className:`topo-node topo-type-${e.type} ${l?"is-active":""} ${u?"is-onpath":""} ${d?"is-done":""}`,title:e.description||e.name,children:[c.jsx(i,{className:"topo-icon"}),c.jsx("span",{className:"topo-name",children:e.name||"(未命名)"}),c.jsx("span",{className:"topo-badge",children:s.label})]}),l&&e.type==="a2a"&&c.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&c.jsx("div",{className:"topo-children",children:e.children.map((f,h)=>c.jsx(JL,{node:f,activeAgent:t,seen:n,path:r},`${xl(f)}-${h}`))})]})}function FN({appName:e,activeAgent:t,seenAgents:n,execPath:r=[]}){const[s,i]=v.useState(null);if(v.useEffect(()=>{let l=!1;if(i(null),!!e)return hd(e).then(u=>{l||i(u.graph?QL(u.graph):null)}).catch(()=>{l||i(null)}),()=>{l=!0}},[e]),!s||s.children.length===0)return null;const a=new Set(r),o=new Map;return ZL(s,o),c.jsxs("aside",{className:"topo","aria-label":"Agent 拓扑",children:[c.jsxs("div",{className:"topo-head",children:[c.jsx("span",{className:"topo-head-title",children:"Agent 拓扑"}),c.jsxs("span",{className:"topo-head-sub",children:[XL(s)," 个"]})]}),r.length>0&&c.jsx("div",{className:"topo-path","aria-label":"执行路径",children:r.map((l,u)=>c.jsxs("span",{className:"topo-path-seg",children:[u>0&&c.jsx(Xn,{className:"topo-path-sep"}),c.jsx("span",{className:u===r.length-1?"topo-path-name is-current":"topo-path-name",children:o.get(l)??l})]},`${l}-${u}`))}),c.jsx("div",{className:"topo-tree",children:c.jsx(JL,{node:s,activeAgent:t,seen:n,path:a})})]})}function HZ({onAdded:e,onCancel:t}){const[n,r]=v.useState(""),[s,i]=v.useState(""),[a,o]=v.useState(""),[l,u]=v.useState(!1),[d,f]=v.useState(""),h=n.trim().length>0&&s.trim().length>0&&!l;async function p(){if(h){u(!0),f("");try{const m=await KL(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(Ka(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return c.jsx("div",{className:"addagent",children:c.jsxs("div",{className:"addagent-card",children:[c.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),c.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),c.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"API Key"}),c.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),c.jsx("input",{className:"addagent-input",value:a,onChange:m=>o(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&c.jsx("div",{className:"addagent-error",children:d}),c.jsxs("div",{className:"addagent-actions",children:[c.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:l,children:"取消"}),c.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[l?c.jsx(bt,{className:"icon spin"}):null,l?"连接中…":"连接并添加"]})]})]})})}function zZ({currentRuntimeId:e,onConnect:t}){const[n,r]=v.useState([]),[s,i]=v.useState(!0),[a,o]=v.useState(""),[l,u]=v.useState(null),[d,f]=v.useState(null),[h,p]=v.useState(null),[m,y]=v.useState({}),[w,g]=v.useState("cn-beijing"),[E,b]=v.useState(!1),_=v.useCallback(async()=>{i(!0),o("");try{r(await QI(w))}catch(R){o(R instanceof Error?R.message:String(R))}finally{i(!1)}},[w]);v.useEffect(()=>{_()},[_]);async function N(R){y(M=>({...M,[R.runtimeId]:{loading:!0}}));const I={loading:!1};try{I.detail=await ME(R.runtimeId,R.region)}catch(M){I.error=M instanceof Error?M.message:String(M)}I.detail&&(I.graphs=[{name:I.detail.name,description:I.detail.description,type:"llm",model:I.detail.model,tools:[],skills:[],path:[I.detail.name],mentionable:!1,children:[]}],I.graphNote="仅显示主 Agent(控制面信息)。"),y(M=>({...M,[R.runtimeId]:I}))}function T(R){const I=h===R.runtimeId;p(I?null:R.runtimeId),!I&&!m[R.runtimeId]&&N(R)}async function A(R){if(!l&&window.confirm(`确定删除 Agent "${R.name}"?该 Runtime 将被永久删除。`)){u(R.runtimeId),o("");try{await nR(R.runtimeId,R.region),r(I=>I.filter(M=>M.runtimeId!==R.runtimeId))}catch(I){o(I instanceof Error?I.message:String(I))}finally{u(null)}}}async function k(R){if(!(d||e===R.runtimeId)){f(R.runtimeId),o("");try{await t(R)}catch(I){o(I instanceof Error?I.message:String(I))}finally{f(null)}}}return c.jsxs("div",{className:"manage",children:[c.jsxs("div",{className:"manage-head",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"manage-title",children:"管理 Agent"}),c.jsx("p",{className:"manage-sub",children:"列出你有权管理的 AgentKit Runtime"})]}),c.jsxs("div",{className:"manage-head-actions",children:[c.jsxs("div",{className:"manage-region-picker",onKeyDown:R=>{R.key==="Escape"&&b(!1)},children:[c.jsxs("button",{type:"button",className:"manage-region",onClick:()=>b(R=>!R),title:"按区域筛选","aria-label":"区域筛选","aria-haspopup":"listbox","aria-expanded":E,children:[c.jsx("span",{children:w==="cn-beijing"?"北京":"上海"}),c.jsx(op,{className:`manage-region-chevron${E?" is-open":""}`})]}),E&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>b(!1)}),c.jsx("div",{className:"manage-region-menu",role:"listbox","aria-label":"区域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(R=>{const I=R.value===w;return c.jsxs("button",{type:"button",role:"option","aria-selected":I,className:`manage-region-option${I?" is-selected":""}`,onClick:()=>{g(R.value),b(!1)},children:[c.jsx("span",{children:R.label}),I&&c.jsx(Bs,{"aria-hidden":"true"})]},R.value)})})]})]}),c.jsxs("button",{type:"button",className:"manage-refresh",onClick:()=>void _(),disabled:s,title:"刷新",children:[c.jsx(dm,{className:`icon ${s?"spin":""}`}),"刷新"]})]})]}),a&&c.jsx("div",{className:"manage-error",children:a}),s?c.jsxs("div",{className:"manage-empty",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]}):n.length===0?c.jsx("div",{className:"manage-empty",children:"暂无你部署的 Agent。"}):c.jsx("ul",{className:"manage-list",children:n.map(R=>{const I=h===R.runtimeId,M=m[R.runtimeId];return c.jsxs("li",{className:"manage-item",children:[c.jsxs("div",{className:"manage-item-row",children:[c.jsxs("button",{type:"button",className:"manage-item-toggle",onClick:()=>T(R),"aria-expanded":I,children:[I?c.jsx(op,{className:"icon"}):c.jsx(Xn,{className:"icon"}),c.jsxs("span",{className:"manage-item-main",children:[c.jsx("span",{className:"manage-item-name",children:R.name}),c.jsx("span",{className:`manage-badge is-${qZ(R.status)}`,children:R.status||"-"})]})]}),c.jsxs("div",{className:"manage-item-actions",children:[c.jsxs("button",{type:"button",className:"manage-connect",onClick:()=>void k(R),disabled:d!==null||e===R.runtimeId,children:[d===R.runtimeId?c.jsx(bt,{className:"icon spin"}):c.jsx(TF,{className:"icon"}),e===R.runtimeId?"已连接":"连接到此 Agent"]}),c.jsx("button",{type:"button",className:"manage-del",onClick:()=>void A(R),disabled:l===R.runtimeId,title:"删除该 Runtime",children:l===R.runtimeId?c.jsx(bt,{className:"icon spin"}):c.jsx(Fl,{className:"icon"})})]})]}),c.jsxs("div",{className:"manage-item-meta",children:[c.jsx("span",{className:"manage-item-id",title:R.runtimeId,children:R.runtimeId}),c.jsx("span",{className:"manage-item-dot",children:"·"}),c.jsx("span",{children:R.region}),R.createdAt&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"manage-item-dot",children:"·"}),c.jsx("span",{children:tM(R.createdAt)})]})]}),I&&c.jsx("div",{className:"manage-detail",children:!M||M.loading?c.jsxs("div",{className:"manage-detail-loading",children:[c.jsx(bt,{className:"icon spin"})," 读取详情…"]}):c.jsxs(c.Fragment,{children:[M.error&&c.jsx("div",{className:"manage-error",children:M.error}),M.detail&&c.jsx(YZ,{detail:M.detail}),c.jsx("div",{className:"manage-tree-head",children:"Agent 结构"}),M.graphs&&M.graphs.length>0?M.graphs.map((B,Y)=>c.jsx(eM,{node:B},Y)):c.jsx("div",{className:"manage-tree-note",children:M.graphNote})]})})]},R.runtimeId)})})]})}const VZ=/KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL/i;function KZ({envKey:e,value:t}){const[n,r]=v.useState(!1);return!VZ.test(e)||n?c.jsx("code",{className:"manage-env-v",children:t}):c.jsx("button",{type:"button",className:"manage-env-v manage-env-masked",title:"敏感值已隐藏,点击显示","aria-label":`显示 ${e} 的值`,onClick:()=>r(!0),children:"••••••••"})}function YZ({detail:e}){const t=e.resources,n=[];e.model&&n.push(["模型",e.model]),e.description&&n.push(["描述",e.description]),e.statusMessage&&n.push(["状态信息",e.statusMessage]),e.project&&n.push(["Project",e.project]),e.currentVersion!=null&&n.push(["版本",String(e.currentVersion)]);const r=[t.cpuMilli!=null?`CPU ${t.cpuMilli}m`:"",t.memoryMb!=null?`内存 ${t.memoryMb}MB`:"",t.minInstance!=null||t.maxInstance!=null?`实例 ${t.minInstance??"?"}~${t.maxInstance??"?"}`:"",t.maxConcurrency!=null?`并发 ${t.maxConcurrency}`:""].filter(Boolean).join(" · ");return r&&n.push(["资源",r]),e.memoryId&&n.push(["Memory",e.memoryId]),e.toolId&&n.push(["Tool",e.toolId]),e.knowledgeId&&n.push(["Knowledge",e.knowledgeId]),e.mcpToolsetId&&n.push(["MCP Toolset",e.mcpToolsetId]),e.updatedAt&&n.push(["更新时间",tM(e.updatedAt)]),c.jsxs("div",{className:"manage-detail-card",children:[c.jsx("dl",{className:"manage-kv",children:n.map(([s,i])=>c.jsxs("div",{className:"manage-kv-row",children:[c.jsx("dt",{children:s}),c.jsx("dd",{children:i})]},s))}),e.envs.length>0&&c.jsxs("div",{className:"manage-envs",children:[c.jsx("div",{className:"manage-envs-head",children:"环境变量"}),e.envs.map(s=>c.jsxs("div",{className:"manage-env",children:[c.jsx("code",{className:"manage-env-k",children:s.key}),c.jsx(KZ,{envKey:s.key,value:s.value})]},s.key))]})]})}const WZ={llm:"LLM",sequential:"Sequential",parallel:"Parallel",loop:"Loop",a2a:"A2A"};function eM({node:e,depth:t=0}){return c.jsxs("div",{className:"manage-tree",style:{marginLeft:t?16:0},children:[c.jsxs("div",{className:"manage-tree-node",children:[c.jsx("span",{className:"manage-tree-name",children:e.name||"(未命名)"}),c.jsx("span",{className:"manage-tree-type",children:WZ[e.type]||e.type}),e.model&&c.jsx("span",{className:"manage-tree-model",children:e.model})]}),e.tools.length>0&&c.jsx("div",{className:"manage-tree-tools",children:e.tools.map(n=>c.jsx("span",{className:"manage-tree-tool",children:n},n))}),e.children.map((n,r)=>c.jsx(eM,{node:n,depth:t+1},r))]})}function qZ(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}function tM(e){const t=Number(e),n=Number.isFinite(t)&&String(t)===e?new Date(t*1e3):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()}const GZ={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function XZ(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(const s of n){if(r==null||typeof r!="object")return;r=r[s]}return r}function QZ(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function ZZ(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dx(e,t){if(QZ(e))return XZ(t,e.path);if(ZZ(e)){const n=GZ[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=dx(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function JZ(e,t){const n=dx(e,t);return n==null?"":typeof n=="string"?n:String(n)}const nM=new Map;function io(e,t){nM.set(e,t)}function eJ(e){return nM.get(e)}function tJ(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;idx(r,e.dataModel),resolveString:r=>JZ(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=eJ(s.component)??nJ;return c.jsx(i,{node:s,ctx:n},r)}};return c.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function sM(e){const t=v.useRef(null),n=v.useRef(!0),r=28,s=v.useCallback(()=>{const i=t.current;i&&(n.current=i.scrollHeight-i.scrollTop-i.clientHeight{const i=t.current;i&&n.current&&(i.scrollTop=i.scrollHeight)},[e]),{ref:t,onScroll:s}}function fx({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:c.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>c.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[c.jsx(za,{"aria-hidden":!0}),c.jsxs("span",{children:["/",r.name]}),t?c.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:c.jsx(Xr,{})}):null]},r.name)),e.targetAgent?c.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[c.jsx(vI,{"aria-hidden":!0}),c.jsx("span",{children:e.targetAgent.name}),n?c.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:c.jsx(Xr,{})}):null]}):null]})}function hx(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function iM(e){var n,r,s,i;const t=hx(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((r=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:r.toUpperCase())??"VIDEO":t==="image"?((i=(s=e.mimeType)==null?void 0:s.split("/")[1])==null?void 0:i.toUpperCase())??"IMAGE":"TXT"}function aM(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function oM(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?VI(t,e.uri):""}function sJ({kind:e}){return e==="image"?c.jsx(RI,{}):e==="video"?c.jsx(AI,{}):e==="pdf"?c.jsx(gF,{}):c.jsx(SI,{})}function px({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=v.useState(null);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const o=hx(a.mimeType),l=oM(a,e),u=a.status==="uploading"||a.status==="error"||!l,d=c.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[o==="image"&&l?c.jsx("img",{className:"media-card-image",src:l,alt:a.name??"图片",loading:"lazy"}):o==="video"&&l?c.jsxs("div",{className:"media-card-video-container",children:[c.jsx("video",{className:"media-card-video",src:l,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),c.jsx("span",{className:"media-card-video-play",children:c.jsx(DF,{})})]}):c.jsx("span",{className:"media-card-icon",children:c.jsx(sJ,{kind:o})}),c.jsxs("span",{className:"media-card-copy",children:[c.jsx("span",{className:"media-card-name",children:a.name??"附件"}),c.jsxs("span",{className:"media-card-meta",children:[c.jsx("span",{className:"media-card-type",children:iM(a)}),a.status==="uploading"?c.jsxs(c.Fragment,{children:[c.jsx(bt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":aM(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?c.jsx(Gc,{className:"media-card-open"}):null]});return c.jsxs(Gt.div,{className:`media-card media-card--${o}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[o==="image"&&!u?c.jsx(yI,{src:l,children:d}):d,r?c.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:c.jsx(Xr,{})}):null]},a.id)})}),c.jsx(Hi,{children:s?c.jsx(iJ,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function iJ({appName:e,item:t,onClose:n}){const r=v.useMemo(()=>oM(t,e),[e,t]),s=hx(t.mimeType),[i,a]=v.useState(""),[o,l]=v.useState(s==="text"||s==="markdown"),[u,d]=v.useState("");return v.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),v.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const f=new AbortController;return l(!0),d(""),fetch(r,{signal:f.signal}).then(h=>{if(!h.ok)throw new Error(`HTTP ${h.status}`);return h.text()}).then(a).catch(h=>{f.signal.aborted||d(h instanceof Error?h.message:String(h))}).finally(()=>{f.signal.aborted||l(!1)}),()=>f.abort()},[s,r]),c.jsx(Gt.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":t.name??"附件预览",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&n()},children:c.jsxs(Gt.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[c.jsxs("header",{className:"media-viewer-header",children:[c.jsxs("div",{children:[c.jsx("strong",{children:t.name??"附件"}),c.jsxs("span",{children:[iM(t),t.sizeBytes?` · ${aM(t.sizeBytes)}`:""]})]}),c.jsxs("nav",{children:[c.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:c.jsx(NE,{})}),c.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:c.jsx(Xr,{})})]})]}),c.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?c.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?c.jsx("div",{className:"media-viewer-video-wrapper",children:c.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?c.jsx("iframe",{src:r,title:t.name??"PDF"}):null,o?c.jsxs("div",{className:"media-viewer-loading",children:[c.jsx(bt,{})," 正在读取文档…"]}):null,!o&&u?c.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!o&&s==="markdown"?c.jsx("div",{className:"media-document",children:c.jsx(_d,{text:i})}):null,!o&&s==="text"?c.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Yl({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const o=Math.min(Math.max(r,5),45);return c.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-o}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+o}%)`,animationDuration:`${n}s`},...a,children:s})}function aJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),c.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function oJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),c.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),c.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),c.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function lJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"3.25",y:"5.5",width:"16.25",height:"13",rx:"2.4"}),c.jsx("path",{d:"m10.2 9.2 4.4 2.8-4.4 2.8V9.2Z"}),c.jsx("path",{d:"m19.25 2.5.42 1.2 1.2.42-1.2.42-.42 1.2-.42-1.2-1.2-.42 1.2-.42.42-1.2Z",fill:"currentColor",stroke:"none"})]})}function cJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),c.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),c.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function uJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),c.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),c.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),c.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function lM(e){return c.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:c.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function dJ({definition:e,done:t,open:n,onToggle:r}){const s=e.icon;return c.jsxs("button",{type:"button",className:`builtin-tool-head${t?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":n,children:[c.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:c.jsx(s,{})}),t?c.jsx("span",{className:"builtin-tool-label",children:e.doneLabel}):c.jsx(Yl,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:e.runningLabel}),c.jsx(lM,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}const fJ={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:aJ},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:oJ},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:lJ},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:cJ},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:uJ}};function hJ(e){return fJ[e]}const cM="send_a2ui_json_to_client";function pJ({className:e}){return c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.jsx("path",{d:"M12 2.2l1.7 5.1a3 3 0 0 0 1.9 1.9L20.8 11l-5.1 1.7a3 3 0 0 0-1.9 1.9L12 19.8l-1.7-5.1a3 3 0 0 0-1.9-1.9L3.2 11l5.1-1.7a3 3 0 0 0 1.9-1.9L12 2.2z"})})}function mJ(){return c.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function uM({text:e,done:t}){const[n,r]=v.useState(!t),s=v.useRef(!1);v.useEffect(()=>{s.current||r(!t)},[t]);const i=()=>{s.current=!0,r(u=>!u)},a=e.replace(/^\s+/,""),{ref:o,onScroll:l}=sM(a);return c.jsxs("div",{className:"block-thinking",children:[c.jsxs("button",{className:"think-head",onClick:i,type:"button",children:[c.jsx("span",{className:"think-icon","aria-hidden":"true",children:c.jsx(pJ,{className:`spark ${t?"":"pulse"}`})}),t?c.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):c.jsx(Yl,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),c.jsx(Xn,{className:`chev ${n?"open":""}`})]}),c.jsx("div",{className:`think-collapse ${n&&a?"open":""}`,children:c.jsx("div",{className:"think-collapse-inner",children:c.jsx("div",{className:"think-body scroll",ref:o,onScroll:l,children:a})})})]})}function dM(){return c.jsx(uM,{text:"",done:!1})}function gJ({name:e,args:t,response:n,done:r}){const[s,i]=v.useState(!1),a=e===cM?"渲染 UI":e,o=hJ(e),l=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),u=l&&l.length>2e3?l.slice(0,2e3)+` +…(已截断)`:l;return c.jsxs(Gt.div,{className:`block-tool${o?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o?c.jsx(dJ,{definition:o,done:r,open:s,onToggle:()=>i(d=>!d)}):c.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[c.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:c.jsx(mJ,{})}),r?c.jsx("span",{className:"tool-name",children:a}):c.jsx(Yl,{className:"tool-name",duration:2.2,spread:15,children:a}),c.jsx(lM,{className:`tool-chevron${s?" is-open":""}`})]}),c.jsx("div",{className:`think-collapse ${s?"open":""}`,children:c.jsx("div",{className:"think-collapse-inner",children:c.jsxs("div",{className:"tool-detail",children:[t!=null&&c.jsxs("div",{className:"tool-section",children:[c.jsx("div",{className:"tool-section-label",children:"参数"}),c.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&c.jsxs("div",{className:"tool-section",children:[c.jsx("div",{className:"tool-section-label",children:"返回"}),c.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function yJ({block:e,onAuth:t}){const[n,r]=v.useState(e.done?"done":"idle"),[s,i]=v.useState(""),a=e.label||"MCP 工具集",o=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),l=async()=>{if(t){i(""),r("authorizing");try{await t(e),r("done")}catch(d){i(d instanceof Error?d.message:String(d)),r("idle")}}};return e.done||n==="done"?c.jsxs(Gt.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[c.jsx(F_,{className:"auth-card-icon auth-card-icon--done"}),c.jsxs("span",{children:["已授权 · ",a]})]}):c.jsxs(Gt.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[c.jsxs("div",{className:"auth-card-head",children:[c.jsx(F_,{className:"auth-card-icon"}),c.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),c.jsxs("p",{className:"auth-card-desc",children:["工具集 ",c.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",o&&c.jsxs(c.Fragment,{children:[" ","将跳转至 ",c.jsx("code",{className:"auth-card-code",children:o})," 完成登录,"]}),"授权完成后对话自动继续。"]}),c.jsx("button",{className:"auth-card-btn",onClick:l,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?c.jsxs(c.Fragment,{children:[c.jsx(bt,{className:"cw-i spin"})," 等待授权…"]}):c.jsx(c.Fragment,{children:"去授权"})}),!e.authUri&&c.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&c.jsx("div",{className:"auth-card-err",children:s})]})}function mx({blocks:e,appName:t="",onAction:n,onAuth:r}){return c.jsx(c.Fragment,{children:e.map((s,i)=>{switch(s.kind){case"thinking":return c.jsx(uM,{text:s.text,done:s.done},i);case"text":{const a=s.text.replace(/^\s+/,"");return a?c.jsx("div",{className:"bubble",children:c.jsx(_d,{text:a})},i):null}case"attachment":return c.jsx(px,{appName:t,items:s.files},i);case"invocation":return c.jsx(fx,{value:s.value},i);case"tool":return s.name===cM&&s.done?null:c.jsx(gJ,{name:s.name,args:s.args,response:s.response,done:s.done},i);case"auth":return c.jsx(yJ,{block:s,onAuth:r},i);case"a2ui":return rM(s.messages).filter(a=>a.components[a.rootId]).map(a=>c.jsx(Gt.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:c.jsx(rJ,{surface:a,onAction:n})},`${i}-${a.surfaceId}`));default:return null}})})}function bJ(e){return e.isComposing||e.keyCode===229}const _s=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"临时会话",description:"在 AgentKit 沙箱中执行一次性任务"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}];function UN({mode:e}){return e==="skill-create"?c.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M10 2.2l1.35 4.1 4.15 1.35-4.15 1.35L10 13.1 8.65 9 4.5 7.65 8.65 6.3 10 2.2Z"}),c.jsx("path",{d:"M15.6 12.2l.6 1.8 1.8.6-1.8.6-.6 1.8-.6-1.8-1.8-.6 1.8-.6.6-1.8Z"})]}):e==="temporary"?c.jsx("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M4.1 4.2h11.8v8.7H9l-3.5 2.8v-2.8H4.1z",strokeDasharray:"2.25 1.9"})}):c.jsx(Hu,{className:"new-chat-mode__agent-icon"})}function EJ({value:e,agentName:t,onChange:n,disabled:r=!1,temporaryEnabled:s,skillCreateEnabled:i}){const[a,o]=v.useState(!1),[l,u]=v.useState(()=>_s.findIndex(E=>E.value===e)),d=v.useRef(null),f=v.useRef(null),h=_s.find(E=>E.value===e)??_s[0];function p(E){return E.value==="temporary"?s:E.value==="skill-create"?i:!0}function m(E){return p(E)!==!0}function y(E){const b=p(E);return b===void 0?"正在检查配置":b?E.description:"管理员未配置"}v.useEffect(()=>{if(!a)return;const E=b=>{var _;(_=d.current)!=null&&_.contains(b.target)||o(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[a]);function w(E){let b=l;do b=(b+E+_s.length)%_s.length;while(m(_s[b]));u(b)}function g(E){var b;m(E)||(n(E.value),o(!1),(b=f.current)==null||b.focus())}return c.jsxs("div",{className:"new-chat-mode",ref:d,children:[c.jsxs("button",{ref:f,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":a,disabled:r,onClick:()=>{u(_s.findIndex(E=>E.value===e)),o(E=>!E)},onKeyDown:E=>{E.key==="ArrowDown"||E.key==="ArrowUp"?(E.preventDefault(),a?w(E.key==="ArrowDown"?1:-1):o(!0)):a&&(E.key==="Enter"||E.key===" ")?(E.preventDefault(),g(_s[l])):a&&E.key==="Escape"&&(E.preventDefault(),o(!1))},children:[c.jsx("span",{className:"new-chat-mode__icon",children:c.jsx(UN,{mode:h.value})}),c.jsx("span",{className:"new-chat-mode__current",title:h.value==="agent"?t:void 0,children:h.value==="agent"?t:h.label}),c.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:c.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),a?c.jsx("div",{className:"new-chat-mode__menu",role:"listbox","aria-label":"新会话模式",tabIndex:-1,onKeyDown:E=>{var b;E.key==="ArrowDown"||E.key==="ArrowUp"?(E.preventDefault(),w(E.key==="ArrowDown"?1:-1)):E.key==="Enter"?(E.preventDefault(),g(_s[l])):E.key==="Escape"&&(E.preventDefault(),o(!1),(b=f.current)==null||b.focus())},children:_s.map((E,b)=>c.jsxs("button",{type:"button",role:"option","aria-selected":e===E.value,"aria-disabled":m(E),disabled:m(E),className:`new-chat-mode__option${b===l?" is-active":""}`,onMouseEnter:()=>u(b),onClick:()=>g(E),children:[c.jsx("span",{className:"new-chat-mode__option-icon",children:c.jsx(UN,{mode:E.value})}),c.jsxs("span",{className:"new-chat-mode__copy",children:[c.jsxs("span",{className:"new-chat-mode__label",children:[E.value==="agent"?t:E.label,E.value==="skill-create"?c.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),c.jsx("span",{children:y(E)})]}),e===E.value?c.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:c.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},E.value))}):null]})}const gx=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function xJ({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:o,busy:l,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:y=!0,onInvocationChange:w,onAddFiles:g,onRemoveAttachment:E,newChatMode:b="agent",newChatLayout:_=!1,showModeSelector:N=!1,onModeChange:T,temporaryEnabled:A,skillCreateEnabled:k}){const R=v.useRef(null),I=v.useRef(null),M=v.useRef(null),B=v.useRef(null),[Y,P]=v.useState(!1),[U,C]=v.useState(null),[L,O]=v.useState(0),[j,S]=v.useState(!1);async function H(){if(e)try{await navigator.clipboard.writeText(e),S(!0),setTimeout(()=>S(!1),1500)}catch{S(!1)}}v.useLayoutEffect(()=>{const J=R.current;J&&(J.style.height="auto",J.style.height=`${Math.min(J.scrollHeight,200)}px`)},[s]);const V=b==="skill-create";v.useEffect(()=>{V&&(P(!1),C(null))},[V]);const D=!V&&d.some(J=>J.status!=="ready"),ne=!o&&!l&&!D&&(s.trim().length>0||!V&&d.length>0),ee=(U==null?void 0:U.query.toLocaleLowerCase())??"",re=(U==null?void 0:U.kind)==="skill"?f.filter(J=>!p.skills.some(ce=>ce.name===J.name)).filter(J=>`${J.name} ${J.description}`.toLocaleLowerCase().includes(ee)).map(J=>({kind:"skill",value:J})):(U==null?void 0:U.kind)==="agent"?h.filter(J=>`${J.name} ${J.description}`.toLocaleLowerCase().includes(ee)).map(J=>({kind:"agent",value:J})):[];function de(J){var ce;P(!1),C(null),(ce=J.current)==null||ce.click()}function G(J,ce){const Ce=J.slice(0,ce),Ee=/(^|\s)([/@])([^\s/@]*)$/.exec(Ce);if(!Ee){C(null);return}const ge=Ee[2].length+Ee[3].length,Le={kind:Ee[2]==="/"?"skill":"agent",query:Ee[3],start:ce-ge,end:ce},ve=!U||U.kind!==Le.kind||U.query!==Le.query||U.start!==Le.start||U.end!==Le.end;C(Le),ve&&O(0),P(!1)}function W(J){if(!U)return;const ce=s.slice(0,U.start)+s.slice(U.end);i(ce),J.kind==="skill"?w({...p,skills:[...p.skills,J.value]}):w({skills:[],targetAgent:J.value});const Ce=U.start;C(null),requestAnimationFrame(()=>{var Ee,ge;(Ee=R.current)==null||Ee.focus(),(ge=R.current)==null||ge.setSelectionRange(Ce,Ce)})}function oe(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function he(J){const ce=J.target.files?Array.from(J.target.files):[];ce.length&&g(ce),J.target.value=""}return c.jsxs("div",{className:`composer${_?" composer--new-chat":""}`,children:[V?null:c.jsx(fx,{value:p,onRemoveSkill:J=>w({...p,skills:p.skills.filter(ce=>ce.name!==J)}),onRemoveAgent:()=>w({skills:[]})}),!V&&d.length>0&&c.jsx(px,{appName:n,compact:!0,items:d,onRemove:E}),c.jsxs("div",{className:"composer-box",children:[U?c.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":U.kind==="skill"?"可用技能":"可用子 Agent",children:[c.jsxs("div",{className:"composer-command-head",children:[U.kind==="skill"?c.jsx(za,{}):c.jsx(vI,{}),c.jsx("span",{children:U.kind==="skill"?"调用技能":"使用子 Agent"}),c.jsx("kbd",{children:U.kind==="skill"?"/":"@"})]}),m?c.jsxs("div",{className:"composer-command-empty",children:[c.jsx(bt,{className:"spin"})," 正在读取 Agent 能力…"]}):re.length===0?c.jsx("div",{className:"composer-command-empty",children:U.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):c.jsx("div",{className:"composer-command-list",children:re.map((J,ce)=>c.jsxs("button",{type:"button",role:"option","aria-selected":ce===L,className:`composer-command-item${ce===L?" is-active":""}`,onMouseDown:Ce=>{Ce.preventDefault(),W(J)},onMouseEnter:()=>O(ce),children:[c.jsx("span",{className:`composer-command-icon composer-command-icon--${J.kind}`,children:J.kind==="skill"?c.jsx(za,{}):c.jsx(Ha,{})}),c.jsxs("span",{className:"composer-command-copy",children:[c.jsxs("strong",{children:[J.kind==="skill"?"/":"@",J.value.name]}),c.jsx("span",{children:J.value.description||(J.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),c.jsx("kbd",{children:ce===L?"↵":J.kind==="skill"?"技能":"Agent"})]},`${J.kind}-${J.value.name}`))})]}):null,V?null:c.jsxs("div",{className:"composer-menu-wrap",children:[c.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:o||!y,onClick:()=>{C(null),P(J=>!J)},children:c.jsx(ms,{className:"icon"})}),Y&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>P(!1)}),c.jsxs("div",{className:"composer-menu",role:"menu",children:[c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(I),children:[c.jsx(RI,{className:"icon"}),"上传图片"]}),c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(M),children:[c.jsx(SI,{className:"icon"}),"上传文档或 PDF"]}),c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(B),children:[c.jsx(AI,{className:"icon"}),"上传视频"]})]})]})]}),c.jsx("div",{className:"composer-input-stack",children:c.jsx("textarea",{ref:R,className:"comp-input scroll",rows:_?4:1,value:s,disabled:o,placeholder:V?`描述你想创建的 Skill,将使用 ${gx.join(" 和 ")} 并行创建…`:o?"请选择 Agent":`向 ${r} 发消息…`,"aria-expanded":!!U,onChange:J=>{i(J.target.value),V||G(J.target.value,J.target.selectionStart)},onSelect:J=>{V||G(J.currentTarget.value,J.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>C(null),0),onKeyDown:J=>{if(!bJ(J.nativeEvent)){if(U){if(J.key==="ArrowDown"&&re.length>0){J.preventDefault(),O(ce=>(ce+1)%re.length);return}if(J.key==="ArrowUp"&&re.length>0){J.preventDefault(),O(ce=>(ce-1+re.length)%re.length);return}if((J.key==="Enter"||J.key==="Tab")&&re[L]){J.preventDefault(),W(re[L]);return}if(J.key==="Escape"){J.preventDefault(),C(null);return}}if(J.key==="Backspace"&&!s&&J.currentTarget.selectionStart===0&&J.currentTarget.selectionEnd===0){oe();return}J.key==="Enter"&&!J.shiftKey&&(J.preventDefault(),ne&&a())}}})}),N&&T?c.jsx(EJ,{value:b,agentName:r,onChange:T,disabled:l,temporaryEnabled:A,skillCreateEnabled:k}):null,c.jsx(Gt.button,{type:"button",className:"comp-send",disabled:!ne,onClick:a,"aria-label":"发送",whileTap:ne?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:l?c.jsx(bt,{className:"icon spin"}):c.jsx(wI,{className:"icon"})})]}),u&&c.jsxs("div",{className:"composer-meta",children:[c.jsxs("span",{className:"composer-session-line",children:["会话 ID:",c.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&c.jsx("button",{type:"button",className:"composer-session-copy",title:j?"已复制":"复制会话 ID","aria-label":j?"已复制会话 ID":"复制会话 ID",onClick:()=>void H(),children:j?c.jsx(Bs,{}):c.jsx(TE,{})})]}),c.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),c.jsx("span",{children:"回答仅供参考"})]}),c.jsx("input",{ref:I,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:he}),c.jsx("input",{ref:M,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:he}),c.jsx("input",{ref:B,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:he})]})}function fM({title:e,sub:t,cards:n,footer:r}){return c.jsxs("div",{className:"stk",children:[c.jsxs("div",{className:"stk-head",children:[c.jsx("h1",{className:"stk-title",children:e}),t&&c.jsx("p",{className:"stk-sub",children:t})]}),c.jsx("div",{className:"stk-list",children:n.map((s,i)=>c.jsxs(Gt.button,{type:"button",className:`stk-card ${s.disabled?"stk-card-disabled":""}`,onClick:s.disabled?void 0:s.onClick,disabled:s.disabled,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18,ease:"easeOut",delay:i*.04},children:[c.jsx("span",{className:"stk-card-icon",children:c.jsx(s.icon,{})}),c.jsxs("span",{className:"stk-card-text",children:[c.jsx("span",{className:"stk-card-title",children:s.title}),c.jsx("span",{className:"stk-card-desc",children:s.desc})]}),c.jsx(Xn,{className:"stk-card-arrow"})]},s.key))}),r&&c.jsx("div",{className:"stk-footer",children:r})]})}const yx=Symbol.for("yaml.alias"),A1=Symbol.for("yaml.document"),zi=Symbol.for("yaml.map"),hM=Symbol.for("yaml.pair"),js=Symbol.for("yaml.scalar"),Wl=Symbol.for("yaml.seq"),Qr=Symbol.for("yaml.node.type"),ql=e=>!!e&&typeof e=="object"&&e[Qr]===yx,Td=e=>!!e&&typeof e=="object"&&e[Qr]===A1,Nd=e=>!!e&&typeof e=="object"&&e[Qr]===zi,mn=e=>!!e&&typeof e=="object"&&e[Qr]===hM,jt=e=>!!e&&typeof e=="object"&&e[Qr]===js,kd=e=>!!e&&typeof e=="object"&&e[Qr]===Wl;function hn(e){if(e&&typeof e=="object")switch(e[Qr]){case zi:case Wl:return!0}return!1}function pn(e){if(e&&typeof e=="object")switch(e[Qr]){case yx:case zi:case js:case Wl:return!0}return!1}const pM=e=>(jt(e)||hn(e))&&!!e.anchor,ma=Symbol("break visit"),wJ=Symbol("skip children"),iu=Symbol("remove node");function Gl(e,t){const n=vJ(t);Td(e)?$o(null,e.contents,n,Object.freeze([e]))===iu&&(e.contents=null):$o(null,e,n,Object.freeze([]))}Gl.BREAK=ma;Gl.SKIP=wJ;Gl.REMOVE=iu;function $o(e,t,n,r){const s=_J(e,t,n,r);if(pn(s)||mn(s))return TJ(e,r,s),$o(e,s,n,r);if(typeof s!="symbol"){if(hn(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>NJ[t]);class ar{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ar.defaultYaml,t),this.tags=Object.assign({},ar.defaultTags,n)}clone(){const t=new ar(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new ar(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ar.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ar.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:ar.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ar.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,a]=r;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const a=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,a),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+kJ(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&pn(t.contents)){const i={};Gl(t.contents,(a,o)=>{pn(o)&&o.tag&&(i[o.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(o=>o.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` +`)}}ar.defaultYaml={explicit:!1,version:"1.2"};ar.defaultTags={"!!":"tag:yaml.org,2002:"};function mM(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function gM(e){const t=new Set;return Gl(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function yM(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function SJ(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=gM(e));const a=yM(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(jt(a.node)||hn(a.node)))a.node.anchor=a.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=i,o}}},sourceObjects:r}}function Ho(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;sWr(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!pM(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class bx{constructor(t){Object.defineProperty(this,Qr,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Td(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=Wr(this,"",a);if(typeof s=="function")for(const{count:l,res:u}of a.anchors.values())s(u,l);return typeof i=="function"?Ho(i,{"":o},"",o):o}}class Ex extends bx{constructor(t){super(yx),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Gl(t,{Node:(i,a)=>{(ql(a)||pM(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,a=this.resolve(s,n);if(!a){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=r.get(a);if(o||(Wr(a,null,n),o=r.get(a)),(o==null?void 0:o.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=yh(s,a,r)),o.count*o.aliasCount>i)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(mM(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function yh(e,t,n){if(ql(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(hn(t)){let r=0;for(const s of t.items){const i=yh(e,s,n);i>r&&(r=i)}return r}else if(mn(t)){const r=yh(e,t.key,n),s=yh(e,t.value,n);return Math.max(r,s)}return 1}const bM=e=>!e||typeof e!="function"&&typeof e!="object";class Xe extends bx{constructor(t){super(js),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Wr(this.value,t,n)}toString(){return String(this.value)}}Xe.BLOCK_FOLDED="BLOCK_FOLDED";Xe.BLOCK_LITERAL="BLOCK_LITERAL";Xe.PLAIN="PLAIN";Xe.QUOTE_DOUBLE="QUOTE_DOUBLE";Xe.QUOTE_SINGLE="QUOTE_SINGLE";const AJ="tag:yaml.org,2002:";function CJ(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function zu(e,t,n){var f,h,p;if(Td(e)&&(e=e.contents),pn(e))return e;if(mn(e)){const m=(h=(f=n.schema[zi]).createNode)==null?void 0:h.call(f,n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:a,sourceObjects:o}=n;let l;if(r&&e&&typeof e=="object"){if(l=o.get(e),l)return l.anchor??(l.anchor=s(e)),new Ex(l.anchor);l={anchor:null,node:null},o.set(e,l)}t!=null&&t.startsWith("!!")&&(t=AJ+t.slice(2));let u=CJ(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new Xe(e);return l&&(l.node=m),m}u=e instanceof Map?a[zi]:Symbol.iterator in Object(e)?a[Wl]:a[zi]}i&&(i(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((p=u==null?void 0:u.nodeClass)==null?void 0:p.from)=="function"?u.nodeClass.from(n.schema,e,n):new Xe(e);return t?d.tag=t:u.default||(d.tag=u.tag),l&&(l.node=d),d}function _p(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const a=[];a[i]=r,r=a}else r=new Map([[i,r]])}return zu(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Oc=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class EM extends bx{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>pn(r)||mn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Oc(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(hn(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,_p(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(hn(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&jt(i)?i.value:i:hn(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!mn(n))return!1;const r=n.value;return r==null||t&&jt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return hn(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(hn(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,_p(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const IJ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Js(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Na=(e,t,n)=>e.endsWith(` +`)?Js(n,t):n.includes(` `)?` -`+Xs(n,t):(e.endsWith(" ")?"":" ")+n,EM="flow",A1="block",gh="quoted";function km(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:o}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,b=-1,w=-1,g=-1;n===A1&&(b=$k(e,b,t.length),b!==-1&&(f=b+l));for(let y;y=e[b+=1];){if(n===gh&&y==="\\"){switch(w=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}g=b}if(y===` -`)n===A1&&(b=$k(e,b,t.length)),f=b+t.length+l,h=void 0;else{if(y===" "&&p&&p!==" "&&p!==` -`&&p!==" "){const _=e[b+1];_&&_!==" "&&_!==` -`&&_!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+l,h=void 0;else if(n===gh){for(;p===" "||p===" ";)p=y,y=e[b+=1],m=!0;const _=b>g+1?b-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+l,h=void 0}else m=!0}p=y}if(m&&o&&o(),u.length===0)return e;a&&a();let E=e.slice(0,u[0]);for(let y=0;y({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Sm=e=>/^(%|---|\.\.\.)/m.test(e);function CJ(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,a=0;ir)return!0;if(a=i+1,s-a<=r)return!1}return!0}function su(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Sm(e)?" ":"");let a="",o=0;for(let l=0,u=n[l];u;u=n[++l])if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(a+=n.slice(o,l)+"\\ ",l+=1,o=l,u="\\"),u==="\\")switch(n[l+1]){case"u":{a+=n.slice(o,l);const d=n.substr(l+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(l,6)}l+=5,o=l+1}break;case"n":if(r||n[l+2]==='"'||n.lengths-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,y=-1,w=-1,g=-1;n===C1&&(y=$N(e,y,t.length),y!==-1&&(f=y+l));for(let b;b=e[y+=1];){if(n===bh&&b==="\\"){switch(w=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}g=y}if(b===` +`)n===C1&&(y=$N(e,y,t.length)),f=y+t.length+l,h=void 0;else{if(b===" "&&p&&p!==" "&&p!==` +`&&p!==" "){const _=e[y+1];_&&_!==" "&&_!==` +`&&_!==" "&&(h=y)}if(y>=f)if(h)u.push(h),f=h+l,h=void 0;else if(n===bh){for(;p===" "||p===" ";)p=b,b=e[y+=1],m=!0;const _=y>g+1?y-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+l,h=void 0}else m=!0}p=b}if(m&&o&&o(),u.length===0)return e;a&&a();let E=e.slice(0,u[0]);for(let b=0;b({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Cm=e=>/^(%|---|\.\.\.)/m.test(e);function RJ(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,a=0;ir)return!0;if(a=i+1,s-a<=r)return!1}return!0}function au(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Cm(e)?" ":"");let a="",o=0;for(let l=0,u=n[l];u;u=n[++l])if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(a+=n.slice(o,l)+"\\ ",l+=1,o=l,u="\\"),u==="\\")switch(n[l+1]){case"u":{a+=n.slice(o,l);const d=n.substr(l+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(l,6)}l+=5,o=l+1}break;case"n":if(r||n[l+2]==='"'||n.length -`;let f,h;for(h=n.length;h>0;--h){const k=n[h-1];if(k!==` -`&&k!==" "&&k!==" ")break}let p=n.substring(h);const m=p.indexOf(` +`;let f,h;for(h=n.length;h>0;--h){const N=n[h-1];if(N!==` +`&&N!==" "&&N!==" ")break}let p=n.substring(h);const m=p.indexOf(` `);m===-1?f="-":n===p||m!==p.length-1?(f="+",i&&i()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(I1,`$&${u}`));let b=!1,w,g=-1;for(w=0;w{T=!0});const N=km(`${E}${k}${p}`,u,A1,C);if(!T)return`>${_} -${u}${N}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} -${u}${E}${n}${p}`}function IJ(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:o,indent:l,indentStep:u,inFlow:d}=t;if(o&&i.includes(` -`)||d&&/[[\]{},]/.test(i))return Ho(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||d||!i.includes(` -`)?Ho(i,t):yh(e,t,n,r);if(!o&&!d&&s!==Xe.PLAIN&&i.includes(` -`))return yh(e,t,n,r);if(Sm(i)){if(l==="")return t.forceBlockIndent=!0,yh(e,t,n,r);if(o&&l===u)return Ho(i,t)}const f=i.replace(/\n+/g,`$& -${l}`);if(a){const h=b=>{var w;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((w=b.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return Ho(i,t)}return o?f:km(f,l,EM,Nm(t,!1))}function xx(e,t,n,r){const{implicitKey:s,inFlow:i}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;o!==Xe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Xe.QUOTE_DOUBLE);const l=d=>{switch(d){case Xe.BLOCK_FOLDED:case Xe.BLOCK_LITERAL:return s||i?Ho(a.value,t):yh(a,t,n,r);case Xe.QUOTE_DOUBLE:return su(a.value,t);case Xe.QUOTE_SINGLE:return C1(a.value,t);case Xe.PLAIN:return IJ(a,t,n,r);default:return null}};let u=l(o);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=s&&d||f;if(u=l(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function xM(e,t){const n=Object.assign({blockQuote:!0,commentString:AJ,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function RJ(e,t){var s;if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(Pt(t)){r=t.value;let i=e.filter(a=>{var o;return(o=a.identify)==null?void 0:o.call(a,r)});if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function OJ(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Pt(e)||fn(e))&&e.anchor;i&&pM(i)&&(n.add(i),s.push(`&${i}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function xl(e,t,n,r){var l;if(pn(e))return e.toString(t,n,r);if(Yl(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=hn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=RJ(t.doc.schema.tags,i));const a=OJ(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const o=typeof s.stringify=="function"?s.stringify(i,t,n,r):Pt(i)?xx(i,t,n,r):i.toString(t,n,r);return a?Pt(i)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} -${t.indent}${o}`:o}function LJ({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:o,indentStep:l,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=hn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(fn(e)||!hn(e)&&typeof e=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||fn(e)||(Pt(e)?e.type===Xe.BLOCK_FOLDED||e.type===Xe.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:o+l});let m=!1,b=!1,w=xl(e,n,()=>m=!0,()=>b=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Ta(w,n.indent,u(h)):b&&s&&s(),w;m&&(h=null),p?(h&&(w+=Ta(w,n.indent,u(h))),w=`? ${w} -${o}:`):(w=`${w}:`,h&&(w+=Ta(w,n.indent,u(h))));let g,E,y;hn(t)?(g=!!t.spaceBefore,E=t.commentBefore,y=t.comment):(g=!1,E=null,y=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&Pt(t)&&(n.indentAtStart=w.length+1),b=!1,!d&&l.length>=2&&!n.inFlow&&!p&&Td(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=xl(t,n,()=>_=!0,()=>b=!0);let T=" ";if(h||g||E){if(T=g?` -`:"",E){const C=u(E);T+=` -${Xs(C,n.indent)}`}k===""&&!n.inFlow?T===` -`&&y&&(T=` +`&&(p=p.slice(0,-1)),p=p.replace(R1,`$&${u}`));let y=!1,w,g=-1;for(w=0;w{T=!0});const k=Sm(`${E}${N}${p}`,u,C1,A);if(!T)return`>${_} +${u}${k}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} +${u}${E}${n}${p}`}function OJ(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:o,indent:l,indentStep:u,inFlow:d}=t;if(o&&i.includes(` +`)||d&&/[[\]{},]/.test(i))return zo(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||d||!i.includes(` +`)?zo(i,t):Eh(e,t,n,r);if(!o&&!d&&s!==Xe.PLAIN&&i.includes(` +`))return Eh(e,t,n,r);if(Cm(i)){if(l==="")return t.forceBlockIndent=!0,Eh(e,t,n,r);if(o&&l===u)return zo(i,t)}const f=i.replace(/\n+/g,`$& +${l}`);if(a){const h=y=>{var w;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((w=y.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return zo(i,t)}return o?f:Sm(f,l,xM,Am(t,!1))}function xx(e,t,n,r){const{implicitKey:s,inFlow:i}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;o!==Xe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Xe.QUOTE_DOUBLE);const l=d=>{switch(d){case Xe.BLOCK_FOLDED:case Xe.BLOCK_LITERAL:return s||i?zo(a.value,t):Eh(a,t,n,r);case Xe.QUOTE_DOUBLE:return au(a.value,t);case Xe.QUOTE_SINGLE:return I1(a.value,t);case Xe.PLAIN:return OJ(a,t,n,r);default:return null}};let u=l(o);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=s&&d||f;if(u=l(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function wM(e,t){const n=Object.assign({blockQuote:!0,commentString:IJ,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function LJ(e,t){var s;if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(jt(t)){r=t.value;let i=e.filter(a=>{var o;return(o=a.identify)==null?void 0:o.call(a,r)});if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function MJ(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(jt(e)||hn(e))&&e.anchor;i&&mM(i)&&(n.add(i),s.push(`&${i}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function wl(e,t,n,r){var l;if(mn(e))return e.toString(t,n,r);if(ql(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=pn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=LJ(t.doc.schema.tags,i));const a=MJ(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const o=typeof s.stringify=="function"?s.stringify(i,t,n,r):jt(i)?xx(i,t,n,r):i.toString(t,n,r);return a?jt(i)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} +${t.indent}${o}`:o}function DJ({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:o,indentStep:l,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=pn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(hn(e)||!pn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||hn(e)||(jt(e)?e.type===Xe.BLOCK_FOLDED||e.type===Xe.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:o+l});let m=!1,y=!1,w=wl(e,n,()=>m=!0,()=>y=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Na(w,n.indent,u(h)):y&&s&&s(),w;m&&(h=null),p?(h&&(w+=Na(w,n.indent,u(h))),w=`? ${w} +${o}:`):(w=`${w}:`,h&&(w+=Na(w,n.indent,u(h))));let g,E,b;pn(t)?(g=!!t.spaceBefore,E=t.commentBefore,b=t.comment):(g=!1,E=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&jt(t)&&(n.indentAtStart=w.length+1),y=!1,!d&&l.length>=2&&!n.inFlow&&!p&&kd(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const N=wl(t,n,()=>_=!0,()=>y=!0);let T=" ";if(h||g||E){if(T=g?` +`:"",E){const A=u(E);T+=` +${Js(A,n.indent)}`}N===""&&!n.inFlow?T===` +`&&b&&(T=` `):T+=` -${n.indent}`}else if(!p&&fn(t)){const C=k[0],N=k.indexOf(` -`),R=N!==-1,I=n.inFlow??t.flow??t.items.length===0;if(R||!I){let M=!1;if(R&&(C==="&"||C==="!")){let B=k.indexOf(" ");C==="&"&&B!==-1&&Be===Af||typeof e=="symbol"&&e.description===Af,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Xe(Symbol(Af)),{addToJSMap:vM}),stringify:()=>Af},MJ=(e,t)=>(ni.identify(t)||Pt(t)&&(!t.type||t.type===Xe.PLAIN)&&ni.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ni.tag&&n.default));function vM(e,t,n){const r=_M(e,n);if(Td(r))for(const s of r.items)l0(e,t,s);else if(Array.isArray(r))for(const s of r)l0(e,t,s);else l0(e,t,r)}function l0(e,t,n){const r=_M(e,n);if(!_d(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,a]of s)t instanceof Map?t.has(i)||t.set(i,a):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function _M(e,t){return e&&Yl(t)?t.resolve(e.doc,e):t}function TM(e,t,{key:n,value:r}){if(hn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(MJ(e,n))vM(e,t,r);else{const s=Yr(n,"",e);if(t instanceof Map)t.set(s,Yr(r,s,e));else if(t instanceof Set)t.add(s);else{const i=DJ(n,s,e),a=Yr(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function DJ(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(hn(e)&&(n!=null&&n.doc)){const r=xM(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),wM(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function wx(e,t,n){const r=$u(e,void 0,n),s=$u(t,void 0,n);return new lr(r,s)}class lr{constructor(t,n=null){Object.defineProperty(this,Xr,{value:fM}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return hn(n)&&(n=n.clone(t)),hn(r)&&(r=r.clone(t)),new lr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return TM(n,r,this)}toString(t,n,r){return t!=null&&t.doc?LJ(this,t,n,r):JSON.stringify(this)}}function kM(e,t,n){return(t.inFlow??e.flow?jJ:PJ)(e,t,n)}function PJ({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:l,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(g+=Ta(g,i,u(w))),f&&w&&(f=!1),h.push(r+g)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;me===If||typeof e=="symbol"&&e.description===If,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Xe(Symbol(If)),{addToJSMap:_M}),stringify:()=>If},PJ=(e,t)=>(si.identify(t)||jt(t)&&(!t.type||t.type===Xe.PLAIN)&&si.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===si.tag&&n.default));function _M(e,t,n){const r=TM(e,n);if(kd(r))for(const s of r.items)c0(e,t,s);else if(Array.isArray(r))for(const s of r)c0(e,t,s);else c0(e,t,r)}function c0(e,t,n){const r=TM(e,n);if(!Nd(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,a]of s)t instanceof Map?t.has(i)||t.set(i,a):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function TM(e,t){return e&&ql(t)?t.resolve(e.doc,e):t}function NM(e,t,{key:n,value:r}){if(pn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(PJ(e,n))_M(e,t,r);else{const s=Wr(n,"",e);if(t instanceof Map)t.set(s,Wr(r,s,e));else if(t instanceof Set)t.add(s);else{const i=jJ(n,s,e),a=Wr(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function jJ(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(pn(e)&&(n!=null&&n.doc)){const r=wM(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),vM(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function wx(e,t,n){const r=zu(e,void 0,n),s=zu(t,void 0,n);return new cr(r,s)}class cr{constructor(t,n=null){Object.defineProperty(this,Qr,{value:hM}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return pn(n)&&(n=n.clone(t)),pn(r)&&(r=r.clone(t)),new cr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return NM(n,r,this)}toString(t,n,r){return t!=null&&t.doc?DJ(this,t,n,r):JSON.stringify(this)}}function kM(e,t,n){return(t.inFlow??e.flow?FJ:BJ)(e,t,n)}function BJ({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:l,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(g+=Na(g,i,u(w))),f&&w&&(f=!1),h.push(r+g)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;mw=null);u||(u=f.length>d||g.includes(` -`)),m0&&(u||(u=f.reduce((E,y)=>E+y.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),w&&(g+=Ta(g,r,o(w))),f.push(g),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((b,w)=>b+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const b of f)m+=b?` -${i}${s}${b}`:` +`+Js(u(e),l),o&&o()):f&&a&&a(),p}function FJ({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:a,options:{commentString:o}}=t;r+=i;const l=Object.assign({},t,{indent:r,inFlow:!0,type:null});let u=!1,d=0;const f=[];for(let m=0;mw=null);u||(u=f.length>d||g.includes(` +`)),m0&&(u||(u=f.reduce((E,b)=>E+b.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),w&&(g+=Na(g,r,o(w))),f.push(g),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((y,w)=>y+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const y of f)m+=y?` +${i}${s}${y}`:` `;return`${m} -${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function vp({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Xs(t(r),e);n.push(i.trimStart())}}function ka(e,t){const n=Pt(t)?t.value:t;for(const r of e)if(pn(r)&&(r.key===t||r.key===n||Pt(r.key)&&r.key.value===n))return r}class zr extends bM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Hi,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),o=(l,u)=>{if(typeof i=="function")u=i.call(n,l,u);else if(Array.isArray(i)&&!i.includes(l))return;(u!==void 0||s)&&a.items.push(wx(l,u,r))};if(n instanceof Map)for(const[l,u]of n)o(l,u);else if(n&&typeof n=="object")for(const l of Object.keys(n))o(l,n[l]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;pn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new lr(t,t==null?void 0:t.value):r=new lr(t.key,t.value);const s=ka(this.items,r.key),i=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Pt(s.value)&&yM(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(l=>i(r,l)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=ka(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=ka(this.items,t),s=r==null?void 0:r.value;return(!n&&Pt(s)?s.value:s)??void 0}has(t){return!!ka(this.items,t)}set(t,n){this.add(new lr(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items)TM(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!pn(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),kM(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const ql={collection:"map",default:!0,nodeClass:zr,tag:"tag:yaml.org,2002:map",resolve(e,t){return _d(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>zr.from(e,t,n)};class Ka extends bM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Kl,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Cf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Cf(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Pt(s)?s.value:s}has(t){const n=Cf(t);return typeof n=="number"&&n=0?t:null}const Gl={collection:"seq",default:!0,nodeClass:Ka,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Td(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ka.from(e,t,n)},Am={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),xx(e,t,n,r)}},Cm={identify:e=>e==null,createNode:()=>new Xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Xe(null),stringify:({source:e},t)=>typeof e=="string"&&Cm.test.test(e)?e:t.options.nullStr},vx={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Xe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&vx.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function ys({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let o=t-(i.length-a-1);for(;o-- >0;)i+="0"}return i}const NM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ys},SM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ys(e)}},AM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Xe(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ys},Im=e=>typeof e=="bigint"||Number.isInteger(e),_x=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function CM(e,t,n){const{value:r}=e;return Im(r)&&r>=0?n+r.toString(t):ys(e)}const IM={identify:e=>Im(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>_x(e,2,8,n),stringify:e=>CM(e,8,"0o")},RM={identify:Im,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>_x(e,0,10,n),stringify:ys},OM={identify:e=>Im(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>_x(e,2,16,n),stringify:e=>CM(e,16,"0x")},BJ=[ql,Gl,Am,Cm,vx,IM,RM,OM,NM,SM,AM];function Hk(e){return typeof e=="bigint"||Number.isInteger(e)}const If=({value:e})=>JSON.stringify(e),FJ=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:If},{identify:e=>e==null,createNode:()=>new Xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:If},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:If},{identify:Hk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Hk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:If}],UJ={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},$J=[ql,Gl].concat(FJ,UJ),Tx={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new lr(new Xe(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore} +${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function Tp({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Js(t(r),e);n.push(i.trimStart())}}function ka(e,t){const n=jt(t)?t.value:t;for(const r of e)if(mn(r)&&(r.key===t||r.key===n||jt(r.key)&&r.key.value===n))return r}class Vr extends EM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(zi,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),o=(l,u)=>{if(typeof i=="function")u=i.call(n,l,u);else if(Array.isArray(i)&&!i.includes(l))return;(u!==void 0||s)&&a.items.push(wx(l,u,r))};if(n instanceof Map)for(const[l,u]of n)o(l,u);else if(n&&typeof n=="object")for(const l of Object.keys(n))o(l,n[l]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;mn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new cr(t,t==null?void 0:t.value):r=new cr(t.key,t.value);const s=ka(this.items,r.key),i=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);jt(s.value)&&bM(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(l=>i(r,l)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=ka(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=ka(this.items,t),s=r==null?void 0:r.value;return(!n&&jt(s)?s.value:s)??void 0}has(t){return!!ka(this.items,t)}set(t,n){this.add(new cr(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items)NM(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!mn(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),kM(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Xl={collection:"map",default:!0,nodeClass:Vr,tag:"tag:yaml.org,2002:map",resolve(e,t){return Nd(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Vr.from(e,t,n)};class Ya extends EM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Wl,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Rf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Rf(t);if(typeof r!="number")return;const s=this.items[r];return!n&&jt(s)?s.value:s}has(t){const n=Rf(t);return typeof n=="number"&&n=0?t:null}const Ql={collection:"seq",default:!0,nodeClass:Ya,tag:"tag:yaml.org,2002:seq",resolve(e,t){return kd(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ya.from(e,t,n)},Im={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),xx(e,t,n,r)}},Rm={identify:e=>e==null,createNode:()=>new Xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Xe(null),stringify:({source:e},t)=>typeof e=="string"&&Rm.test.test(e)?e:t.options.nullStr},vx={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Xe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&vx.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function Es({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let o=t-(i.length-a-1);for(;o-- >0;)i+="0"}return i}const SM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Es},AM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Es(e)}},CM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Xe(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Es},Om=e=>typeof e=="bigint"||Number.isInteger(e),_x=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function IM(e,t,n){const{value:r}=e;return Om(r)&&r>=0?n+r.toString(t):Es(e)}const RM={identify:e=>Om(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>_x(e,2,8,n),stringify:e=>IM(e,8,"0o")},OM={identify:Om,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>_x(e,0,10,n),stringify:Es},LM={identify:e=>Om(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>_x(e,2,16,n),stringify:e=>IM(e,16,"0x")},UJ=[Xl,Ql,Im,Rm,vx,RM,OM,LM,SM,AM,CM];function HN(e){return typeof e=="bigint"||Number.isInteger(e)}const Of=({value:e})=>JSON.stringify(e),$J=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Of},{identify:e=>e==null,createNode:()=>new Xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Of},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Of},{identify:HN,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>HN(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Of}],HJ={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},zJ=[Xl,Ql].concat($J,HJ),Tx={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new cr(new Xe(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore} ${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment} -${i.comment}`:r.comment}r=s}e.items[n]=pn(r)?r:new lr(r)}}else t("Expected a sequence for this tag");return e}function MM(e,t,n){const{replacer:r}=n,s=new Ka(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(i++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)o=u[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=a;s.items.push(wx(o,l,n))}return s}const kx={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:LM,createNode:MM};class Zo extends Ka{constructor(){super(),this.add=zr.prototype.add.bind(this),this.delete=zr.prototype.delete.bind(this),this.get=zr.prototype.get.bind(this),this.has=zr.prototype.has.bind(this),this.set=zr.prototype.set.bind(this),this.tag=Zo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let i,a;if(pn(s)?(i=Yr(s.key,"",n),a=Yr(s.value,i,n)):i=Yr(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,a)}return r}static from(t,n,r){const s=MM(t,n,r),i=new this;return i.items=s.items,i}}Zo.tag="tag:yaml.org,2002:omap";const Nx={collection:"seq",identify:e=>e instanceof Map,nodeClass:Zo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=LM(e,t),r=[];for(const{key:s}of n.items)Pt(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Zo,n)},createNode:(e,t,n)=>Zo.from(e,t,n)};function DM({value:e,source:t},n){return t&&(e?PM:jM).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const PM={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Xe(!0),stringify:DM},jM={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Xe(!1),stringify:DM},HJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ys},zJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ys(e)}},VJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Xe(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:ys},kd=e=>typeof e=="bigint"||Number.isInteger(e);function Rm(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return s==="-"?BigInt(-1)*a:a}const i=parseInt(e,n);return s==="-"?-1*i:i}function Sx(e,t,n){const{value:r}=e;if(kd(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return ys(e)}const KJ={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Rm(e,2,2,n),stringify:e=>Sx(e,2,"0b")},YJ={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Rm(e,1,8,n),stringify:e=>Sx(e,8,"0")},WJ={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Rm(e,0,10,n),stringify:ys},qJ={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Rm(e,2,16,n),stringify:e=>Sx(e,16,"0x")};class Jo extends zr{constructor(t){super(t),this.tag=Jo.tag}add(t){let n;pn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new lr(t.key,null):n=new lr(t,null),ka(this.items,n.key)||this.items.push(n)}get(t,n){const r=ka(this.items,t);return!n&&pn(r)?Pt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=ka(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new lr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),i.items.push(wx(a,null,r));return i}}Jo.tag="tag:yaml.org,2002:set";const Ax={collection:"map",identify:e=>e instanceof Set,nodeClass:Jo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Jo.from(e,t,n),resolve(e,t){if(_d(e)){if(e.hasAllNullValues(!0))return Object.assign(new Jo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Cx(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),i=r.replace(/_/g,"").split(":").reduce((a,o)=>a*s(60)+s(o),s(0));return n==="-"?s(-1)*i:i}function BM(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return ys(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const FM={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Cx(e,n),stringify:BM},UM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Cx(e,!1),stringify:BM},Om={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Om.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,o]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,s,i||0,a||0,o||0,l);const d=t[8];if(d&&d!=="Z"){let f=Cx(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},zk=[ql,Gl,Am,Cm,PM,jM,KJ,YJ,WJ,qJ,HJ,zJ,VJ,Tx,ni,Nx,kx,Ax,FM,UM,Om],Vk=new Map([["core",BJ],["failsafe",[ql,Gl,Am]],["json",$J],["yaml11",zk],["yaml-1.1",zk]]),Kk={binary:Tx,bool:vx,float:AM,floatExp:SM,floatNaN:NM,floatTime:UM,int:RM,intHex:OM,intOct:IM,intTime:FM,map:ql,merge:ni,null:Cm,omap:Nx,pairs:kx,seq:Gl,set:Ax,timestamp:Om},GJ={"tag:yaml.org,2002:binary":Tx,"tag:yaml.org,2002:merge":ni,"tag:yaml.org,2002:omap":Nx,"tag:yaml.org,2002:pairs":kx,"tag:yaml.org,2002:set":Ax,"tag:yaml.org,2002:timestamp":Om};function c0(e,t,n){const r=Vk.get(t);if(r&&!e)return n&&!r.includes(ni)?r.concat(ni):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(Vk.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(ni)),s.reduce((i,a)=>{const o=typeof a=="string"?Kk[a]:a;if(!o){const l=JSON.stringify(a),u=Object.keys(Kk).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return i.includes(o)||i.push(o),i},[])}const XJ=(e,t)=>e.keyt.key?1:0;class Ix{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?c0(t,"compat"):t?c0(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?GJ:{},this.tags=c0(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Hi,{value:ql}),Object.defineProperty(this,Ms,{value:Am}),Object.defineProperty(this,Kl,{value:Gl}),this.sortMapEntries=typeof a=="function"?a:a===!0?XJ:null}clone(){const t=Object.create(Ix.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function QJ(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=xM(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(Xs(u,""))}let a=!1,o=null;if(e.contents){if(hn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(Xs(f,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}const u=o?void 0:()=>a=!0;let d=xl(e.contents,s,()=>o=null,u);o&&(d+=Ta(d,"",i(o))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(xl(e.contents,s));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const u=i(e.comment);u.includes(` -`)?(n.push("..."),n.push(Xs(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(Xs(i(u),"")))}return n.join(` +${i.comment}`:r.comment}r=s}e.items[n]=mn(r)?r:new cr(r)}}else t("Expected a sequence for this tag");return e}function DM(e,t,n){const{replacer:r}=n,s=new Ya(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(i++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)o=u[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=a;s.items.push(wx(o,l,n))}return s}const Nx={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:MM,createNode:DM};class Jo extends Ya{constructor(){super(),this.add=Vr.prototype.add.bind(this),this.delete=Vr.prototype.delete.bind(this),this.get=Vr.prototype.get.bind(this),this.has=Vr.prototype.has.bind(this),this.set=Vr.prototype.set.bind(this),this.tag=Jo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let i,a;if(mn(s)?(i=Wr(s.key,"",n),a=Wr(s.value,i,n)):i=Wr(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,a)}return r}static from(t,n,r){const s=DM(t,n,r),i=new this;return i.items=s.items,i}}Jo.tag="tag:yaml.org,2002:omap";const kx={collection:"seq",identify:e=>e instanceof Map,nodeClass:Jo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=MM(e,t),r=[];for(const{key:s}of n.items)jt(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Jo,n)},createNode:(e,t,n)=>Jo.from(e,t,n)};function PM({value:e,source:t},n){return t&&(e?jM:BM).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const jM={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Xe(!0),stringify:PM},BM={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Xe(!1),stringify:PM},VJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Es},KJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Es(e)}},YJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Xe(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Es},Sd=e=>typeof e=="bigint"||Number.isInteger(e);function Lm(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return s==="-"?BigInt(-1)*a:a}const i=parseInt(e,n);return s==="-"?-1*i:i}function Sx(e,t,n){const{value:r}=e;if(Sd(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Es(e)}const WJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Lm(e,2,2,n),stringify:e=>Sx(e,2,"0b")},qJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Lm(e,1,8,n),stringify:e=>Sx(e,8,"0")},GJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Lm(e,0,10,n),stringify:Es},XJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Lm(e,2,16,n),stringify:e=>Sx(e,16,"0x")};class el extends Vr{constructor(t){super(t),this.tag=el.tag}add(t){let n;mn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new cr(t.key,null):n=new cr(t,null),ka(this.items,n.key)||this.items.push(n)}get(t,n){const r=ka(this.items,t);return!n&&mn(r)?jt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=ka(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new cr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),i.items.push(wx(a,null,r));return i}}el.tag="tag:yaml.org,2002:set";const Ax={collection:"map",identify:e=>e instanceof Set,nodeClass:el,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>el.from(e,t,n),resolve(e,t){if(Nd(e)){if(e.hasAllNullValues(!0))return Object.assign(new el,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Cx(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),i=r.replace(/_/g,"").split(":").reduce((a,o)=>a*s(60)+s(o),s(0));return n==="-"?s(-1)*i:i}function FM(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Es(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const UM={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Cx(e,n),stringify:FM},$M={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Cx(e,!1),stringify:FM},Mm={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Mm.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,o]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,s,i||0,a||0,o||0,l);const d=t[8];if(d&&d!=="Z"){let f=Cx(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},zN=[Xl,Ql,Im,Rm,jM,BM,WJ,qJ,GJ,XJ,VJ,KJ,YJ,Tx,si,kx,Nx,Ax,UM,$M,Mm],VN=new Map([["core",UJ],["failsafe",[Xl,Ql,Im]],["json",zJ],["yaml11",zN],["yaml-1.1",zN]]),KN={binary:Tx,bool:vx,float:CM,floatExp:AM,floatNaN:SM,floatTime:$M,int:OM,intHex:LM,intOct:RM,intTime:UM,map:Xl,merge:si,null:Rm,omap:kx,pairs:Nx,seq:Ql,set:Ax,timestamp:Mm},QJ={"tag:yaml.org,2002:binary":Tx,"tag:yaml.org,2002:merge":si,"tag:yaml.org,2002:omap":kx,"tag:yaml.org,2002:pairs":Nx,"tag:yaml.org,2002:set":Ax,"tag:yaml.org,2002:timestamp":Mm};function u0(e,t,n){const r=VN.get(t);if(r&&!e)return n&&!r.includes(si)?r.concat(si):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(VN.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(si)),s.reduce((i,a)=>{const o=typeof a=="string"?KN[a]:a;if(!o){const l=JSON.stringify(a),u=Object.keys(KN).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return i.includes(o)||i.push(o),i},[])}const ZJ=(e,t)=>e.keyt.key?1:0;class Ix{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?u0(t,"compat"):t?u0(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?QJ:{},this.tags=u0(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,zi,{value:Xl}),Object.defineProperty(this,js,{value:Im}),Object.defineProperty(this,Wl,{value:Ql}),this.sortMapEntries=typeof a=="function"?a:a===!0?ZJ:null}clone(){const t=Object.create(Ix.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function JJ(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=wM(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(Js(u,""))}let a=!1,o=null;if(e.contents){if(pn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(Js(f,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}const u=o?void 0:()=>a=!0;let d=wl(e.contents,s,()=>o=null,u);o&&(d+=Na(d,"",i(o))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(wl(e.contents,s));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const u=i(e.comment);u.includes(` +`)?(n.push("..."),n.push(Js(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(Js(i(u),"")))}return n.join(` `)+` -`}class Nd{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Xr,{value:S1});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:a}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new sr({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Nd.prototype,{[Xr]:{value:S1}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=hn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ho(this.contents)&&this.contents.add(t)}addIn(t,n){ho(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=mM(this);t.anchor=!n||r.has(n)?gM(n||"a",r):n}return new Ex(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=E=>typeof E=="number"||E instanceof String||E instanceof Number,g=n.filter(w).map(String);g.length>0&&(n=n.concat(g)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=kJ(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},b=$u(t,d,m);return o&&fn(b)&&(b.flow=!0),h(),b}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new lr(s,i)}delete(t){return ho(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ic(t)?this.contents==null?!1:(this.contents=null,!0):ho(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return fn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ic(t)?!n&&Pt(this.contents)?this.contents.value:this.contents:fn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return fn(this.contents)?this.contents.has(t):!1}hasIn(t){return Ic(t)?this.contents!==void 0:fn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=wp(this.schema,[t],n):ho(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ic(t)?this.contents=n:this.contents==null?this.contents=wp(this.schema,Array.from(t),n):ho(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new sr({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new sr({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Ix(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:a}={}){const o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=Yr(this.contents,n??"",o);if(typeof i=="function")for(const{count:u,res:d}of o.anchors.values())i(d,u);return typeof a=="function"?$o(a,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return QJ(this,t)}}function ho(e){if(fn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class $M extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Rc extends $M{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class ZJ extends $M{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const Yk=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){const o=Math.min(i-39,a.length-79);a="…"+a.substring(o),i-=o-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`… +`}class Ad{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qr,{value:A1});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:a}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ar({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Ad.prototype,{[Qr]:{value:A1}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=pn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){po(this.contents)&&this.contents.add(t)}addIn(t,n){po(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=gM(this);t.anchor=!n||r.has(n)?yM(n||"a",r):n}return new Ex(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=E=>typeof E=="number"||E instanceof String||E instanceof Number,g=n.filter(w).map(String);g.length>0&&(n=n.concat(g)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=SJ(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},y=zu(t,d,m);return o&&hn(y)&&(y.flow=!0),h(),y}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new cr(s,i)}delete(t){return po(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Oc(t)?this.contents==null?!1:(this.contents=null,!0):po(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return hn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Oc(t)?!n&&jt(this.contents)?this.contents.value:this.contents:hn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return hn(this.contents)?this.contents.has(t):!1}hasIn(t){return Oc(t)?this.contents!==void 0:hn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=_p(this.schema,[t],n):po(this.contents)&&this.contents.set(t,n)}setIn(t,n){Oc(t)?this.contents=n:this.contents==null?this.contents=_p(this.schema,Array.from(t),n):po(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ar({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ar({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Ix(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:a}={}){const o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=Wr(this.contents,n??"",o);if(typeof i=="function")for(const{count:u,res:d}of o.anchors.values())i(d,u);return typeof a=="function"?Ho(a,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return JJ(this,t)}}function po(e){if(hn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class HM extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Lc extends HM{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class eee extends HM{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const YN=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){const o=Math.min(i-39,a.length-79);a="…"+a.substring(o),i-=o-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`… `),a=o+a}if(/[^ ]/.test(a)){let o=1;const l=n.linePos[1];(l==null?void 0:l.line)===r&&l.col>s&&(o=Math.max(1,Math.min(l.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(o);n.message+=`: ${a} ${u} -`}};function wl(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:o}){let l=!1,u=o,d=o,f="",h="",p=!1,m=!1,b=null,w=null,g=null,E=null,y=null,_=null,k=null;for(const N of e)switch(m&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&i(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),b&&(u&&N.type!=="comment"&&N.type!=="newline"&&i(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),N.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&N.source.includes(" ")&&(b=N),d=!0;break;case"comment":{d||i(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=N.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=N.source:(!_||n!=="seq-item-ind")&&(l=!0):h+=N.source,u=!0,p=!0,(w||g)&&(E=N),d=!0;break;case"anchor":w&&i(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&i(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=N,k??(k=N.offset),u=!1,d=!1,m=!0;break;case"tag":{g&&i(N,"MULTIPLE_TAGS","A node can have at most one tag"),g=N,k??(k=N.offset),u=!1,d=!1,m=!0;break}case n:(w||g)&&i(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),_&&i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${t??"collection"}`),_=N,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){y&&i(N,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),y=N,u=!1,d=!1;break}default:i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),u=!1,d=!1}const T=e[e.length-1],C=T?T.offset+T.source.length:s;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(u&&b.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:y,found:_,spaceBefore:l,comment:f,hasNewline:p,anchor:w,tag:g,newlineAfterProp:E,end:C,start:k??C}}function Hu(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Hu(t.key)||Hu(t.value))return!0}return!1;default:return!0}}function R1(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Hu(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function HM(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||Pt(i)&&Pt(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const Wk="All mapping items must start at the same column";function JJ({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??zr,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,u=null;for(const f of r.items){const{start:h,key:p,sep:m,value:b}=f,w=wl(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0}),g=!w.found;if(g){if(p&&(p.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&s(l,"BAD_INDENT",Wk)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(o.comment?o.comment+=` -`+w.comment:o.comment=w.comment);continue}(w.newlineAfterProp||Hu(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(l,"BAD_INDENT",Wk);n.atKey=!0;const E=w.end,y=p?e(n,p,w,s):t(n,E,h,null,w,s);n.schema.compat&&R1(r.indent,p,s),n.atKey=!1,HM(n,o.items,y)&&s(E,"DUPLICATE_KEY","Map keys must be unique");const _=wl(m??[],{indicator:"map-value-ind",next:b,offset:y.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=_.end,_.found){g&&((b==null?void 0:b.type)==="block-map"&&!_.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=b?e(n,b,_,s):t(n,l,m,null,_,s);n.schema.compat&&R1(r.indent,b,s),l=k.range[2];const T=new lr(y,k);n.options.keepSourceTokens&&(T.srcToken=f),o.items.push(T)}else{g&&s(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(y.comment?y.comment+=` -`+_.comment:y.comment=_.comment);const k=new lr(y);n.options.keepSourceTokens&&(k.srcToken=f),o.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function tee({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",o=a?"flow map":"flow sequence",l=(i==null?void 0:i.nodeClass)??(a?zr:Ka),u=new l(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;g0){const g=Sd(m,b,n.options.strict,s);g.comment&&(u.comment?u.comment+=` -`+g.comment:u.comment=g.comment),u.range=[r.offset,b,g.offset]}else u.range=[r.offset,b,b];return u}function f0(e,t,n,r,s,i){const a=n.type==="block-map"?JJ(e,t,n,r,i):n.type==="block-seq"?eee(e,t,n,r,i):tee(e,t,n,r,i),o=a.constructor;return s==="!"||s===o.tagName?(a.tag=o.tagName,a):(s&&(a.tag=s),a)}function nee(e,t,n,r,s){var h;const i=r.tag,a=i?t.directives.tagName(i.source,p=>s(i,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=r,b=p&&i?p.offset>i.offset?p:i:p??i;b&&(!m||m.offsetp.tag===a&&p.collection===o);if(!l){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===o)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),f0(e,t,n,s,a)}const u=f0(e,t,n,s,a,l),d=((h=l.resolve)==null?void 0:h.call(l,u,p=>s(i,"TAG_RESOLVE_FAILED",p),t.options))??u,f=hn(d)?d:new Xe(d);return f.range=u.range,f.tag=a,l!=null&&l.format&&(f.format=l.format),f}function ree(e,t,n){const r=t.offset,s=see(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?Xe.BLOCK_FOLDED:Xe.BLOCK_LITERAL,a=t.source?iee(t.source):[];let o=a.length;for(let b=a.length-1;b>=0;--b){const w=a[b][1];if(w===""||w==="\r")o=b;else break}if(o===0){const b=s.chomp==="+"&&a.length>0?` -`.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:b,type:i,comment:s.comment,range:[r,w,w]}}let l=t.indent+s.indent,u=t.offset+s.length,d=0;for(let b=0;bl&&(l=w.length);else{w.length=o;--b)a[b][0].length>l&&(o=b+1);let f="",h="",p=!1;for(let b=0;bi===a||jt(i)&&jt(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const WN="All mapping items must start at the same column";function tee({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Vr,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,u=null;for(const f of r.items){const{start:h,key:p,sep:m,value:y}=f,w=vl(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0}),g=!w.found;if(g){if(p&&(p.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&s(l,"BAD_INDENT",WN)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(o.comment?o.comment+=` +`+w.comment:o.comment=w.comment);continue}(w.newlineAfterProp||Vu(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(l,"BAD_INDENT",WN);n.atKey=!0;const E=w.end,b=p?e(n,p,w,s):t(n,E,h,null,w,s);n.schema.compat&&O1(r.indent,p,s),n.atKey=!1,zM(n,o.items,b)&&s(E,"DUPLICATE_KEY","Map keys must be unique");const _=vl(m??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=_.end,_.found){g&&((y==null?void 0:y.type)==="block-map"&&!_.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=y?e(n,y,_,s):t(n,l,m,null,_,s);n.schema.compat&&O1(r.indent,y,s),l=N.range[2];const T=new cr(b,N);n.options.keepSourceTokens&&(T.srcToken=f),o.items.push(T)}else{g&&s(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(b.comment?b.comment+=` +`+_.comment:b.comment=_.comment);const N=new cr(b);n.options.keepSourceTokens&&(N.srcToken=f),o.items.push(N)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function ree({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",o=a?"flow map":"flow sequence",l=(i==null?void 0:i.nodeClass)??(a?Vr:Ya),u=new l(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;g0){const g=Cd(m,y,n.options.strict,s);g.comment&&(u.comment?u.comment+=` +`+g.comment:u.comment=g.comment),u.range=[r.offset,y,g.offset]}else u.range=[r.offset,y,y];return u}function h0(e,t,n,r,s,i){const a=n.type==="block-map"?tee(e,t,n,r,i):n.type==="block-seq"?nee(e,t,n,r,i):ree(e,t,n,r,i),o=a.constructor;return s==="!"||s===o.tagName?(a.tag=o.tagName,a):(s&&(a.tag=s),a)}function see(e,t,n,r,s){var h;const i=r.tag,a=i?t.directives.tagName(i.source,p=>s(i,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=r,y=p&&i?p.offset>i.offset?p:i:p??i;y&&(!m||m.offsetp.tag===a&&p.collection===o);if(!l){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===o)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),h0(e,t,n,s,a)}const u=h0(e,t,n,s,a,l),d=((h=l.resolve)==null?void 0:h.call(l,u,p=>s(i,"TAG_RESOLVE_FAILED",p),t.options))??u,f=pn(d)?d:new Xe(d);return f.range=u.range,f.tag=a,l!=null&&l.format&&(f.format=l.format),f}function iee(e,t,n){const r=t.offset,s=aee(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?Xe.BLOCK_FOLDED:Xe.BLOCK_LITERAL,a=t.source?oee(t.source):[];let o=a.length;for(let y=a.length-1;y>=0;--y){const w=a[y][1];if(w===""||w==="\r")o=y;else break}if(o===0){const y=s.chomp==="+"&&a.length>0?` +`.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:y,type:i,comment:s.comment,range:[r,w,w]}}let l=t.indent+s.indent,u=t.offset+s.length,d=0;for(let y=0;yl&&(l=w.length);else{w.length=o;--y)a[y][0].length>l&&(o=y+1);let f="",h="",p=!1;for(let y=0;yl||g[0]===" "?(h===" "?h=` `:!p&&h===` `&&(h=` @@ -605,69 +605,69 @@ ${u} `,p=!0):g===""?h===` `?f+=` `:h=` -`:(f+=h+g,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let b=o;bn(r+h,p,m);switch(s){case"scalar":o=Xe.PLAIN,l=oee(i,u);break;case"single-quoted-scalar":o=Xe.QUOTE_SINGLE,l=lee(i,u);break;case"double-quoted-scalar":o=Xe.QUOTE_DOUBLE,l=cee(i,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const d=r+i.length,f=Sd(a,d,t,n);return{value:l,type:o,comment:f.comment,range:[r,d,f.offset]}}function oee(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),zM(e)}function lee(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),zM(e.slice(1,-1)).replace(/''/g,"'")}function zM(e){let t,n;try{t=new RegExp(`(.*?)(?n(r+h,p,m);switch(s){case"scalar":o=Xe.PLAIN,l=cee(i,u);break;case"single-quoted-scalar":o=Xe.QUOTE_SINGLE,l=uee(i,u);break;case"double-quoted-scalar":o=Xe.QUOTE_DOUBLE,l=dee(i,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const d=r+i.length,f=Cd(a,d,t,n);return{value:l,type:o,comment:f.comment,range:[r,d,f.offset]}}function cee(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),VM(e)}function uee(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),VM(e.slice(1,-1)).replace(/''/g,"'")}function VM(e){let t,n;try{t=new RegExp(`(.*?)(?i?e.slice(i,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function uee(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` +`)&&(n+=r>i?e.slice(i,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function fee(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` `||r==="\r")&&!(r==="\r"&&e[t+2]!==` `);)r===` `&&(n+=` -`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const dee={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fee(e,t,n,r){const s=e.substr(t,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(a)}catch{const o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}function VM(e,t,n,r){const{value:s,type:i,comment:a,range:o}=t.type==="block-scalar"?ree(e,t,r):aee(t,e.options.strict,r),l=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Ms]:l?u=hee(e.schema,s,l,n,r):t.type==="scalar"?u=pee(e,s,t,r):u=e.schema[Ms];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Pt(f)?f:new Xe(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new Xe(s)}return d.range=o,d.source=s,i&&(d.type=i),l&&(d.tag=l),u.format&&(d.format=u.format),a&&(d.comment=a),d}function hee(e,t,n,r,s){var o;if(n==="!")return e[Ms];const i=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)i.push(l);else return l;for(const l of i)if((o=l.test)!=null&&o.test(t))return l;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Ms])}function pee({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(o=>{var l;return(o.default===!0||e&&o.default==="key")&&((l=o.test)==null?void 0:l.test(r))})||n[Ms];if(n.compat){const o=n.compat.find(l=>{var u;return l.default&&((u=l.test)==null?void 0:u.test(r))})??n[Ms];if(a.tag!==o.tag){const l=t.tagString(a.tag),u=t.tagString(o.tag),d=`Value may be parsed as either ${l} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function mee(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const gee={composeNode:KM,composeEmptyNode:Rx};function KM(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:o,tag:l}=n;let u,d=!0;switch(t.type){case"alias":u=yee(e,t,r),(o||l)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=VM(e,t,l,r),o&&(u.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=nee(gee,e,t,n,r),o&&(u.anchor=o.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Rx(e,t.offset,void 0,null,n,r)),o&&u.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!Pt(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rx(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:o,end:l},u){const d={type:"scalar",offset:mee(t,n,r),indent:-1,source:""},f=VM(e,d,o,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function yee({options:e},{offset:t,source:n,end:r},s){const i=new Ex(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,o=Sd(r,a,e.strict,s);return i.range=[t,a,o.offset],o.comment&&(i.comment=o.comment),i}function bee(e,t,{offset:n,start:r,value:s,end:i},a){const o=Object.assign({_directives:t},e),l=new Nd(void 0,o),u={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=wl(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?KM(u,s,d,a):Rx(u,d.end,r,null,d,a);const f=l.contents.range[2],h=Sd(i,f,!1,a);return h.comment&&(l.comment=h.comment),l.range=[n,f,h.offset],l}function mc(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function qk(e){var s;let t="",n=!1,r=!1;for(let i=0;ir(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[js]:l?u=mee(e.schema,s,l,n,r):t.type==="scalar"?u=gee(e,s,t,r):u=e.schema[js];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=jt(f)?f:new Xe(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new Xe(s)}return d.range=o,d.source=s,i&&(d.type=i),l&&(d.tag=l),u.format&&(d.format=u.format),a&&(d.comment=a),d}function mee(e,t,n,r,s){var o;if(n==="!")return e[js];const i=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)i.push(l);else return l;for(const l of i)if((o=l.test)!=null&&o.test(t))return l;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[js])}function gee({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(o=>{var l;return(o.default===!0||e&&o.default==="key")&&((l=o.test)==null?void 0:l.test(r))})||n[js];if(n.compat){const o=n.compat.find(l=>{var u;return l.default&&((u=l.test)==null?void 0:u.test(r))})??n[js];if(a.tag!==o.tag){const l=t.tagString(a.tag),u=t.tagString(o.tag),d=`Value may be parsed as either ${l} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function yee(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const bee={composeNode:YM,composeEmptyNode:Rx};function YM(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:o,tag:l}=n;let u,d=!0;switch(t.type){case"alias":u=Eee(e,t,r),(o||l)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=KM(e,t,l,r),o&&(u.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=see(bee,e,t,n,r),o&&(u.anchor=o.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Rx(e,t.offset,void 0,null,n,r)),o&&u.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!jt(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rx(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:o,end:l},u){const d={type:"scalar",offset:yee(t,n,r),indent:-1,source:""},f=KM(e,d,o,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function Eee({options:e},{offset:t,source:n,end:r},s){const i=new Ex(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,o=Cd(r,a,e.strict,s);return i.range=[t,a,o.offset],o.comment&&(i.comment=o.comment),i}function xee(e,t,{offset:n,start:r,value:s,end:i},a){const o=Object.assign({_directives:t},e),l=new Ad(void 0,o),u={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=vl(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?YM(u,s,d,a):Rx(u,d.end,r,null,d,a);const f=l.contents.range[2],h=Cd(i,f,!1,a);return h.comment&&(l.comment=h.comment),l.range=[n,f,h.offset],l}function yc(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function qN(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=mc(n);i?this.warnings.push(new ZJ(a,r,s)):this.errors.push(new Rc(a,r,s))},this.directives=new sr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=qk(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment} -${r}`:r;else if(s||t.directives.docStart||!i)t.commentBefore=r;else if(fn(i)&&!i.flow&&i.items.length>0){let a=i.items[0];pn(a)&&(a=a.key);const o=a.commentBefore;a.commentBefore=o?`${r} +`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[i+1])==null?void 0:s[0])!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class wee{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const a=yc(n);i?this.warnings.push(new eee(a,r,s)):this.errors.push(new Lc(a,r,s))},this.directives=new ar({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=qN(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment} +${r}`:r;else if(s||t.directives.docStart||!i)t.commentBefore=r;else if(hn(i)&&!i.flow&&i.items.length>0){let a=i.items[0];mn(a)&&(a=a.key);const o=a.commentBefore;a.commentBefore=o?`${r} ${o}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r} -${a}`:r}}if(n){for(let i=0;i{const i=mc(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=bee(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Rc(mc(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Rc(mc(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Sd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Rc(mc(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new Nd(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const YM="\uFEFF",WM="",qM="",O1="";function xee(e){switch(e){case YM:return"byte-order-mark";case WM:return"doc-mode";case qM:return"flow-error-end";case O1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${a}`:r}}if(n){for(let i=0;i{const i=yc(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=xee(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Lc(yc(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Lc(yc(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Cd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Lc(yc(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new Ad(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const WM="\uFEFF",qM="",GM="",L1="";function vee(e){switch(e){case WM:return"byte-order-mark";case qM:return"doc-mode";case GM:return"flow-error-end";case L1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function es(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const Gk=new Set("0123456789ABCDEFabcdef"),wee=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Rf=new Set(",[]{}"),vee=new Set(` ,[]{} -\r `),h0=e=>!e||vee.has(e);class _ee{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ts(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const GN=new Set("0123456789ABCDEFabcdef"),_ee=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Lf=new Set(",[]{}"),Tee=new Set(` ,[]{} +\r `),p0=e=>!e||Tee.has(e);class Nee{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===` `||!s&&!this.atEnd)return t+r+1}return n===` -`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&es(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!es(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&es(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(h0),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ts(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ts(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ts(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(p0),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>es(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case` +`,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ts(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case` `:t=i,n=0;break;case"\r":{const a=this.buffer[i+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===` `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(` `,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` `;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let i=t-1,a=this.buffer[i];a==="\r"&&(a=this.buffer[--i]);const o=i;for(;a===" ";)a=this.buffer[--i];if(a===` -`&&i>=this.pos&&i+1+n>o)t=i;else break}while(!0);return yield O1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(es(i)||t&&Rf.has(i))break;n=r}else if(es(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` +`&&i>=this.pos&&i+1+n>o)t=i;else break}while(!0);return yield L1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(ts(i)||t&&Lf.has(i))break;n=r}else if(ts(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` `?(r+=1,s=` -`,i=this.buffer[r+1]):n=r),i==="#"||t&&Rf.has(i))break;if(s===` -`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Rf.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield O1,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(h0),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(es(r)||n&&Rf.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!es(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(wee.has(n))n=this.buffer[++t];else if(n==="%"&&Gk.has(this.buffer[t+1])&&Gk.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`,i=this.buffer[r+1]):n=r),i==="#"||t&&Lf.has(i))break;if(s===` +`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Lf.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield L1,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(p0),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ts(r)||n&&Lf.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ts(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(_ee.has(n))n=this.buffer[++t];else if(n==="%"&&GN.has(this.buffer[t+1])&&GN.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Tee{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[i]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function _p(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Qk(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Xk(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class kee{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[i]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Np(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&QN(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&XN(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let l=0;lt.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ki(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(GM(n.key)&&!ki(n.sep,"newline")){const o=po(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(ki(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=po(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):ki(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ki(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){_p(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ki(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Of(r),i=po(s);Qk(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Np(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let l=0;lt.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ki(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(XM(n.key)&&!ki(n.sep,"newline")){const o=mo(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(ki(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=mo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):ki(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ki(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Np(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ki(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Mf(r),i=mo(s);QN(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Of(t),r=po(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Of(t),r=po(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Nee(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Tee||null,prettyErrors:t}}function See(e,t={}){const{lineCounter:n,prettyErrors:r}=Nee(t),s=new kee(n==null?void 0:n.addNewLine),i=new Eee(t);let a=null;for(const o of i.compose(s.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new Rc(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(Yk(e,n)),a.warnings.forEach(Yk(e,n))),a}function Aee(e,t,n){let r;const s=See(e,n);if(!s)return null;if(s.warnings.forEach(i=>wM(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function Cee(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return vd(e)&&!r?e.toString(n):new Nd(e,r,n).toString(n)}const Iee="https://ark.cn-beijing.volces.com/api/v3/",iu=[{key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615",comment:"向量化模型(记忆/知识库需要)"},{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:Iee}],vl=[],gc=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],ri={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},XM=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请输入智能体中心 ID,如 as-yer579143kbrkemozdn6",comment:"AgentKit 智能体中心 ID"},{key:"REGISTRY_TOP_K",required:!1,placeholder:ri.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:ri.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:ri.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],Ox=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:vl},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:vl},{id:"link_reader",label:"网页读取",desc:"抓取并阅读给定链接的正文内容。",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",label:"网页爬取",desc:"结构化爬取网页(需要 Scraper 服务)。",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",label:"图像生成",desc:"文生图(Doubao Seedream)。",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",label:"图像编辑",desc:"图生图 / 编辑(Doubao SeedEdit)。",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",label:"视频生成",desc:"文/图生视频(Doubao Seedance),含任务查询。",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",label:"语音合成 (TTS)",desc:"把文本转成语音(火山语音)。",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"vesearch",label:"VeSearch 智能搜索",desc:"火山 VeSearch(需要 bot 端点)。",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],Tp=[{id:"local",label:"本地内存",desc:"进程内,不持久化。适合开发调试。",env:[]},{id:"sqlite",label:"SQLite 文件",desc:"持久化到本地 .db 文件。",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",label:"MySQL",desc:"持久化到 MySQL。",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",label:"PostgreSQL",desc:"持久化到 PostgreSQL。",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],kp=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:iu,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...iu],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",label:"Redis",desc:"Redis 向量检索。",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...iu],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:vl},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Np=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:iu,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...iu],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:vl},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...vl,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],Sp=[{id:"apmplus",label:"APMPlus",desc:"火山 APMPlus 应用性能监控。",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",label:"CozeLoop",desc:"扣子 CozeLoop 链路观测。",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",label:"TLS (日志服务)",desc:"火山 TLS 日志服务导出。",enableFlag:"ENABLE_TLS",env:[...vl,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],Ree=e=>Ox.find(t=>t.id===e),Oee=e=>Tp.find(t=>t.id===e),Lee=e=>kp.find(t=>t.id===e),Mee=e=>Np.find(t=>t.id===e),Dee=e=>Sp.find(t=>t.id===e),Pee="doubao-seed-2-1-pro-260628",jee="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Bee=`你是一个专业、可靠的智能助手。 +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Mf(t),r=mo(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Mf(t),r=mo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Aee(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new kee||null,prettyErrors:t}}function Cee(e,t={}){const{lineCounter:n,prettyErrors:r}=Aee(t),s=new See(n==null?void 0:n.addNewLine),i=new wee(t);let a=null;for(const o of i.compose(s.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new Lc(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(YN(e,n)),a.warnings.forEach(YN(e,n))),a}function Iee(e,t,n){let r;const s=Cee(e,n);if(!s)return null;if(s.warnings.forEach(i=>vM(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function Ree(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return Td(e)&&!r?e.toString(n):new Ad(e,r,n).toString(n)}const Oee="https://ark.cn-beijing.volces.com/api/v3/",ou=[{key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615",comment:"向量化模型(记忆/知识库需要)"},{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:Oee}],_l=[],bc=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],hs={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},QM=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:hs.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:hs.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:hs.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],Ox=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:_l},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:_l},{id:"link_reader",label:"网页读取",desc:"抓取并阅读给定链接的正文内容。",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",label:"网页爬取",desc:"结构化爬取网页(需要 Scraper 服务)。",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",label:"图像生成",desc:"文生图(Doubao Seedream)。",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",label:"图像编辑",desc:"图生图 / 编辑(Doubao SeedEdit)。",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",label:"视频生成",desc:"文/图生视频(Doubao Seedance),含任务查询。",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",label:"语音合成 (TTS)",desc:"把文本转成语音(火山语音)。",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"vesearch",label:"VeSearch 智能搜索",desc:"火山 VeSearch(需要 bot 端点)。",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],kp=[{id:"local",label:"本地内存",desc:"进程内,不持久化。适合开发调试。",env:[]},{id:"sqlite",label:"SQLite 文件",desc:"持久化到本地 .db 文件。",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",label:"MySQL",desc:"持久化到 MySQL。",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",label:"PostgreSQL",desc:"持久化到 PostgreSQL。",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],Sp=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:ou,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",label:"Redis",desc:"Redis 向量检索。",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:_l},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Ap=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:ou,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:_l},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[..._l,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],Cp=[{id:"apmplus",label:"APMPlus",desc:"火山 APMPlus 应用性能监控。",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",label:"CozeLoop",desc:"扣子 CozeLoop 链路观测。",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",label:"TLS (日志服务)",desc:"火山 TLS 日志服务导出。",enableFlag:"ENABLE_TLS",env:[..._l,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],Lee=e=>Ox.find(t=>t.id===e),Mee=e=>kp.find(t=>t.id===e),Dee=e=>Sp.find(t=>t.id===e),Pee=e=>Ap.find(t=>t.id===e),jee=e=>Cp.find(t=>t.id===e),Bee="doubao-seed-2-1-pro-260628",Fee="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Uee=`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`;function Gi(){return{name:"",description:jee,instruction:Bee,agentType:"llm",maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:Pee,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:"local",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const Fee=new Set(["local","sqlite","mysql","postgresql"]),Uee=new Set(["local","opensearch","redis","viking","mem0"]),$ee=new Set(["local","opensearch","viking","context_search"]),Hee=new Set(["apmplus","cozeloop","tls"]),QM=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","vesearch"]),zee=new Set(["llm","sequential","parallel","loop","a2a"]);function lt(e,t=""){return typeof e=="string"?e:t}function ma(e){return e===!0}function bh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function ZM(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:lt(t.name),description:lt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function p0(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function JM(e){return typeof e=="string"&&zee.has(e)?e:"llm"}function e3(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function t3(e){const t=e&&typeof e=="object"?e:{};return{enabled:ma(t.enabled),registrySpaceId:lt(t.registrySpaceId),registryTopK:lt(t.registryTopK),registryRegion:lt(t.registryRegion),registryEndpoint:lt(t.registryEndpoint)}}function n3(e){return Array.isArray(e)?e.map(t=>{const n=t&&typeof t=="object"?t:{},r=t3(n.a2aRegistry),s=JM(n.agentType),i=r.enabled&&s==="llm"?"a2a":s;return{...Gi(),name:lt(n.name),description:lt(n.description),instruction:lt(n.instruction),agentType:i,maxIterations:e3(n.maxIterations),a2aUrl:lt(n.a2aUrl),builtinTools:bh(n.builtinTools).filter(a=>QM.has(a)),customTools:ZM(n.customTools),a2aRegistry:i==="a2a"?{...r,enabled:!0}:r,subAgents:n3(n.subAgents)}}):[]}function Vee(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=lt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=lt(r.name)||lt(r.slug)||lt(r.skillName)||lt(r.skillId)||"skill",o=lt(r.folder)||a,l=lt(r.description);if(i==="skillhub"){const f=lt(r.slug);if(!f)continue;t.push({source:i,folder:o,name:a,description:l,slug:f,namespace:lt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},b=lt(m.path),w=lt(m.content);return b?{path:b,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:o,name:a,description:l,localFiles:h});continue}const u=lt(r.skillSpaceId),d=lt(r.skillId);!u||!d||t.push({source:i,folder:o,name:a,description:l,skillSpaceId:u,skillSpaceName:lt(r.skillSpaceName),skillId:d,version:lt(r.version)})}return t}function r3(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},r=t.deployment&&typeof t.deployment=="object"?t.deployment:{},s=t3(t.a2aRegistry),i=JM(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,o=Array.isArray(t.mcpTools)?t.mcpTools.map(l=>{const u=l&&typeof l=="object"?l:{},d=u.transport==="stdio"?"stdio":"http";return{name:lt(u.name),transport:d,url:lt(u.url),authToken:lt(u.authToken),command:lt(u.command),args:bh(u.args)}}).filter(l=>l.transport==="http"?!!l.url:!!l.command):[];return{...Gi(),name:lt(t.name)||"my_agent",description:lt(t.description),instruction:lt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:e3(t.maxIterations),a2aUrl:lt(t.a2aUrl),modelName:lt(t.modelName),modelProvider:lt(t.modelProvider),modelApiBase:lt(t.modelApiBase),builtinTools:bh(t.builtinTools).filter(l=>QM.has(l)),customTools:ZM(t.customTools),mcpTools:o,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:ma(n.shortTerm),longTerm:ma(n.longTerm)},shortTermBackend:p0(t.shortTermBackend,Fee,"local"),longTermBackend:p0(t.longTermBackend,Uee,"local"),autoSaveSession:ma(t.autoSaveSession),knowledgebase:ma(t.knowledgebase),knowledgebaseBackend:p0(t.knowledgebaseBackend,$ee,"local"),tracing:ma(t.tracing),tracingExporters:bh(t.tracingExporters).filter(l=>Hee.has(l)),deployment:{feishuEnabled:ma(r.feishuEnabled)},subAgents:n3(t.subAgents),selectedSkills:Vee(t)}}function s3(e){var n,r,s,i,a,o,l,u,d,f,h,p,m,b,w,g,E;const t={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((n=e.a2aRegistry)!=null&&n.enabled){const y={enabled:!0};(r=e.a2aRegistry.registrySpaceId)!=null&&r.trim()&&(y.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),y.registryTopK=((s=e.a2aRegistry.registryTopK)==null?void 0:s.trim())||ri.topK,y.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||ri.region,y.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||ri.endpoint,t.a2aRegistry=y}return t}return t.name=e.name,t.description=e.description,t.instruction=e.instruction,e.agentType==="loop"&&(t.maxIterations=e.maxIterations??3),(o=e.modelName)!=null&&o.trim()&&(t.modelName=e.modelName.trim()),(l=e.modelProvider)!=null&&l.trim()&&(t.modelProvider=e.modelProvider.trim()),(u=e.modelApiBase)!=null&&u.trim()&&(t.modelApiBase=e.modelApiBase.trim()),(d=e.builtinTools)!=null&&d.length&&(t.builtinTools=[...e.builtinTools]),(f=e.customTools)!=null&&f.length&&(t.customTools=e.customTools.map(y=>({name:y.name,description:y.description}))),(h=e.mcpTools)!=null&&h.length&&(t.mcpTools=e.mcpTools.map(y=>{var k,T,C,N;const _={name:y.name,transport:y.transport};return(k=y.url)!=null&&k.trim()&&(_.url=y.url.trim()),(T=y.authToken)!=null&&T.trim()&&(_.authToken=y.authToken.trim()),(C=y.command)!=null&&C.trim()&&(_.command=y.command.trim()),(N=y.args)!=null&&N.length&&(_.args=y.args),_})),((p=e.memory)!=null&&p.shortTerm||(m=e.memory)!=null&&m.longTerm)&&(t.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(t.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(t.longTermBackend=e.longTermBackend||"local",t.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(t.knowledgebase=!0,t.knowledgebaseBackend=e.knowledgebaseBackend||"local"),e.tracing&&((b=e.tracingExporters)!=null&&b.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(w=e.deployment)!=null&&w.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(g=e.selectedSkills)!=null&&g.length&&(t.selectedSkills=e.selectedSkills.map(y=>{const _={source:y.source,name:y.name,folder:y.folder};return y.description&&(_.description=y.description),y.source==="skillhub"?(_.slug=y.slug,_.namespace=y.namespace??"public"):y.source==="local"?_.localFiles=y.localFiles??[]:(_.skillSpaceId=y.skillSpaceId,_.skillSpaceName=y.skillSpaceName,_.skillId=y.skillId,y.version&&(_.version=y.version)),_})),(E=e.subAgents)!=null&&E.length&&(t.subAgents=e.subAgents.map(s3)),t}function Kee(e){return`# VeADK Agent 结构配置 +- 保持礼貌、专业的语气。`;function Xi(){return{name:"",description:Fee,instruction:Uee,agentType:"llm",maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:Bee,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:"local",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const $ee=new Set(["local","sqlite","mysql","postgresql"]),Hee=new Set(["local","opensearch","redis","viking","mem0"]),zee=new Set(["local","opensearch","viking","context_search"]),Vee=new Set(["apmplus","cozeloop","tls"]),ZM=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","vesearch"]),Kee=new Set(["llm","sequential","parallel","loop","a2a"]);function lt(e,t=""){return typeof e=="string"?e:t}function ga(e){return e===!0}function xh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function JM(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:lt(t.name),description:lt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function m0(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function e3(e){return typeof e=="string"&&Kee.has(e)?e:"llm"}function t3(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function n3(e){const t=e&&typeof e=="object"?e:{};return{enabled:ga(t.enabled),registrySpaceId:lt(t.registrySpaceId),registryTopK:lt(t.registryTopK),registryRegion:lt(t.registryRegion),registryEndpoint:lt(t.registryEndpoint)}}function r3(e){return Array.isArray(e)?e.map(t=>{const n=t&&typeof t=="object"?t:{},r=n3(n.a2aRegistry),s=e3(n.agentType),i=r.enabled&&s==="llm"?"a2a":s;return{...Xi(),name:lt(n.name),description:lt(n.description),instruction:lt(n.instruction),agentType:i,maxIterations:t3(n.maxIterations),a2aUrl:lt(n.a2aUrl),builtinTools:xh(n.builtinTools).filter(a=>ZM.has(a)),customTools:JM(n.customTools),a2aRegistry:i==="a2a"?{...r,enabled:!0}:r,subAgents:r3(n.subAgents)}}):[]}function Yee(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=lt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=lt(r.name)||lt(r.slug)||lt(r.skillName)||lt(r.skillId)||"skill",o=lt(r.folder)||a,l=lt(r.description);if(i==="skillhub"){const f=lt(r.slug);if(!f)continue;t.push({source:i,folder:o,name:a,description:l,slug:f,namespace:lt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},y=lt(m.path),w=lt(m.content);return y?{path:y,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:o,name:a,description:l,localFiles:h});continue}const u=lt(r.skillSpaceId),d=lt(r.skillId);!u||!d||t.push({source:i,folder:o,name:a,description:l,skillSpaceId:u,skillSpaceName:lt(r.skillSpaceName),skillId:d,version:lt(r.version)})}return t}function s3(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},r=t.deployment&&typeof t.deployment=="object"?t.deployment:{},s=n3(t.a2aRegistry),i=e3(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,o=Array.isArray(t.mcpTools)?t.mcpTools.map(l=>{const u=l&&typeof l=="object"?l:{},d=u.transport==="stdio"?"stdio":"http";return{name:lt(u.name),transport:d,url:lt(u.url),authToken:lt(u.authToken),command:lt(u.command),args:xh(u.args)}}).filter(l=>l.transport==="http"?!!l.url:!!l.command):[];return{...Xi(),name:lt(t.name)||"my_agent",description:lt(t.description),instruction:lt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:t3(t.maxIterations),a2aUrl:lt(t.a2aUrl),modelName:lt(t.modelName),modelProvider:lt(t.modelProvider),modelApiBase:lt(t.modelApiBase),builtinTools:xh(t.builtinTools).filter(l=>ZM.has(l)),customTools:JM(t.customTools),mcpTools:o,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:ga(n.shortTerm),longTerm:ga(n.longTerm)},shortTermBackend:m0(t.shortTermBackend,$ee,"local"),longTermBackend:m0(t.longTermBackend,Hee,"local"),autoSaveSession:ga(t.autoSaveSession),knowledgebase:ga(t.knowledgebase),knowledgebaseBackend:m0(t.knowledgebaseBackend,zee,"local"),tracing:ga(t.tracing),tracingExporters:xh(t.tracingExporters).filter(l=>Vee.has(l)),deployment:{feishuEnabled:ga(r.feishuEnabled)},subAgents:r3(t.subAgents),selectedSkills:Yee(t)}}function i3(e){var n,r,s,i,a,o,l,u,d,f,h,p,m,y,w,g,E;const t={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((n=e.a2aRegistry)!=null&&n.enabled){const b={enabled:!0};(r=e.a2aRegistry.registrySpaceId)!=null&&r.trim()&&(b.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),b.registryTopK=((s=e.a2aRegistry.registryTopK)==null?void 0:s.trim())||hs.topK,b.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||hs.region,b.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||hs.endpoint,t.a2aRegistry=b}return t}return t.name=e.name,t.description=e.description,t.instruction=e.instruction,e.agentType==="loop"&&(t.maxIterations=e.maxIterations??3),(o=e.modelName)!=null&&o.trim()&&(t.modelName=e.modelName.trim()),(l=e.modelProvider)!=null&&l.trim()&&(t.modelProvider=e.modelProvider.trim()),(u=e.modelApiBase)!=null&&u.trim()&&(t.modelApiBase=e.modelApiBase.trim()),(d=e.builtinTools)!=null&&d.length&&(t.builtinTools=[...e.builtinTools]),(f=e.customTools)!=null&&f.length&&(t.customTools=e.customTools.map(b=>({name:b.name,description:b.description}))),(h=e.mcpTools)!=null&&h.length&&(t.mcpTools=e.mcpTools.map(b=>{var N,T,A,k;const _={name:b.name,transport:b.transport};return(N=b.url)!=null&&N.trim()&&(_.url=b.url.trim()),(T=b.authToken)!=null&&T.trim()&&(_.authToken=b.authToken.trim()),(A=b.command)!=null&&A.trim()&&(_.command=b.command.trim()),(k=b.args)!=null&&k.length&&(_.args=b.args),_})),((p=e.memory)!=null&&p.shortTerm||(m=e.memory)!=null&&m.longTerm)&&(t.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(t.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(t.longTermBackend=e.longTermBackend||"local",t.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(t.knowledgebase=!0,t.knowledgebaseBackend=e.knowledgebaseBackend||"local"),e.tracing&&((y=e.tracingExporters)!=null&&y.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(w=e.deployment)!=null&&w.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(g=e.selectedSkills)!=null&&g.length&&(t.selectedSkills=e.selectedSkills.map(b=>{const _={source:b.source,name:b.name,folder:b.folder};return b.description&&(_.description=b.description),b.source==="skillhub"?(_.slug=b.slug,_.namespace=b.namespace??"public"):b.source==="local"?_.localFiles=b.localFiles??[]:(_.skillSpaceId=b.skillSpaceId,_.skillSpaceName=b.skillSpaceName,_.skillId=b.skillId,b.version&&(_.version=b.version)),_})),(E=e.subAgents)!=null&&E.length&&(t.subAgents=e.subAgents.map(i3)),t}function Wee(e){return`# VeADK Agent 结构配置 # 可在「创建 Agent」页通过「导入 YAML」重新载入。 -`+Cee(s3(e))}function Yee(e){const t=Aee(e);return r3(t)}const Wee=[{kind:"custom",icon:UF,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:SF,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:wF,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:$F,title:"工作流",desc:"敬请期待",disabled:!0}];function qee({onSelect:e,onImport:t}){const n=v.useRef(null),[r,s]=v.useState(""),i=Wee.map(o=>({key:o.kind,icon:o.icon,title:o.title,desc:o.desc,disabled:o.disabled,onClick:()=>e(o.kind)})),a=async o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];if(o.target.value="",!!l)try{const d=await l.text();t(Yee(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return c.jsx(dM,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c.jsxs("button",{className:"stk-import",onClick:()=>{var o;return(o=n.current)==null?void 0:o.click()},children:[c.jsx(BF,{}),"导入 YAML 配置"]}),r&&c.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),c.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const Gee="modulepreload",Xee=function(e){return"/"+e},Zk={},el=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=Xee(l),l in Zk)return;Zk[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Gee,u||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})};function Qee({className:e,...t}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[c.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),c.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}const xo={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:Qee},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:CI},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:DI},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:AE},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:lm}},Lf=[xo.llm,xo.sequential,xo.parallel,xo.loop,xo.a2a];function Lx(e){return xo[e??"llm"]}const i3=e=>e==="sequential"||e==="parallel"||e==="loop",Ad=e=>e==="a2a";function a3(e){const t=new Map,n={};for(const r of e){for(const s of r.env){const i=t.get(s.key);(!i||s.required&&!i.required)&&t.set(s.key,s)}r.enableFlag&&(t.set(r.enableFlag,{key:r.enableFlag,required:!0}),n[r.enableFlag]="true")}return{specs:[...t.values()],fixedValues:n}}function Zee(e,t){return a3([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function Jee(e,t){const n=new Map;for(const r of e){const s=t[r.key]??"";s.trim()&&n.set(r.key,s)}return[...n].map(([r,s])=>({key:r,value:s}))}function Jk(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const ete=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function tte(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Jt(e,t){e.push(t&255,t>>>8&255)}function Tr(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const eN=2048,m0=20,tN=0;function nte(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),b=t.encode(p.content),w=tte(b),g=b.length,E=[];Tr(E,67324752),Jt(E,m0),Jt(E,eN),Jt(E,tN),Jt(E,0),Jt(E,0),Tr(E,w),Tr(E,g),Tr(E,g),Jt(E,m.length),Jt(E,0);const y=Uint8Array.from(E);n.push(y,m,b),r.push({nameBytes:m,dataBytes:b,crc:w,size:g,offset:s}),s+=y.length+m.length+b.length}const i=s,a=[];let o=0;for(const p of r){const m=[];Tr(m,33639248),Jt(m,m0),Jt(m,m0),Jt(m,eN),Jt(m,tN),Jt(m,0),Jt(m,0),Tr(m,p.crc),Tr(m,p.size),Tr(m,p.size),Jt(m,p.nameBytes.length),Jt(m,0),Jt(m,0),Jt(m,0),Jt(m,0),Tr(m,0),Tr(m,p.offset);const b=Uint8Array.from(m);a.push(b,p.nameBytes),o+=b.length+p.nameBytes.length}const l=[];Tr(l,101010256),Jt(l,0),Jt(l,0),Jt(l,r.length),Jt(l,r.length),Tr(l,o),Tr(l,i),Jt(l,0);const u=[...n,...a,Uint8Array.from(l)],d=u.reduce((p,m)=>p+m.length,0),f=new Uint8Array(d);let h=0;for(const p of u)f.set(p,h),h+=p.length;return new Blob([f],{type:"application/zip"})}const rte=v.lazy(()=>el(()=>import("./CodeEditor-C7VckftE.js"),[]));function ste(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t;r.forEach((i,a)=>{let o=s.children.get(i);o||(o={name:i,children:new Map},s.children.set(i,o)),a===r.length-1&&(o.path=n.path),s=o})}return t}function ite(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,s=n.children.size>0&&n.path===void 0;return r!==s?r?-1:1:t.name.localeCompare(n.name)})}function ate({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=v.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,o]=v.useState(new Set),l=v.useRef(null),u=v.useMemo(()=>ste(e.files),[e.files]),d=e.files.find(b=>b.path===s)??null;if(v.useEffect(()=>{var g;if(!t)return;const b=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const w=E=>{E.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=b,window.removeEventListener("keydown",w)}},[n,t]),v.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(b){o(w=>{const g=new Set(w);return g.has(b)?g.delete(b):g.add(b),g})}function h(b,w,g){return ite(b).map(E=>{const y=g?`${g}/${E.name}`:E.name;if(!(E.children.size>0&&E.path===void 0)&&E.path)return c.jsxs("button",{type:"button",className:`code-browser-file${s===E.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(E.path??null),title:E.path,children:[c.jsx(B_,{"aria-hidden":"true"}),c.jsx("span",{children:E.name})]},y);const k=a.has(y);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(y),"aria-expanded":!k,children:[c.jsx(or,{className:k?"":"is-open","aria-hidden":"true"}),c.jsx(AI,{"aria-hidden":"true"}),c.jsx("span",{children:E.name})]}),!k&&h(E,w+1,y)]},y)})}function p(b){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:b}:w)})}return Ua.createPortal(c.jsx("div",{className:"code-browser-backdrop",onMouseDown:b=>{b.target===b.currentTarget&&n()},children:c.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[c.jsxs("header",{className:"code-browser-head",children:[c.jsxs("div",{className:"code-browser-title-wrap",children:[c.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:c.jsx(vE,{})}),c.jsxs("div",{children:[c.jsx("h2",{id:"code-browser-title",children:"项目代码"}),c.jsx("p",{children:e.name||"Agent 项目"})]})]}),c.jsx("button",{ref:l,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:c.jsx(Gr,{"aria-hidden":"true"})})]}),c.jsxs("div",{className:"code-browser-workspace",children:[c.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[c.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",c.jsx("span",{children:e.files.length})]}),c.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):c.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),c.jsxs("main",{className:"code-browser-main",children:[c.jsxs("div",{className:"code-browser-path",children:[c.jsx(B_,{"aria-hidden":"true"}),c.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),c.jsx("div",{className:"code-browser-editor",children:d?c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:c.jsx(rte,{value:d.content,path:d.path,onChange:p})}):c.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function ote({project:e,onChange:t,className:n=""}){const[r,s]=v.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[c.jsx(vE,{"aria-hidden":"true"}),c.jsx("span",{children:"查看源码"})]}),c.jsx(ate,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function lte({className:e,...t}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[c.jsx("path",{d:"m12 2.75 4.25 2.45v4.9L12 12.55 7.75 10.1V5.2L12 2.75Z"}),c.jsx("path",{d:"m7.75 5.2 4.25 2.45 4.25-2.45M12 7.65v4.9"}),c.jsx("path",{d:"M12 12.55v4.7m-2.25-2.2L12 17.3l2.25-2.25"}),c.jsx("path",{d:"M5.5 17.25v2.25a1.75 1.75 0 0 0 1.75 1.75h9.5a1.75 1.75 0 0 0 1.75-1.75v-2.25"})]})}function Ap({message:e,className:t="",onRetry:n}){const[r,s]=v.useState(!1),[i,a]=v.useState(!1),[o,l]=v.useState(!1),u=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{a(!1)}},d=async()=>{if(!(!n||o)){l(!0);try{await n()}finally{l(!1)}}};return c.jsxs("div",{className:`deploy-error-message${r?" is-expanded":""}${t?` ${t}`:""}`,children:[c.jsx("p",{className:"deploy-error-message-text",children:e}),c.jsxs("div",{className:"deploy-error-message-actions",children:[n&&c.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:o,onClick:()=>void d(),children:[o?c.jsx(wt,{className:"spin"}):c.jsx(MI,{}),o?"重试中…":"重试部署"]}),c.jsx("button",{type:"button",title:r?"收起错误信息":"展开完整错误信息","aria-label":r?"收起错误信息":"展开完整错误信息",onClick:()=>s(f=>!f),children:r?c.jsx(CF,{}):c.jsx(Wc,{})}),c.jsx("button",{type:"button",title:i?"已复制":"复制完整错误信息","aria-label":i?"已复制":"复制完整错误信息",onClick:()=>void u(),children:i?c.jsx(Ds,{}):c.jsx(_E,{})})]})]})}Er.registerLanguage("python",RO);Er.registerLanguage("typescript",zO);Er.registerLanguage("javascript",kO);Er.registerLanguage("json",NO);Er.registerLanguage("yaml",VO);Er.registerLanguage("markdown",IO);Er.registerLanguage("bash",EO);Er.registerLanguage("ini",xO);Er.registerLanguage("dockerfile",wY);Er.registerLanguage("makefile",CO);const cte=v.lazy(()=>el(()=>import("./CodeEditor-C7VckftE.js"),[]));function ute({open:e,onCancel:t,onConfirm:n}){const r=v.useRef(null);return v.useEffect(()=>{var a;if(!e)return;const s=document.body.style.overflow;document.body.style.overflow="hidden",(a=r.current)==null||a.focus();const i=o=>{o.key==="Escape"&&t()};return window.addEventListener("keydown",i),()=>{document.body.style.overflow=s,window.removeEventListener("keydown",i)}},[t,e]),e?Ua.createPortal(c.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:s=>{s.target===s.currentTarget&&t()},children:c.jsxs("section",{className:"code-browser-dialog pp-confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"pp-confirm-title","aria-describedby":"pp-confirm-description",children:[c.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[c.jsxs("div",{className:"code-browser-title-wrap",children:[c.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:c.jsx(jF,{})}),c.jsx("h2",{id:"pp-confirm-title",children:"确认部署"})]}),c.jsx("button",{type:"button",className:"code-browser-close",onClick:t,"aria-label":"关闭部署确认",children:c.jsx(Gr,{"aria-hidden":"true"})})]}),c.jsx("div",{className:"pp-confirm-body",children:c.jsx("p",{id:"pp-confirm-description",children:"部署后暂不支持修改 Agent 配置,确定部署吗?"})}),c.jsxs("footer",{className:"pp-confirm-actions",children:[c.jsx("button",{ref:r,type:"button",onClick:t,children:"取消"}),c.jsx("button",{type:"button",className:"is-primary",onClick:n,children:"确定部署"})]})]})}),document.body):null}const dte={py:"python",pyi:"python",ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",env:"ini",txt:"plaintext"},nN={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function rN(e){return e.replace(/&/g,"&").replace(//g,">")}function fte(e){const n=(e.split("/").pop()??e).toLowerCase();if(nN[n])return nN[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const r=n.lastIndexOf(".");if(r===-1)return null;const s=n.slice(r+1);return dte[s]??null}function hte(e,t){try{const n=fte(t);return n&&Er.getLanguage(n)?Er.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?Er.highlightAuto(e).value:rN(e)}catch{return rN(e)}}const Mf=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}];function pte(e){return e.trim().replace(/[。.!!]+$/u,"")}function g0(e,t="未配置"){return[...new Set(e.map(r=>r==null?void 0:r.trim()).filter(Boolean))].join("、")||t}function o3(e,t="root"){var a,o,l;const n=e.agentType??"llm",r=[...(e.builtinTools??[]).map(u=>{var d;return((d=Ree(u))==null?void 0:d.label)??u}),...(e.customTools??[]).map(u=>u.name),...(e.mcpTools??[]).map(u=>u.name),...e.tools??[]],s=[...(e.selectedSkills??[]).map(u=>u.name),...e.skills??[]],i=e.memory.longTerm?((a=Lee(e.longTermBackend??"local"))==null?void 0:a.label)??e.longTermBackend:void 0;return{id:t,name:e.name.trim()||"未命名 Agent",type:n,description:pte(e.description),model:n==="llm"?e.modelName||e.model||"默认模型":"不适用",tools:g0(r),skills:g0(s),knowledgebase:e.knowledgebase?((o=Mee(e.knowledgebaseBackend??"local"))==null?void 0:o.label)??e.knowledgebaseBackend??"默认知识库":"未配置",shortTerm:e.memory.shortTerm?((l=Oee(e.shortTermBackend??"local"))==null?void 0:l.label)??e.shortTermBackend??"默认后端":"未配置",longTerm:i?`${i}${e.autoSaveSession?" · 自动保存会话":""}`:"未配置",tracing:e.tracing?g0((e.tracingExporters??[]).map(u=>{var d;return((d=Dee(u))==null?void 0:d.label)??u}),"默认观测"):"未配置",children:e.subAgents.map((u,d)=>o3(u,`${t}.${d}`))}}function l3(e,t){if(e.id===t)return e;for(const n of e.children){const r=l3(n,t);if(r)return r}}function c3({agent:e,depth:t,inspectedId:n,onHover:r,onFocus:s}){const i=Lx(e.type),a=i.icon;return c.jsxs("div",{className:"pp-topology-branch",children:[c.jsxs("button",{type:"button",className:`pp-agent-node${e.id===n?" is-inspected":""}`,style:{marginLeft:t*16,width:`calc(100% - ${t*16}px)`},onMouseEnter:()=>r(e.id),onMouseLeave:()=>r(null),onFocus:()=>s(e.id),onBlur:()=>s(null),"aria-label":`查看 ${e.name} 配置`,children:[c.jsx("span",{className:"pp-agent-node-icon",children:c.jsx(a,{"aria-hidden":"true"})}),c.jsxs("span",{className:"pp-agent-node-main",children:[c.jsx("span",{className:"pp-agent-node-name",children:e.name}),c.jsx("span",{className:"pp-agent-node-type",children:i.label})]}),e.children.length>0&&c.jsx("span",{className:"pp-agent-child-count",children:e.children.length})]}),e.children.length>0&&c.jsx("div",{className:"pp-topology-children",children:e.children.map(o=>c.jsx(c3,{agent:o,depth:t+1,inspectedId:n,onHover:r,onFocus:s},o.id))})]})}function mte(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t;r.forEach((i,a)=>{let o=s.children.get(i);o||(o={name:i,children:new Map},s.children.set(i,o)),a===r.length-1&&(o.path=n.path),s=o})}return t}function gte(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,s=n.children.size>0&&n.path===void 0;return r!==s?r?-1:1:t.name.localeCompare(n.name)})}function yte(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function bte({left:e,right:t}){const[n,r]=v.useState(null);return v.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?c.jsxs(c.Fragment,{children:[Ua.createPortal(e,n.left),Ua.createPortal(t,n.right)]}):c.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function Mx({project:e,agentDraft:t,agentName:n,agentCount:r,onChange:s,onDeploy:i,onAgentAdded:a,onDeploymentTaskChange:o,feishuEnabled:l=!1,onFeishuEnabledChange:u,deploymentEnv:d=[],deploymentEnvValues:f={},onDeploymentEnvChange:h,network:p,onNetworkChange:m,deployRegion:b="cn-beijing",onDeployRegionChange:w,onBack:g,onExportYaml:E}){var Qe,on,ln;const y=typeof s=="function",[_,k]=v.useState(((on=(Qe=e==null?void 0:e.files)==null?void 0:Qe[0])==null?void 0:on.path)??null),[T,C]=v.useState(new Set),[N,R]=v.useState(!1),[I,M]=v.useState(""),[B,Y]=v.useState(!1),[P,U]=v.useState(!1),[A,L]=v.useState(!1),[O,j]=v.useState(null),[S,H]=v.useState(null),[V,D]=v.useState({}),[ne,J]=v.useState(null),[re,de]=v.useState(!1),[G,W]=v.useState([]),[ae,he]=v.useState(!1),[Z,ce]=v.useState(null),[Ce,Ee]=v.useState(null),ge=v.useRef(!0),Me=v.useMemo(()=>t?o3(t):{id:"root",name:n||(e==null?void 0:e.name)||"未命名 Agent",type:"llm",description:"",model:"默认模型",tools:"未配置",skills:"未配置",knowledgebase:"未配置",shortTerm:"未配置",longTerm:"未配置",tracing:"未配置",children:[]},[t,n,e==null?void 0:e.name]),ve=Ce??Z,$e=ve?l3(Me,ve):void 0,Re=$e?Lx($e.type):void 0,oe=Re==null?void 0:Re.icon;v.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const _t=v.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:mte(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return c.jsx("div",{className:"pp-error",children:"项目数据无效"});const we=e.files.find(ie=>ie.path===_)??null,Tt=(p==null?void 0:p.mode)??"public",ct=Zee(l?[...d,...gc]:d,f),K=ct.length+G.length;function X(ie){C(_e=>{const ye=new Set(_e);return ye.has(ie)?ye.delete(ie):ye.add(ie),ye})}function le(ie,_e){s&&(s({...e,files:ie}),_e!==void 0&&k(_e))}function ke(ie){we&&le(e.files.map(_e=>_e.path===we.path?{..._e,content:ie}:_e))}function Oe(){const ie=I.trim();if(R(!1),M(""),!!ie){if(e.files.some(_e=>_e.path===ie)){k(ie);return}le([...e.files,{path:ie,content:""}],ie)}}function ut(){if(!we)return;const ie=window.prompt("重命名文件",we.path),_e=ie==null?void 0:ie.trim();!_e||_e===we.path||e.files.some(ye=>ye.path===_e)||le(e.files.map(ye=>ye.path===we.path?{...ye,path:_e}:ye),_e)}function We(){var _e;if(!we)return;const ie=e.files.filter(ye=>ye.path!==we.path);le(ie,((_e=ie[0])==null?void 0:_e.path)??null)}function ot(ie,_e){W(ye=>ye.map(Pe=>Pe.id===ie?{...Pe,..._e}:Pe))}function Xt(ie){W(_e=>_e.filter(ye=>ye.id!==ie))}function It(){W(ie=>[...ie,yte()])}function Ge(ie){m&&m(ie==="public"?void 0:{...p??{mode:ie},mode:ie})}function bt(ie){m==null||m({...p??{mode:"private"},...ie})}function $t(){const ie=new Map(G.map(ye=>({key:ye.key.trim(),value:ye.value})).filter(ye=>ye.key.length>0).map(ye=>[ye.key,ye.value])),_e=l?[...d,...gc]:d;for(const ye of Jee(_e,f))ie.set(ye.key,ye.value);return[...ie].map(([ye,Pe])=>({key:ye,value:Pe}))}async function Tn(){if(!(!u||B||A)){j(null),L(!0);try{await u(!l)}catch(ie){ge.current&&j(`更新飞书配置失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{ge.current&&L(!1)}}}async function Ue(){var _e;if(!i||B)return;if(Tt!=="public"&&!((_e=p==null?void 0:p.vpcId)!=null&&_e.trim())){j("使用 VPC 网络时,请填写 VPC ID。");return}const ie=Jk(d,f);if(ie){const ye=d.find(Pe=>Pe.key===ie.key);j(`请返回配置页填写 ${(ye==null?void 0:ye.comment)||(ye==null?void 0:ye.key)}(${ye==null?void 0:ye.key})。`);return}if(l){const ye=Jk(gc,f);if(ye){const Pe=gc.find(He=>He.key===ye.key);j(`启用飞书后,请填写${(Pe==null?void 0:Pe.comment)||(Pe==null?void 0:Pe.key)}。`);return}}U(!0)}async function rt(){if(!i||B)return;U(!1);const ie=$t();ge.current&&(j(null),H(null),D({}),J(null),Y(!0));const _e=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let ye="生成中…";const Pe=Date.now();o==null||o({id:_e,runtimeName:ye,region:b,startedAt:Pe,status:"running",label:"准备部署"});try{const He=await i(e,qe=>{var yt;qe.runtimeName&&(ye=qe.runtimeName),ge.current&&(D(Rt=>({...Rt,[qe.phase]:qe})),J(qe.phase)),o==null||o({id:_e,runtimeName:ye,region:b,startedAt:Pe,status:"running",label:((yt=Mf.find(Rt=>Rt.phase===qe.phase))==null?void 0:yt.label)??qe.phase,message:qe.message,pct:qe.pct})},l?{taskId:_e,im:{feishu:{enabled:!0}},envs:ie}:{taskId:_e,envs:ie});ge.current&&(H(He),J(null)),o==null||o({id:_e,runtimeName:He.agentName||ye,runtimeId:He.runtimeId,region:He.region||b,startedAt:Pe,status:"success",label:"部署完成"})}catch(He){const qe=He instanceof Error?He.message:String(He);if(He instanceof DOMException&&He.name==="AbortError"){ge.current&&(j(null),J(null)),o==null||o({id:_e,runtimeName:ye,region:b,startedAt:Pe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"});return}ge.current&&j(qe),o==null||o({id:_e,runtimeName:ye,region:b,startedAt:Pe,status:"error",label:"部署失败",message:qe,retry:Ue})}finally{ge.current&&Y(!1)}}function tt(){U(!1)}async function gt(){if(!(!S||re)){de(!0),j(null);try{const{addConnection:ie,addRuntimeConnection:_e,remoteAppId:ye,loadConnections:Pe}=await el(async()=>{const{addConnection:yt,addRuntimeConnection:Rt,remoteAppId:Ot,loadConnections:mn}=await Promise.resolve().then(()=>Lk);return{addConnection:yt,addRuntimeConnection:Rt,remoteAppId:Ot,loadConnections:mn}},void 0),{probeRuntimeApps:He}=await el(async()=>{const{probeRuntimeApps:yt}=await Promise.resolve().then(()=>nU);return{probeRuntimeApps:yt}},void 0);let qe;if(S.runtimeId){const yt=S.region??"cn-beijing",Rt=await He(S.runtimeId,yt)??[];qe=_e(S.runtimeId,S.agentName,yt,Rt,Rt.length>0?{[Rt[0]]:S.agentName}:void 0)}else qe=await ie(S.agentName,S.url,S.apikey,"");if(qe.apps.length===0)j("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const yt={[qe.apps[0]]:S.agentName},Rt={...qe,appLabels:{...qe.appLabels??{},...yt}},mn=Pe().map(Ht=>Ht.id===qe.id?Rt:Ht);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(mn));const{registerConnections:gn}=await el(async()=>{const{registerConnections:Ht}=await Promise.resolve().then(()=>Lk);return{registerConnections:Ht}},void 0);if(gn(mn),a){const Ht=ye(qe.id,qe.apps[0]);a(Ht,S.agentName)}else alert(`🎉 Agent "${S.agentName}" 已添加到左上角下拉列表!`)}}catch(ie){j(`添加 Agent 失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{de(!1)}}}function ue(){const ie=nte(e.files),_e=URL.createObjectURL(ie),ye=document.createElement("a");ye.href=_e,ye.download=`${e.name||"project"}.zip`,document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(_e)}function Le(ie,_e,ye){return gte(ie).map(Pe=>{const He=ye?`${ye}/${Pe.name}`:Pe.name,qe=Pe.path!==void 0,yt={paddingLeft:8+_e*14};if(qe){const Ot=Pe.path===_;return c.jsxs("button",{type:"button",className:`pp-row pp-file${Ot?" pp-active":""}`,style:yt,onClick:()=>k(Pe.path),title:Pe.path,children:[c.jsx(mF,{className:"pp-ic"}),c.jsx("span",{className:"pp-label",children:Pe.name})]},He)}const Rt=T.has(He);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",className:"pp-row pp-folder",style:yt,onClick:()=>X(He),children:[c.jsx(or,{className:`pp-ic pp-chevron${Rt?"":" pp-open"}`}),c.jsx(AI,{className:"pp-ic"}),c.jsx("span",{className:"pp-label",children:Pe.name})]}),!Rt&&Le(Pe,_e+1,He)]},He)})}return c.jsxs("div",{className:`pp-root${i?" is-deploy":""}`,children:[i&&c.jsx(bte,{left:c.jsxs("div",{className:"pp-toolbar-left",children:[g&&c.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:g,children:[c.jsx(bI,{className:"pp-ic"}),"返回配置"]}),c.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",n||e.name||"未命名 Agent",r&&r>1?` 等 ${r} 个智能体`:""]})]}),right:null}),c.jsxs("div",{className:"pp-body",children:[i&&c.jsxs("section",{className:"pp-topology-pane","aria-label":"Agent 拓扑",children:[c.jsxs("div",{className:"pp-topology-head",children:[c.jsxs("div",{children:[c.jsx("div",{className:"pp-topology-title",children:"Agent 拓扑"}),c.jsxs("div",{className:"pp-topology-count",children:[r??1," 个智能体"]})]}),y&&s&&c.jsx(ote,{project:e,onChange:s})]}),c.jsxs("div",{className:"pp-topology-scroll",children:[c.jsx("div",{className:"pp-topology-tree",children:c.jsx(c3,{agent:Me,depth:0,inspectedId:ve,onHover:ce,onFocus:Ee})}),$e&&Re&&oe&&c.jsxs("div",{className:"pp-agent-inspector","aria-live":"polite",children:[c.jsxs("div",{className:"pp-agent-inspector-head",children:[c.jsx("span",{className:"pp-agent-inspector-icon",children:c.jsx(oe,{"aria-hidden":"true"})}),c.jsxs("div",{children:[c.jsx("strong",{children:$e.name}),c.jsx("span",{children:Re.label})]})]}),$e.description&&c.jsx("p",{children:$e.description}),c.jsxs("dl",{className:"pp-agent-config-grid",children:[c.jsx("dt",{children:"模型"}),c.jsx("dd",{children:$e.model}),c.jsx("dt",{children:"工具"}),c.jsx("dd",{children:$e.tools}),c.jsx("dt",{children:"技能"}),c.jsx("dd",{children:$e.skills}),c.jsx("dt",{children:"知识库"}),c.jsx("dd",{children:$e.knowledgebase}),c.jsx("dt",{children:"短期记忆"}),c.jsx("dd",{children:$e.shortTerm}),c.jsx("dt",{children:"长期记忆"}),c.jsx("dd",{children:$e.longTerm}),c.jsx("dt",{children:"观测"}),c.jsx("dd",{children:$e.tracing})]})]})]}),c.jsxs("div",{className:"pp-topology-actions",children:[E&&c.jsxs("button",{type:"button",className:"pp-secondary",onClick:E,children:[c.jsx(fF,{className:"pp-ic"}),"导出配置"]}),e.files.length>0&&c.jsxs("button",{type:"button",className:"pp-secondary",onClick:ue,children:[c.jsx(TE,{className:"pp-ic"}),"下载源码"]})]})]}),c.jsxs("div",{className:"pp-files-area",children:[c.jsxs("div",{className:"pp-sidebar",children:[c.jsxs("div",{className:"pp-sidebar-head",children:[c.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),y&&c.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{R(!0),M("")},children:c.jsx(hF,{className:"pp-ic"})})]}),c.jsxs("div",{className:"pp-tree",children:[N&&c.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:I,onChange:ie=>M(ie.target.value),onBlur:Oe,onKeyDown:ie=>{ie.key==="Enter"&&Oe(),ie.key==="Escape"&&(R(!1),M(""))}}),e.files.length===0&&!N?c.jsx("div",{className:"pp-empty",children:"暂无文件"}):Le(_t,0,"")]})]}),c.jsxs("div",{className:"pp-main",children:[c.jsxs("div",{className:"pp-main-head",children:[c.jsx("span",{className:"pp-path",title:we==null?void 0:we.path,children:(we==null?void 0:we.path)??"未选择文件"}),c.jsx("div",{className:"pp-actions",children:y&&we&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:ut,children:c.jsx(OF,{className:"pp-ic"})}),c.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:We,children:c.jsx(jl,{className:"pp-ic"})})]})})]}),c.jsx("div",{className:"pp-content",children:we==null?c.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):y?c.jsx("div",{className:"pp-codemirror",children:c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:c.jsx(cte,{value:we.content,path:we.path,onChange:ke})})}):c.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:hte(we.content,we.path)}})})]})]}),i&&c.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[c.jsx("div",{className:"pp-config-head",children:c.jsx("div",{className:"pp-config-title",children:"部署配置"})}),c.jsxs("div",{className:"pp-config-scroll",children:[c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"发布区域"}),c.jsxs("select",{className:"pp-config-select",value:b,onChange:ie=>w==null?void 0:w(ie.target.value),"aria-label":"部署区域",disabled:B||!w,children:[c.jsx("option",{value:"cn-beijing",children:"华北 2(北京)"}),c.jsx("option",{value:"cn-shanghai",children:"华东 2(上海)"})]})]}),c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"消息渠道"}),c.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:`pp-channel${l?" is-on":""}`,onClick:()=>void Tn(),disabled:B||A||!u,children:[c.jsx("span",{className:"pp-channel-title",children:A?"飞书(正在更新代码…)":"飞书"}),c.jsx("span",{className:"pp-switch","aria-hidden":!0,children:c.jsx("span",{})})]}),l&&c.jsx("div",{className:"pp-channel-fields",children:gc.map(ie=>c.jsxs("label",{children:[c.jsxs("span",{children:[ie.comment||ie.key,ie.required&&c.jsx("small",{children:"必填"})]}),c.jsx("code",{children:ie.key}),c.jsx("input",{type:ie.key.includes("SECRET")?"password":"text",value:f[ie.key]??"",placeholder:ie.placeholder,disabled:B||!h,autoComplete:"off",onChange:_e=>h==null?void 0:h(ie.key,_e.currentTarget.value)})]},ie.key))})]}),c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"网络"}),c.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ie=>c.jsx("button",{type:"button",role:"radio","aria-checked":Tt===ie,className:Tt===ie?"is-on":"",onClick:()=>Ge(ie),disabled:B||!m,children:ie==="public"?"公网":ie==="private"?"VPC":"公网 + VPC"},ie))}),Tt!=="public"&&c.jsxs("div",{className:"pp-network-fields",children:[c.jsxs("label",{children:[c.jsx("span",{children:"VPC ID"}),c.jsx("input",{value:(p==null?void 0:p.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:B,onChange:ie=>bt({vpcId:ie.target.value})})]}),c.jsxs("label",{children:[c.jsxs("span",{children:["子网 ID ",c.jsx("small",{children:"可选,多个用逗号分隔"})]}),c.jsx("input",{value:(p==null?void 0:p.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:B,onChange:ie=>bt({subnetIds:ie.target.value})})]}),c.jsxs("label",{className:"pp-network-check",children:[c.jsx("input",{type:"checkbox",checked:!!(p!=null&&p.enableSharedInternetAccess),disabled:B,onChange:ie=>bt({enableSharedInternetAccess:ie.target.checked})}),"VPC 内共享公网出口"]})]})]}),c.jsxs("section",{className:"pp-config-section pp-env-section",children:[c.jsxs("div",{className:"pp-env-head",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"pp-config-label",children:["环境变量",c.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[K," 项"]})]}),c.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),c.jsx("button",{type:"button",className:"pp-icon-btn",title:ae?"隐藏值":"显示值",onClick:()=>he(ie=>!ie),children:ae?c.jsx(dF,{className:"pp-ic"}):c.jsx(kI,{className:"pp-ic"})})]}),c.jsxs("button",{type:"button",className:"pp-env-add",onClick:It,disabled:B,children:[c.jsx(hs,{className:"pp-ic"}),"添加变量"]}),(ct.length>0||G.length>0)&&c.jsxs("div",{className:"pp-env-table",children:[ct.length>0&&c.jsxs("div",{className:"pp-env-group",children:[c.jsxs("div",{className:"pp-env-group-head",children:[c.jsx("span",{children:"组件自动生成"}),c.jsxs("small",{children:[ct.length," 项"]})]}),ct.map(ie=>{const _e=ie.key.startsWith("ENABLE_");return c.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[c.jsx("input",{className:"pp-env-key-fixed",value:ie.key,readOnly:!0,disabled:B,"aria-label":`${ie.key} 环境变量名`}),c.jsx("input",{type:_e||ae?"text":"password",value:ie.value,placeholder:ie.required?"必填,尚未填写":"可选,尚未填写",readOnly:_e,disabled:B||!_e&&!h,autoComplete:"off","aria-label":`${ie.key} 环境变量值`,onChange:ye=>h==null?void 0:h(ie.key,ye.currentTarget.value)}),c.jsx("span",{className:"pp-env-source",children:_e?"自动":"同步"})]},ie.key)})]}),G.length>0&&c.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[c.jsx("span",{children:"自定义变量"}),c.jsxs("small",{children:[G.length," 项"]})]}),G.map(ie=>c.jsxs("div",{className:"pp-env-row",children:[c.jsx("input",{value:ie.key,placeholder:"名称",disabled:B,autoComplete:"off",onChange:_e=>ot(ie.id,{key:_e.currentTarget.value})}),c.jsx("input",{type:ae?"text":"password",value:ie.value,placeholder:"值",disabled:B,autoComplete:"off",onChange:_e=>ot(ie.id,{value:_e.currentTarget.value})}),c.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:B,onClick:()=>Xt(ie.id),children:c.jsx(Gr,{className:"pp-ic"})})]},ie.id))]})]}),(B||S||Object.keys(V).length>0)&&c.jsxs("section",{className:"pp-config-section pp-progress-section",children:[c.jsx("div",{className:"pp-config-label",children:"部署进度"}),c.jsx("ol",{className:"pp-steps",children:Mf.map((ie,_e)=>{const ye=ne?Mf.findIndex(yt=>yt.phase===ne):-1,Pe=!!O&&(ye===-1?_e===0:_e===ye);let He;S?He="done":Pe?He="failed":ye===-1?He=B?"active":"pending":_eie.phase===ne))==null?void 0:ln.label)??ne}阶段):`:""}${O}`,onRetry:Ue}),S&&c.jsxs("section",{className:"pp-deploy-result",children:[c.jsx("div",{className:"pp-deploy-result-header",children:"部署成功"}),c.jsxs("div",{className:"pp-deploy-result-body",children:[S.region&&c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"区域"}),c.jsx("code",{children:S.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"Agent 名称"}),c.jsx("code",{children:S.agentName})]}),c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"API 端点"}),c.jsx("code",{className:"pp-deploy-result-url",children:S.url})]})]}),c.jsxs("div",{className:"pp-deploy-result-actions",children:[c.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:gt,disabled:re,children:[re?c.jsx(wt,{className:"pp-ic spin"}):c.jsx(OI,{className:"pp-ic"}),re?"连接中…":"立即对话"]}),S.consoleUrl&&c.jsxs("a",{href:S.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[c.jsx(kE,{className:"pp-ic"}),"控制台"]})]})]})]}),c.jsx("div",{className:"pp-config-actions",children:c.jsxs("button",{type:"button",className:"pp-deploy",onClick:Ue,disabled:B||A,children:[B?c.jsx(wt,{className:"pp-ic spin"}):O?c.jsx(MI,{className:"pp-ic"}):c.jsx(lte,{className:"pp-ic"}),B?"部署中…":O?"重试部署":"部署"]})})]})]}),c.jsx(ute,{open:P,onCancel:tt,onConfirm:()=>void rt()})]})}const sN="dogfooding",y0="dogfooding",b0="dogfooding_b";let Ete=0;const E0=()=>++Ete;function iN(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function xte(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function aN(e){const t=[],n=xte(e);t.push(n);const r=n.indexOf("{"),s=n.lastIndexOf("}");r>=0&&s>r&&t.push(n.slice(r,s+1));for(const i of t)try{const a=JSON.parse(i);if(a&&typeof a=="object"&&(typeof a.name=="string"||typeof a.instruction=="string"))return await up(r3(a))}catch{}return null}function wte({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=v.useState([{id:E0(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[o,l]=v.useState(""),[u,d]=v.useState(!1),[f,h]=v.useState(null),[p,m]=v.useState(null),[b,w]=v.useState(!1),[g,E]=v.useState(null),[y,_]=v.useState(null),[k,T]=v.useState(!1),[C,N]=v.useState(!1),[R,I]=v.useState({}),M=v.useRef(null),B=v.useRef(null),Y=v.useRef(null),P=v.useRef(null),U=v.useRef(null);v.useEffect(()=>{const J=P.current;J&&J.scrollTo({top:J.scrollHeight,behavior:"smooth"})},[i,u]),v.useEffect(()=>{const J=U.current;J&&(J.style.height="auto",J.style.height=Math.min(J.scrollHeight,160)+"px")},[o]);const A=J=>a(re=>[...re,{id:E0(),role:"assistant",text:J}]);async function L(){if(M.current)return M.current;const J=await lp(sN,e);return M.current=J,J}async function O(J,re){if(re.current)return re.current;const de=await lp(J,e);return re.current=de,de}async function j(J,re){if(!R[J])try{const de=await dd(re);I(G=>({...G,[J]:de.model||re}))}catch{I(de=>({...de,[J]:re}))}}async function S(J,re,de){const G=await O(J,re);let W=qs();for await(const he of Ou({appName:J,userId:e,sessionId:G,text:de}))W=pl(W,he);const ae=iN(W).trim();return{project:await aN(ae),finalText:ae}}const H=async(J,re,de)=>LE(J.name,J.files,{region:"cn-beijing",projectName:"default"},{...de,onStage:re}),V=async()=>{const J=o.trim();if(!(!J||u)){if(a(re=>[...re,{id:E0(),role:"user",text:J}]),l(""),h(null),d(!0),b){E(null),_(null),T(!0),N(!0),j("a",y0),j("b",b0);const re=S(y0,B,J).then(({project:G})=>(E(G),G)).catch(G=>{const W=G instanceof Error?G.message:String(G);return h(W),null}).finally(()=>T(!1)),de=S(b0,Y,J).then(({project:G})=>(_(G),G)).catch(G=>{const W=G instanceof Error?G.message:String(G);return h(W),null}).finally(()=>N(!1));try{const[G,W]=await Promise.all([re,de]),ae=[G?`方案 A:${G.name}`:null,W?`方案 B:${W.name}`:null].filter(Boolean);ae.length?A(`已生成两个方案(${ae.join(",")}),请在右侧对比后采用其一。`):A("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const re=await L();let de=qs();for await(const ae of Ou({appName:sN,userId:e,sessionId:re,text:J}))de=pl(de,ae);const G=iN(de).trim(),W=await aN(G);W?(m(W),A(`已生成项目:${W.name}(${W.files.length} 个文件),可在右侧预览和编辑。`)):A(G||"(助手没有返回内容,请再描述一下你的需求。)")}catch(re){const de=re instanceof Error?re.message:String(re);h(de),A(`抱歉,调用智能构建助手失败:${de}`)}finally{d(!1)}}},D=J=>{const re=J==="a"?g:y;if(!re)return;m(re),w(!1),E(null),_(null),T(!1),N(!1);const de=J==="a"?"A":"B",G=J==="a"?R.a:R.b;A(`已采用方案 ${de}(${G??(J==="a"?y0:b0)}),可继续编辑。`)},ne=J=>{J.key==="Enter"&&!J.shiftKey&&!J.nativeEvent.isComposing&&(J.preventDefault(),V())};return c.jsx("div",{className:"ic-root",children:c.jsxs("div",{className:"ic-body",children:[c.jsxs("div",{className:"ic-chat",children:[c.jsxs("div",{className:"ic-transcript",ref:P,children:[c.jsx($i,{initial:!1,children:i.map(J=>c.jsxs(Wt.div,{className:`ic-turn ic-turn--${J.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[J.role==="assistant"&&c.jsx("div",{className:"ic-avatar",children:c.jsx($a,{className:"ic-avatar-icon"})}),c.jsx("div",{className:"ic-bubble",children:J.role==="assistant"?c.jsx(wd,{text:J.text}):J.text})]},J.id))}),u&&c.jsxs(Wt.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[c.jsx("div",{className:"ic-avatar",children:c.jsx($a,{className:"ic-avatar-icon"})}),c.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[c.jsx("span",{className:"ic-dot"}),c.jsx("span",{className:"ic-dot"}),c.jsx("span",{className:"ic-dot"})]})]})]}),f&&c.jsxs("div",{className:"ic-error",children:[c.jsx(_I,{className:"ic-error-icon"}),f]}),c.jsxs("div",{className:"ic-composer",children:[c.jsxs("div",{className:"ic-composer-box",children:[c.jsx("textarea",{ref:U,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:o,onChange:J=>l(J.target.value),onKeyDown:ne,disabled:u}),c.jsx("button",{className:"ic-send",onClick:()=>void V(),disabled:!o.trim()||u,title:"发送 (Enter)",children:c.jsx(DF,{className:"ic-send-icon"})})]}),c.jsxs("div",{className:"ic-composer-foot",children:[c.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[c.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:b,disabled:u,onChange:J=>w(J.target.checked)}),c.jsx("span",{className:"ic-ab-track",children:c.jsx("span",{className:"ic-ab-thumb"})}),c.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),c.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),c.jsx("aside",{className:"ic-preview",children:b?c.jsxs("div",{className:"ic-compare",children:[c.jsx(oN,{side:"a",project:g,loading:k,model:R.a,onAdopt:()=>D("a")}),c.jsx("div",{className:"ic-compare-divider"}),c.jsx(oN,{side:"b",project:y,loading:C,model:R.b,onAdopt:()=>D("b")})]}):p?c.jsx(Mx,{project:p,onChange:m,onDeploy:H,onAgentAdded:r,onDeploymentTaskChange:s}):c.jsxs("div",{className:"ic-preview-empty",children:[c.jsxs("div",{className:"ic-preview-empty-icon",children:[c.jsx(gF,{className:"ic-preview-empty-glyph"}),c.jsx(Ha,{className:"ic-preview-empty-spark"})]}),c.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),c.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function oN({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return c.jsxs("div",{className:"ic-pane",children:[c.jsxs("div",{className:"ic-pane-head",children:[c.jsxs("div",{className:"ic-pane-title",children:[c.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&c.jsx("span",{className:"ic-pane-model",children:r})]}),c.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),c.jsx("div",{className:"ic-pane-body",children:n?c.jsxs("div",{className:"ic-pane-loading",children:[c.jsx(wt,{className:"ic-pane-spinner"}),c.jsx("span",{children:"正在生成…"})]}):t?c.jsx(Mx,{project:t}):c.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const vte=/^[A-Za-z_][A-Za-z0-9_]*$/;function tl(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":vte.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function u3(e){const t=new Set,n=new Set,r=s=>{tl(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function Qr(e){return e.trimEnd().replace(/[。.]+$/,"")}function ca(e,t){return e[t]|e[t+1]<<8}function yc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function _te(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function Tte(e){let n=-1;for(let o=e.length-22;o>=0&&o>e.length-65557;o--)if(yc(e,o)===101010256){n=o;break}if(n<0)throw new Error("无效的 zip:找不到 EOCD");const r=ca(e,n+10);let s=yc(e,n+16);const i=new TextDecoder("utf-8"),a=[];for(let o=0;o{var o;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((o=a.Metadata)==null?void 0:o.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function Ste({selected:e,onChange:t}){const[n,r]=v.useState(""),[s,i]=v.useState([]),[a,o]=v.useState(!1),[l,u]=v.useState(null),[d,f]=v.useState(!1),h=b=>e.some(w=>w.source==="skillhub"&&w.slug===b),p=b=>{b.slug&&(h(b.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===b.slug))):t([...e,{source:"skillhub",slug:b.slug,name:b.name,folder:b.slug.split("/").pop()||b.name,namespace:b.namespace||"public",description:b.description}]))},m=async b=>{o(!0),u(null),f(!0);try{const w=await Nte(b);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{o(!1)}};return v.useEffect(()=>{const b=n.trim();if(!b){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(b),300);return()=>clearTimeout(w)},[n]),c.jsxs("div",{className:"cw-skillhub",children:[c.jsxs("div",{className:"cw-skill-searchrow",children:[c.jsxs("div",{className:"cw-skill-searchbox",children:[c.jsx(e1,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),c.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:b=>r(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),n.trim()&&m(n))}})]}),c.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?c.jsx(wt,{className:"cw-i cw-spin"}):c.jsx(e1,{className:"cw-i"}),"搜索"]})]}),l&&c.jsxs("div",{className:"cw-banner",children:[c.jsx(cd,{className:"cw-i"}),c.jsx("span",{children:l})]}),a&&s.length===0?c.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?c.jsx("div",{className:"cw-skill-results",children:s.map(b=>{const w=h(b.slug||"");return c.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(b),"aria-pressed":w,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?c.jsx(Ds,{className:"cw-i cw-i-sm"}):c.jsx(hs,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&c.jsx("span",{className:"cw-skill-result-desc",children:Qr(b.description)}),b.sourceRepo&&c.jsx("span",{className:"cw-skill-result-repo",children:b.sourceRepo})]})]},b.id||b.slug)})}):d&&!l?c.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&c.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const L1=/(^|\/)skill\.md$/i;class zi extends Error{}function Ate(e,t){const n=(e??"").replace(/\r\n?/g,` +`+Ree(i3(e))}function qee(e){const t=Iee(e);return s3(t)}const Gee=[{kind:"custom",icon:HF,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:CF,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:_F,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:zF,title:"工作流",desc:"敬请期待",disabled:!0}];function Xee({onSelect:e,onImport:t}){const n=v.useRef(null),[r,s]=v.useState(""),i=Gee.map(o=>({key:o.kind,icon:o.icon,title:o.title,desc:o.desc,disabled:o.disabled,onClick:()=>e(o.kind)})),a=async o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];if(o.target.value="",!!l)try{const d=await l.text();t(qee(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return c.jsx(fM,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c.jsxs("button",{className:"stk-import",onClick:()=>{var o;return(o=n.current)==null?void 0:o.click()},children:[c.jsx(UF,{}),"导入 YAML 配置"]}),r&&c.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),c.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const Qee="modulepreload",Zee=function(e){return"/"+e},ZN={},tl=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=Zee(l),l in ZN)return;ZN[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Qee,u||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})};function Jee({className:e,...t}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[c.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),c.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}const wo={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:Jee},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:II},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:PI},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:AE},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:um}},Df=[wo.llm,wo.sequential,wo.parallel,wo.loop,wo.a2a];function Lx(e){return wo[e??"llm"]}const a3=e=>e==="sequential"||e==="parallel"||e==="loop",Id=e=>e==="a2a";function o3(e){const t=new Map,n={};for(const r of e){for(const s of r.env){const i=t.get(s.key);(!i||s.required&&!i.required)&&t.set(s.key,s)}r.enableFlag&&(t.set(r.enableFlag,{key:r.enableFlag,required:!0}),n[r.enableFlag]="true")}return{specs:[...t.values()],fixedValues:n}}function ete(e,t){return o3([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function tte(e,t){const n=new Map;for(const r of e){const s=t[r.key]??"";s.trim()&&n.set(r.key,s)}return[...n].map(([r,s])=>({key:r,value:s}))}function JN(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const nte=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function rte(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function en(e,t){e.push(t&255,t>>>8&255)}function Nr(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const ek=2048,g0=20,tk=0;function ste(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),y=t.encode(p.content),w=rte(y),g=y.length,E=[];Nr(E,67324752),en(E,g0),en(E,ek),en(E,tk),en(E,0),en(E,0),Nr(E,w),Nr(E,g),Nr(E,g),en(E,m.length),en(E,0);const b=Uint8Array.from(E);n.push(b,m,y),r.push({nameBytes:m,dataBytes:y,crc:w,size:g,offset:s}),s+=b.length+m.length+y.length}const i=s,a=[];let o=0;for(const p of r){const m=[];Nr(m,33639248),en(m,g0),en(m,g0),en(m,ek),en(m,tk),en(m,0),en(m,0),Nr(m,p.crc),Nr(m,p.size),Nr(m,p.size),en(m,p.nameBytes.length),en(m,0),en(m,0),en(m,0),en(m,0),Nr(m,0),Nr(m,p.offset);const y=Uint8Array.from(m);a.push(y,p.nameBytes),o+=y.length+p.nameBytes.length}const l=[];Nr(l,101010256),en(l,0),en(l,0),en(l,r.length),en(l,r.length),Nr(l,o),Nr(l,i),en(l,0);const u=[...n,...a,Uint8Array.from(l)],d=u.reduce((p,m)=>p+m.length,0),f=new Uint8Array(d);let h=0;for(const p of u)f.set(p,h),h+=p.length;return new Blob([f],{type:"application/zip"})}const ite=v.lazy(()=>tl(()=>import("./CodeEditor-C8L3YPfR.js"),[]));function ate(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t;r.forEach((i,a)=>{let o=s.children.get(i);o||(o={name:i,children:new Map},s.children.set(i,o)),a===r.length-1&&(o.path=n.path),s=o})}return t}function ote(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,s=n.children.size>0&&n.path===void 0;return r!==s?r?-1:1:t.name.localeCompare(n.name)})}function lte({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=v.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,o]=v.useState(new Set),l=v.useRef(null),u=v.useMemo(()=>ate(e.files),[e.files]),d=e.files.find(y=>y.path===s)??null;if(v.useEffect(()=>{var g;if(!t)return;const y=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const w=E=>{E.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=y,window.removeEventListener("keydown",w)}},[n,t]),v.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(y){o(w=>{const g=new Set(w);return g.has(y)?g.delete(y):g.add(y),g})}function h(y,w,g){return ote(y).map(E=>{const b=g?`${g}/${E.name}`:E.name;if(!(E.children.size>0&&E.path===void 0)&&E.path)return c.jsxs("button",{type:"button",className:`code-browser-file${s===E.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(E.path??null),title:E.path,children:[c.jsx(B_,{"aria-hidden":"true"}),c.jsx("span",{children:E.name})]},b);const N=a.has(b);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(b),"aria-expanded":!N,children:[c.jsx(Xn,{className:N?"":"is-open","aria-hidden":"true"}),c.jsx(CI,{"aria-hidden":"true"}),c.jsx("span",{children:E.name})]}),!N&&h(E,w+1,b)]},b)})}function p(y){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:y}:w)})}return $a.createPortal(c.jsx("div",{className:"code-browser-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&n()},children:c.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[c.jsxs("header",{className:"code-browser-head",children:[c.jsxs("div",{className:"code-browser-title-wrap",children:[c.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:c.jsx(_E,{})}),c.jsxs("div",{children:[c.jsx("h2",{id:"code-browser-title",children:"项目代码"}),c.jsx("p",{children:e.name||"Agent 项目"})]})]}),c.jsx("button",{ref:l,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:c.jsx(Xr,{"aria-hidden":"true"})})]}),c.jsxs("div",{className:"code-browser-workspace",children:[c.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[c.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",c.jsx("span",{children:e.files.length})]}),c.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):c.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),c.jsxs("main",{className:"code-browser-main",children:[c.jsxs("div",{className:"code-browser-path",children:[c.jsx(B_,{"aria-hidden":"true"}),c.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),c.jsx("div",{className:"code-browser-editor",children:d?c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:c.jsx(ite,{value:d.content,path:d.path,onChange:p})}):c.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function cte({project:e,onChange:t,className:n=""}){const[r,s]=v.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[c.jsx(_E,{"aria-hidden":"true"}),c.jsx("span",{children:"查看源码"})]}),c.jsx(lte,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function ute({className:e,...t}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[c.jsx("path",{d:"m12 2.75 4.25 2.45v4.9L12 12.55 7.75 10.1V5.2L12 2.75Z"}),c.jsx("path",{d:"m7.75 5.2 4.25 2.45 4.25-2.45M12 7.65v4.9"}),c.jsx("path",{d:"M12 12.55v4.7m-2.25-2.2L12 17.3l2.25-2.25"}),c.jsx("path",{d:"M5.5 17.25v2.25a1.75 1.75 0 0 0 1.75 1.75h9.5a1.75 1.75 0 0 0 1.75-1.75v-2.25"})]})}function Ip({message:e,className:t="",onRetry:n}){const[r,s]=v.useState(!1),[i,a]=v.useState(!1),[o,l]=v.useState(!1),u=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{a(!1)}},d=async()=>{if(!(!n||o)){l(!0);try{await n()}finally{l(!1)}}};return c.jsxs("div",{className:`deploy-error-message${r?" is-expanded":""}${t?` ${t}`:""}`,children:[c.jsx("p",{className:"deploy-error-message-text",children:e}),c.jsxs("div",{className:"deploy-error-message-actions",children:[n&&c.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:o,onClick:()=>void d(),children:[o?c.jsx(bt,{className:"spin"}):c.jsx(DI,{}),o?"重试中…":"重试部署"]}),c.jsx("button",{type:"button",title:r?"收起错误信息":"展开完整错误信息","aria-label":r?"收起错误信息":"展开完整错误信息",onClick:()=>s(f=>!f),children:r?c.jsx(RF,{}):c.jsx(Gc,{})}),c.jsx("button",{type:"button",title:i?"已复制":"复制完整错误信息","aria-label":i?"已复制":"复制完整错误信息",onClick:()=>void u(),children:i?c.jsx(Bs,{}):c.jsx(TE,{})})]})]})}wr.registerLanguage("python",OO);wr.registerLanguage("typescript",VO);wr.registerLanguage("javascript",kO);wr.registerLanguage("json",SO);wr.registerLanguage("yaml",KO);wr.registerLanguage("markdown",RO);wr.registerLanguage("bash",xO);wr.registerLanguage("ini",wO);wr.registerLanguage("dockerfile",_Y);wr.registerLanguage("makefile",IO);const dte=v.lazy(()=>tl(()=>import("./CodeEditor-C8L3YPfR.js"),[]));function fte({open:e,onCancel:t,onConfirm:n}){const r=v.useRef(null);return v.useEffect(()=>{var a;if(!e)return;const s=document.body.style.overflow;document.body.style.overflow="hidden",(a=r.current)==null||a.focus();const i=o=>{o.key==="Escape"&&t()};return window.addEventListener("keydown",i),()=>{document.body.style.overflow=s,window.removeEventListener("keydown",i)}},[t,e]),e?$a.createPortal(c.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:s=>{s.target===s.currentTarget&&t()},children:c.jsxs("section",{className:"code-browser-dialog pp-confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"pp-confirm-title","aria-describedby":"pp-confirm-description",children:[c.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[c.jsxs("div",{className:"code-browser-title-wrap",children:[c.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:c.jsx(FF,{})}),c.jsx("h2",{id:"pp-confirm-title",children:"确认部署"})]}),c.jsx("button",{type:"button",className:"code-browser-close",onClick:t,"aria-label":"关闭部署确认",children:c.jsx(Xr,{"aria-hidden":"true"})})]}),c.jsx("div",{className:"pp-confirm-body",children:c.jsx("p",{id:"pp-confirm-description",children:"部署后暂不支持修改 Agent 配置,确定部署吗?"})}),c.jsxs("footer",{className:"pp-confirm-actions",children:[c.jsx("button",{ref:r,type:"button",onClick:t,children:"取消"}),c.jsx("button",{type:"button",className:"is-primary",onClick:n,children:"确定部署"})]})]})}),document.body):null}const hte={py:"python",pyi:"python",ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",env:"ini",txt:"plaintext"},nk={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function rk(e){return e.replace(/&/g,"&").replace(//g,">")}function pte(e){const n=(e.split("/").pop()??e).toLowerCase();if(nk[n])return nk[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const r=n.lastIndexOf(".");if(r===-1)return null;const s=n.slice(r+1);return hte[s]??null}function mte(e,t){try{const n=pte(t);return n&&wr.getLanguage(n)?wr.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?wr.highlightAuto(e).value:rk(e)}catch{return rk(e)}}const Pf=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}];function gte(e){return e.trim().replace(/[。.!!]+$/u,"")}function y0(e,t="未配置"){return[...new Set(e.map(r=>r==null?void 0:r.trim()).filter(Boolean))].join("、")||t}function l3(e,t="root"){var a,o,l;const n=e.agentType??"llm",r=[...(e.builtinTools??[]).map(u=>{var d;return((d=Lee(u))==null?void 0:d.label)??u}),...(e.customTools??[]).map(u=>u.name),...(e.mcpTools??[]).map(u=>u.name),...e.tools??[]],s=[...(e.selectedSkills??[]).map(u=>u.name),...e.skills??[]],i=e.memory.longTerm?((a=Dee(e.longTermBackend??"local"))==null?void 0:a.label)??e.longTermBackend:void 0;return{id:t,name:e.name.trim()||"未命名 Agent",type:n,description:gte(e.description),model:n==="llm"?e.modelName||e.model||"默认模型":"不适用",tools:y0(r),skills:y0(s),knowledgebase:e.knowledgebase?((o=Pee(e.knowledgebaseBackend??"local"))==null?void 0:o.label)??e.knowledgebaseBackend??"默认知识库":"未配置",shortTerm:e.memory.shortTerm?((l=Mee(e.shortTermBackend??"local"))==null?void 0:l.label)??e.shortTermBackend??"默认后端":"未配置",longTerm:i?`${i}${e.autoSaveSession?" · 自动保存会话":""}`:"未配置",tracing:e.tracing?y0((e.tracingExporters??[]).map(u=>{var d;return((d=jee(u))==null?void 0:d.label)??u}),"默认观测"):"未配置",children:e.subAgents.map((u,d)=>l3(u,`${t}.${d}`))}}function c3(e,t){if(e.id===t)return e;for(const n of e.children){const r=c3(n,t);if(r)return r}}function u3({agent:e,depth:t,inspectedId:n,onHover:r,onFocus:s}){const i=Lx(e.type),a=i.icon;return c.jsxs("div",{className:"pp-topology-branch",children:[c.jsxs("button",{type:"button",className:`pp-agent-node${e.id===n?" is-inspected":""}`,style:{marginLeft:t*16,width:`calc(100% - ${t*16}px)`},onMouseEnter:()=>r(e.id),onMouseLeave:()=>r(null),onFocus:()=>s(e.id),onBlur:()=>s(null),"aria-label":`查看 ${e.name} 配置`,children:[c.jsx("span",{className:"pp-agent-node-icon",children:c.jsx(a,{"aria-hidden":"true"})}),c.jsxs("span",{className:"pp-agent-node-main",children:[c.jsx("span",{className:"pp-agent-node-name",children:e.name}),c.jsx("span",{className:"pp-agent-node-type",children:i.label})]}),e.children.length>0&&c.jsx("span",{className:"pp-agent-child-count",children:e.children.length})]}),e.children.length>0&&c.jsx("div",{className:"pp-topology-children",children:e.children.map(o=>c.jsx(u3,{agent:o,depth:t+1,inspectedId:n,onHover:r,onFocus:s},o.id))})]})}function yte(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t;r.forEach((i,a)=>{let o=s.children.get(i);o||(o={name:i,children:new Map},s.children.set(i,o)),a===r.length-1&&(o.path=n.path),s=o})}return t}function bte(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,s=n.children.size>0&&n.path===void 0;return r!==s?r?-1:1:t.name.localeCompare(n.name)})}function Ete(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function xte({left:e,right:t}){const[n,r]=v.useState(null);return v.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?c.jsxs(c.Fragment,{children:[$a.createPortal(e,n.left),$a.createPortal(t,n.right)]}):c.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function Mx({project:e,agentDraft:t,agentName:n,agentCount:r,onChange:s,onDeploy:i,onAgentAdded:a,onDeploymentTaskChange:o,feishuEnabled:l=!1,onFeishuEnabledChange:u,deploymentEnv:d=[],deploymentEnvValues:f={},onDeploymentEnvChange:h,network:p,onNetworkChange:m,deployRegion:y="cn-beijing",onDeployRegionChange:w,onBack:g,onExportYaml:E}){var Qe,cn,an;const b=typeof s=="function",[_,N]=v.useState(((cn=(Qe=e==null?void 0:e.files)==null?void 0:Qe[0])==null?void 0:cn.path)??null),[T,A]=v.useState(new Set),[k,R]=v.useState(!1),[I,M]=v.useState(""),[B,Y]=v.useState(!1),[P,U]=v.useState(!1),[C,L]=v.useState(!1),[O,j]=v.useState(null),[S,H]=v.useState(null),[V,D]=v.useState({}),[ne,ee]=v.useState(null),[re,de]=v.useState(!1),[G,W]=v.useState([]),[oe,he]=v.useState(!1),[J,ce]=v.useState(null),[Ce,Ee]=v.useState(null),ge=v.useRef(!0),Le=v.useMemo(()=>t?l3(t):{id:"root",name:n||(e==null?void 0:e.name)||"未命名 Agent",type:"llm",description:"",model:"默认模型",tools:"未配置",skills:"未配置",knowledgebase:"未配置",shortTerm:"未配置",longTerm:"未配置",tracing:"未配置",children:[]},[t,n,e==null?void 0:e.name]),ve=Ce??J,Ue=ve?c3(Le,ve):void 0,Ie=Ue?Lx(Ue.type):void 0,ae=Ie==null?void 0:Ie.icon;v.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const wt=v.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:yte(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return c.jsx("div",{className:"pp-error",children:"项目数据无效"});const we=e.files.find(ie=>ie.path===_)??null,vt=(p==null?void 0:p.mode)??"public",ct=ete(l?[...d,...bc]:d,f),K=ct.length+G.length;function X(ie){A(_e=>{const ye=new Set(_e);return ye.has(ie)?ye.delete(ie):ye.add(ie),ye})}function le(ie,_e){s&&(s({...e,files:ie}),_e!==void 0&&N(_e))}function Ne(ie){we&&le(e.files.map(_e=>_e.path===we.path?{..._e,content:ie}:_e))}function Re(){const ie=I.trim();if(R(!1),M(""),!!ie){if(e.files.some(_e=>_e.path===ie)){N(ie);return}le([...e.files,{path:ie,content:""}],ie)}}function ut(){if(!we)return;const ie=window.prompt("重命名文件",we.path),_e=ie==null?void 0:ie.trim();!_e||_e===we.path||e.files.some(ye=>ye.path===_e)||le(e.files.map(ye=>ye.path===we.path?{...ye,path:_e}:ye),_e)}function We(){var _e;if(!we)return;const ie=e.files.filter(ye=>ye.path!==we.path);le(ie,((_e=ie[0])==null?void 0:_e.path)??null)}function ot(ie,_e){W(ye=>ye.map(Pe=>Pe.id===ie?{...Pe,..._e}:Pe))}function Zt(ie){W(_e=>_e.filter(ye=>ye.id!==ie))}function Ct(){W(ie=>[...ie,Ete()])}function Ge(ie){m&&m(ie==="public"?void 0:{...p??{mode:ie},mode:ie})}function Et(ie){m==null||m({...p??{mode:"private"},...ie})}function Ht(){const ie=new Map(G.map(ye=>({key:ye.key.trim(),value:ye.value})).filter(ye=>ye.key.length>0).map(ye=>[ye.key,ye.value])),_e=l?[...d,...bc]:d;for(const ye of tte(_e,f))ie.set(ye.key,ye.value);return[...ie].map(([ye,Pe])=>({key:ye,value:Pe}))}async function Nn(){if(!(!u||B||C)){j(null),L(!0);try{await u(!l)}catch(ie){ge.current&&j(`更新飞书配置失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{ge.current&&L(!1)}}}async function Fe(){var _e;if(!i||B)return;if(vt!=="public"&&!((_e=p==null?void 0:p.vpcId)!=null&&_e.trim())){j("使用 VPC 网络时,请填写 VPC ID。");return}const ie=JN(d,f);if(ie){const ye=d.find(Pe=>Pe.key===ie.key);j(`请返回配置页填写 ${(ye==null?void 0:ye.comment)||(ye==null?void 0:ye.key)}(${ye==null?void 0:ye.key})。`);return}if(l){const ye=JN(bc,f);if(ye){const Pe=bc.find($e=>$e.key===ye.key);j(`启用飞书后,请填写${(Pe==null?void 0:Pe.comment)||(Pe==null?void 0:Pe.key)}。`);return}}U(!0)}async function rt(){if(!i||B)return;U(!1);const ie=Ht();ge.current&&(j(null),H(null),D({}),ee(null),Y(!0));const _e=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let ye="生成中…";const Pe=Date.now();o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"running",label:"准备部署"});try{const $e=await i(e,qe=>{var gt;qe.runtimeName&&(ye=qe.runtimeName),ge.current&&(D(It=>({...It,[qe.phase]:qe})),ee(qe.phase)),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"running",label:((gt=Pf.find(It=>It.phase===qe.phase))==null?void 0:gt.label)??qe.phase,message:qe.message,pct:qe.pct})},l?{taskId:_e,im:{feishu:{enabled:!0}},envs:ie}:{taskId:_e,envs:ie});ge.current&&(H($e),ee(null)),o==null||o({id:_e,runtimeName:$e.agentName||ye,runtimeId:$e.runtimeId,region:$e.region||y,startedAt:Pe,status:"success",label:"部署完成"})}catch($e){const qe=$e instanceof Error?$e.message:String($e);if($e instanceof DOMException&&$e.name==="AbortError"){ge.current&&(j(null),ee(null)),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"});return}ge.current&&j(qe),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"error",label:"部署失败",message:qe,retry:Fe})}finally{ge.current&&Y(!1)}}function tt(){U(!1)}async function mt(){if(!(!S||re)){de(!0),j(null);try{const{addConnection:ie,addRuntimeConnection:_e,remoteAppId:ye,loadConnections:Pe}=await tl(async()=>{const{addConnection:gt,addRuntimeConnection:It,remoteAppId:Rt,loadConnections:gn}=await Promise.resolve().then(()=>LN);return{addConnection:gt,addRuntimeConnection:It,remoteAppId:Rt,loadConnections:gn}},void 0),{probeRuntimeApps:$e}=await tl(async()=>{const{probeRuntimeApps:gt}=await Promise.resolve().then(()=>sU);return{probeRuntimeApps:gt}},void 0);let qe;if(S.runtimeId){const gt=S.region??"cn-beijing",It=await $e(S.runtimeId,gt)??[];qe=_e(S.runtimeId,S.agentName,gt,It,It.length>0?{[It[0]]:S.agentName}:void 0)}else qe=await ie(S.agentName,S.url,S.apikey,"");if(qe.apps.length===0)j("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const gt={[qe.apps[0]]:S.agentName},It={...qe,appLabels:{...qe.appLabels??{},...gt}},gn=Pe().map(zt=>zt.id===qe.id?It:zt);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(gn));const{registerConnections:yn}=await tl(async()=>{const{registerConnections:zt}=await Promise.resolve().then(()=>LN);return{registerConnections:zt}},void 0);if(yn(gn),a){const zt=ye(qe.id,qe.apps[0]);a(zt,S.agentName)}else alert(`🎉 Agent "${S.agentName}" 已添加到左上角下拉列表!`)}}catch(ie){j(`添加 Agent 失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{de(!1)}}}function ue(){const ie=ste(e.files),_e=URL.createObjectURL(ie),ye=document.createElement("a");ye.href=_e,ye.download=`${e.name||"project"}.zip`,document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(_e)}function Oe(ie,_e,ye){return bte(ie).map(Pe=>{const $e=ye?`${ye}/${Pe.name}`:Pe.name,qe=Pe.path!==void 0,gt={paddingLeft:8+_e*14};if(qe){const Rt=Pe.path===_;return c.jsxs("button",{type:"button",className:`pp-row pp-file${Rt?" pp-active":""}`,style:gt,onClick:()=>N(Pe.path),title:Pe.path,children:[c.jsx(yF,{className:"pp-ic"}),c.jsx("span",{className:"pp-label",children:Pe.name})]},$e)}const It=T.has($e);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",className:"pp-row pp-folder",style:gt,onClick:()=>X($e),children:[c.jsx(Xn,{className:`pp-ic pp-chevron${It?"":" pp-open"}`}),c.jsx(CI,{className:"pp-ic"}),c.jsx("span",{className:"pp-label",children:Pe.name})]}),!It&&Oe(Pe,_e+1,$e)]},$e)})}return c.jsxs("div",{className:`pp-root${i?" is-deploy":""}`,children:[i&&c.jsx(xte,{left:c.jsxs("div",{className:"pp-toolbar-left",children:[g&&c.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:g,children:[c.jsx(EI,{className:"pp-ic"}),"返回配置"]}),c.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",n||e.name||"未命名 Agent",r&&r>1?` 等 ${r} 个智能体`:""]})]}),right:null}),c.jsxs("div",{className:"pp-body",children:[i&&c.jsxs("section",{className:"pp-topology-pane","aria-label":"Agent 拓扑",children:[c.jsxs("div",{className:"pp-topology-head",children:[c.jsxs("div",{children:[c.jsx("div",{className:"pp-topology-title",children:"Agent 拓扑"}),c.jsxs("div",{className:"pp-topology-count",children:[r??1," 个智能体"]})]}),b&&s&&c.jsx(cte,{project:e,onChange:s})]}),c.jsxs("div",{className:"pp-topology-scroll",children:[c.jsx("div",{className:"pp-topology-tree",children:c.jsx(u3,{agent:Le,depth:0,inspectedId:ve,onHover:ce,onFocus:Ee})}),Ue&&Ie&&ae&&c.jsxs("div",{className:"pp-agent-inspector","aria-live":"polite",children:[c.jsxs("div",{className:"pp-agent-inspector-head",children:[c.jsx("span",{className:"pp-agent-inspector-icon",children:c.jsx(ae,{"aria-hidden":"true"})}),c.jsxs("div",{children:[c.jsx("strong",{children:Ue.name}),c.jsx("span",{children:Ie.label})]})]}),Ue.description&&c.jsx("p",{children:Ue.description}),c.jsxs("dl",{className:"pp-agent-config-grid",children:[c.jsx("dt",{children:"模型"}),c.jsx("dd",{children:Ue.model}),c.jsx("dt",{children:"工具"}),c.jsx("dd",{children:Ue.tools}),c.jsx("dt",{children:"技能"}),c.jsx("dd",{children:Ue.skills}),c.jsx("dt",{children:"知识库"}),c.jsx("dd",{children:Ue.knowledgebase}),c.jsx("dt",{children:"短期记忆"}),c.jsx("dd",{children:Ue.shortTerm}),c.jsx("dt",{children:"长期记忆"}),c.jsx("dd",{children:Ue.longTerm}),c.jsx("dt",{children:"观测"}),c.jsx("dd",{children:Ue.tracing})]})]})]}),c.jsxs("div",{className:"pp-topology-actions",children:[E&&c.jsxs("button",{type:"button",className:"pp-secondary",onClick:E,children:[c.jsx(pF,{className:"pp-ic"}),"导出配置"]}),e.files.length>0&&c.jsxs("button",{type:"button",className:"pp-secondary",onClick:ue,children:[c.jsx(NE,{className:"pp-ic"}),"下载源码"]})]})]}),c.jsxs("div",{className:"pp-files-area",children:[c.jsxs("div",{className:"pp-sidebar",children:[c.jsxs("div",{className:"pp-sidebar-head",children:[c.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),b&&c.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{R(!0),M("")},children:c.jsx(mF,{className:"pp-ic"})})]}),c.jsxs("div",{className:"pp-tree",children:[k&&c.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:I,onChange:ie=>M(ie.target.value),onBlur:Re,onKeyDown:ie=>{ie.key==="Enter"&&Re(),ie.key==="Escape"&&(R(!1),M(""))}}),e.files.length===0&&!k?c.jsx("div",{className:"pp-empty",children:"暂无文件"}):Oe(wt,0,"")]})]}),c.jsxs("div",{className:"pp-main",children:[c.jsxs("div",{className:"pp-main-head",children:[c.jsx("span",{className:"pp-path",title:we==null?void 0:we.path,children:(we==null?void 0:we.path)??"未选择文件"}),c.jsx("div",{className:"pp-actions",children:b&&we&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:ut,children:c.jsx(MF,{className:"pp-ic"})}),c.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:We,children:c.jsx(Fl,{className:"pp-ic"})})]})})]}),c.jsx("div",{className:"pp-content",children:we==null?c.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):b?c.jsx("div",{className:"pp-codemirror",children:c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:c.jsx(dte,{value:we.content,path:we.path,onChange:Ne})})}):c.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:mte(we.content,we.path)}})})]})]}),i&&c.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[c.jsx("div",{className:"pp-config-head",children:c.jsx("div",{className:"pp-config-title",children:"部署配置"})}),c.jsxs("div",{className:"pp-config-scroll",children:[c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"发布区域"}),c.jsxs("select",{className:"pp-config-select",value:y,onChange:ie=>w==null?void 0:w(ie.target.value),"aria-label":"部署区域",disabled:B||!w,children:[c.jsx("option",{value:"cn-beijing",children:"华北 2(北京)"}),c.jsx("option",{value:"cn-shanghai",children:"华东 2(上海)"})]})]}),c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"消息渠道"}),c.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:`pp-channel${l?" is-on":""}`,onClick:()=>void Nn(),disabled:B||C||!u,children:[c.jsx("span",{className:"pp-channel-title",children:C?"飞书(正在更新代码…)":"飞书"}),c.jsx("span",{className:"pp-switch","aria-hidden":!0,children:c.jsx("span",{})})]}),l&&c.jsx("div",{className:"pp-channel-fields",children:bc.map(ie=>c.jsxs("label",{children:[c.jsxs("span",{children:[ie.comment||ie.key,ie.required&&c.jsx("small",{children:"必填"})]}),c.jsx("code",{children:ie.key}),c.jsx("input",{type:ie.key.includes("SECRET")?"password":"text",value:f[ie.key]??"",placeholder:ie.placeholder,disabled:B||!h,autoComplete:"off",onChange:_e=>h==null?void 0:h(ie.key,_e.currentTarget.value)})]},ie.key))})]}),c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"网络"}),c.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ie=>c.jsx("button",{type:"button",role:"radio","aria-checked":vt===ie,className:vt===ie?"is-on":"",onClick:()=>Ge(ie),disabled:B||!m,children:ie==="public"?"公网":ie==="private"?"VPC":"公网 + VPC"},ie))}),vt!=="public"&&c.jsxs("div",{className:"pp-network-fields",children:[c.jsxs("label",{children:[c.jsx("span",{children:"VPC ID"}),c.jsx("input",{value:(p==null?void 0:p.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:B,onChange:ie=>Et({vpcId:ie.target.value})})]}),c.jsxs("label",{children:[c.jsxs("span",{children:["子网 ID ",c.jsx("small",{children:"可选,多个用逗号分隔"})]}),c.jsx("input",{value:(p==null?void 0:p.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:B,onChange:ie=>Et({subnetIds:ie.target.value})})]}),c.jsxs("label",{className:"pp-network-check",children:[c.jsx("input",{type:"checkbox",checked:!!(p!=null&&p.enableSharedInternetAccess),disabled:B,onChange:ie=>Et({enableSharedInternetAccess:ie.target.checked})}),"VPC 内共享公网出口"]})]})]}),c.jsxs("section",{className:"pp-config-section pp-env-section",children:[c.jsxs("div",{className:"pp-env-head",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"pp-config-label",children:["环境变量",c.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[K," 项"]})]}),c.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),c.jsx("button",{type:"button",className:"pp-icon-btn",title:oe?"隐藏值":"显示值",onClick:()=>he(ie=>!ie),children:oe?c.jsx(hF,{className:"pp-ic"}):c.jsx(kI,{className:"pp-ic"})})]}),c.jsxs("button",{type:"button",className:"pp-env-add",onClick:Ct,disabled:B,children:[c.jsx(ms,{className:"pp-ic"}),"添加变量"]}),(ct.length>0||G.length>0)&&c.jsxs("div",{className:"pp-env-table",children:[ct.length>0&&c.jsxs("div",{className:"pp-env-group",children:[c.jsxs("div",{className:"pp-env-group-head",children:[c.jsx("span",{children:"组件自动生成"}),c.jsxs("small",{children:[ct.length," 项"]})]}),ct.map(ie=>{const _e=ie.key.startsWith("ENABLE_");return c.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[c.jsx("input",{className:"pp-env-key-fixed",value:ie.key,readOnly:!0,disabled:B,"aria-label":`${ie.key} 环境变量名`}),c.jsx("input",{type:_e||oe?"text":"password",value:ie.value,placeholder:ie.required?"必填,尚未填写":"可选,尚未填写",readOnly:_e,disabled:B||!_e&&!h,autoComplete:"off","aria-label":`${ie.key} 环境变量值`,onChange:ye=>h==null?void 0:h(ie.key,ye.currentTarget.value)}),c.jsx("span",{className:"pp-env-source",children:_e?"自动":"同步"})]},ie.key)})]}),G.length>0&&c.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[c.jsx("span",{children:"自定义变量"}),c.jsxs("small",{children:[G.length," 项"]})]}),G.map(ie=>c.jsxs("div",{className:"pp-env-row",children:[c.jsx("input",{value:ie.key,placeholder:"名称",disabled:B,autoComplete:"off",onChange:_e=>ot(ie.id,{key:_e.currentTarget.value})}),c.jsx("input",{type:oe?"text":"password",value:ie.value,placeholder:"值",disabled:B,autoComplete:"off",onChange:_e=>ot(ie.id,{value:_e.currentTarget.value})}),c.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:B,onClick:()=>Zt(ie.id),children:c.jsx(Xr,{className:"pp-ic"})})]},ie.id))]})]}),(B||S||Object.keys(V).length>0)&&c.jsxs("section",{className:"pp-config-section pp-progress-section",children:[c.jsx("div",{className:"pp-config-label",children:"部署进度"}),c.jsx("ol",{className:"pp-steps",children:Pf.map((ie,_e)=>{const ye=ne?Pf.findIndex(gt=>gt.phase===ne):-1,Pe=!!O&&(ye===-1?_e===0:_e===ye);let $e;S?$e="done":Pe?$e="failed":ye===-1?$e=B?"active":"pending":_eie.phase===ne))==null?void 0:an.label)??ne}阶段):`:""}${O}`,onRetry:Fe}),S&&c.jsxs("section",{className:"pp-deploy-result",children:[c.jsx("div",{className:"pp-deploy-result-header",children:"部署成功"}),c.jsxs("div",{className:"pp-deploy-result-body",children:[S.region&&c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"区域"}),c.jsx("code",{children:S.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"Agent 名称"}),c.jsx("code",{children:S.agentName})]}),c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"API 端点"}),c.jsx("code",{className:"pp-deploy-result-url",children:S.url})]})]}),c.jsxs("div",{className:"pp-deploy-result-actions",children:[c.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:mt,disabled:re,children:[re?c.jsx(bt,{className:"pp-ic spin"}):c.jsx(LI,{className:"pp-ic"}),re?"连接中…":"立即对话"]}),S.consoleUrl&&c.jsxs("a",{href:S.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[c.jsx(kE,{className:"pp-ic"}),"控制台"]})]})]})]}),c.jsx("div",{className:"pp-config-actions",children:c.jsxs("button",{type:"button",className:"pp-deploy",onClick:Fe,disabled:B||C,children:[B?c.jsx(bt,{className:"pp-ic spin"}):O?c.jsx(DI,{className:"pp-ic"}):c.jsx(ute,{className:"pp-ic"}),B?"部署中…":O?"重试部署":"部署"]})})]})]}),c.jsx(fte,{open:P,onCancel:tt,onConfirm:()=>void rt()})]})}const sk="dogfooding",b0="dogfooding",E0="dogfooding_b";let wte=0;const x0=()=>++wte;function ik(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function vte(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function ak(e){const t=[],n=vte(e);t.push(n);const r=n.indexOf("{"),s=n.lastIndexOf("}");r>=0&&s>r&&t.push(n.slice(r,s+1));for(const i of t)try{const a=JSON.parse(i);if(a&&typeof a=="object"&&(typeof a.name=="string"||typeof a.instruction=="string"))return await fp(s3(a))}catch{}return null}function _te({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=v.useState([{id:x0(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[o,l]=v.useState(""),[u,d]=v.useState(!1),[f,h]=v.useState(null),[p,m]=v.useState(null),[y,w]=v.useState(!1),[g,E]=v.useState(null),[b,_]=v.useState(null),[N,T]=v.useState(!1),[A,k]=v.useState(!1),[R,I]=v.useState({}),M=v.useRef(null),B=v.useRef(null),Y=v.useRef(null),P=v.useRef(null),U=v.useRef(null);v.useEffect(()=>{const ee=P.current;ee&&ee.scrollTo({top:ee.scrollHeight,behavior:"smooth"})},[i,u]),v.useEffect(()=>{const ee=U.current;ee&&(ee.style.height="auto",ee.style.height=Math.min(ee.scrollHeight,160)+"px")},[o]);const C=ee=>a(re=>[...re,{id:x0(),role:"assistant",text:ee}]);async function L(){if(M.current)return M.current;const ee=await up(sk,e);return M.current=ee,ee}async function O(ee,re){if(re.current)return re.current;const de=await up(ee,e);return re.current=de,de}async function j(ee,re){if(!R[ee])try{const de=await hd(re);I(G=>({...G,[ee]:de.model||re}))}catch{I(de=>({...de,[ee]:re}))}}async function S(ee,re,de){const G=await O(ee,re);let W=Qs();for await(const he of Mu({appName:ee,userId:e,sessionId:G,text:de}))W=ml(W,he);const oe=ik(W).trim();return{project:await ak(oe),finalText:oe}}const H=async(ee,re,de)=>LE(ee.name,ee.files,{region:"cn-beijing",projectName:"default"},{...de,onStage:re}),V=async()=>{const ee=o.trim();if(!(!ee||u)){if(a(re=>[...re,{id:x0(),role:"user",text:ee}]),l(""),h(null),d(!0),y){E(null),_(null),T(!0),k(!0),j("a",b0),j("b",E0);const re=S(b0,B,ee).then(({project:G})=>(E(G),G)).catch(G=>{const W=G instanceof Error?G.message:String(G);return h(W),null}).finally(()=>T(!1)),de=S(E0,Y,ee).then(({project:G})=>(_(G),G)).catch(G=>{const W=G instanceof Error?G.message:String(G);return h(W),null}).finally(()=>k(!1));try{const[G,W]=await Promise.all([re,de]),oe=[G?`方案 A:${G.name}`:null,W?`方案 B:${W.name}`:null].filter(Boolean);oe.length?C(`已生成两个方案(${oe.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const re=await L();let de=Qs();for await(const oe of Mu({appName:sk,userId:e,sessionId:re,text:ee}))de=ml(de,oe);const G=ik(de).trim(),W=await ak(G);W?(m(W),C(`已生成项目:${W.name}(${W.files.length} 个文件),可在右侧预览和编辑。`)):C(G||"(助手没有返回内容,请再描述一下你的需求。)")}catch(re){const de=re instanceof Error?re.message:String(re);h(de),C(`抱歉,调用智能构建助手失败:${de}`)}finally{d(!1)}}},D=ee=>{const re=ee==="a"?g:b;if(!re)return;m(re),w(!1),E(null),_(null),T(!1),k(!1);const de=ee==="a"?"A":"B",G=ee==="a"?R.a:R.b;C(`已采用方案 ${de}(${G??(ee==="a"?b0:E0)}),可继续编辑。`)},ne=ee=>{ee.key==="Enter"&&!ee.shiftKey&&!ee.nativeEvent.isComposing&&(ee.preventDefault(),V())};return c.jsx("div",{className:"ic-root",children:c.jsxs("div",{className:"ic-body",children:[c.jsxs("div",{className:"ic-chat",children:[c.jsxs("div",{className:"ic-transcript",ref:P,children:[c.jsx(Hi,{initial:!1,children:i.map(ee=>c.jsxs(Gt.div,{className:`ic-turn ic-turn--${ee.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[ee.role==="assistant"&&c.jsx("div",{className:"ic-avatar",children:c.jsx(Ha,{className:"ic-avatar-icon"})}),c.jsx("div",{className:"ic-bubble",children:ee.role==="assistant"?c.jsx(_d,{text:ee.text}):ee.text})]},ee.id))}),u&&c.jsxs(Gt.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[c.jsx("div",{className:"ic-avatar",children:c.jsx(Ha,{className:"ic-avatar-icon"})}),c.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[c.jsx("span",{className:"ic-dot"}),c.jsx("span",{className:"ic-dot"}),c.jsx("span",{className:"ic-dot"})]})]})]}),f&&c.jsxs("div",{className:"ic-error",children:[c.jsx(TI,{className:"ic-error-icon"}),f]}),c.jsxs("div",{className:"ic-composer",children:[c.jsxs("div",{className:"ic-composer-box",children:[c.jsx("textarea",{ref:U,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:o,onChange:ee=>l(ee.target.value),onKeyDown:ne,disabled:u}),c.jsx("button",{className:"ic-send",onClick:()=>void V(),disabled:!o.trim()||u,title:"发送 (Enter)",children:c.jsx(jF,{className:"ic-send-icon"})})]}),c.jsxs("div",{className:"ic-composer-foot",children:[c.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[c.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:y,disabled:u,onChange:ee=>w(ee.target.checked)}),c.jsx("span",{className:"ic-ab-track",children:c.jsx("span",{className:"ic-ab-thumb"})}),c.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),c.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),c.jsx("aside",{className:"ic-preview",children:y?c.jsxs("div",{className:"ic-compare",children:[c.jsx(ok,{side:"a",project:g,loading:N,model:R.a,onAdopt:()=>D("a")}),c.jsx("div",{className:"ic-compare-divider"}),c.jsx(ok,{side:"b",project:b,loading:A,model:R.b,onAdopt:()=>D("b")})]}):p?c.jsx(Mx,{project:p,onChange:m,onDeploy:H,onAgentAdded:r,onDeploymentTaskChange:s}):c.jsxs("div",{className:"ic-preview-empty",children:[c.jsxs("div",{className:"ic-preview-empty-icon",children:[c.jsx(bF,{className:"ic-preview-empty-glyph"}),c.jsx(za,{className:"ic-preview-empty-spark"})]}),c.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),c.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function ok({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return c.jsxs("div",{className:"ic-pane",children:[c.jsxs("div",{className:"ic-pane-head",children:[c.jsxs("div",{className:"ic-pane-title",children:[c.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&c.jsx("span",{className:"ic-pane-model",children:r})]}),c.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),c.jsx("div",{className:"ic-pane-body",children:n?c.jsxs("div",{className:"ic-pane-loading",children:[c.jsx(bt,{className:"ic-pane-spinner"}),c.jsx("span",{children:"正在生成…"})]}):t?c.jsx(Mx,{project:t}):c.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const Tte=/^[A-Za-z_][A-Za-z0-9_]*$/;function nl(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":Tte.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function d3(e){const t=new Set,n=new Set,r=s=>{nl(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function Zr(e){return e.trimEnd().replace(/[。.]+$/,"")}function ua(e,t){return e[t]|e[t+1]<<8}function Ec(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function Nte(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function kte(e){let n=-1;for(let o=e.length-22;o>=0&&o>e.length-65557;o--)if(Ec(e,o)===101010256){n=o;break}if(n<0)throw new Error("无效的 zip:找不到 EOCD");const r=ua(e,n+10);let s=Ec(e,n+16);const i=new TextDecoder("utf-8"),a=[];for(let o=0;o{var o;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((o=a.Metadata)==null?void 0:o.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function Cte({selected:e,onChange:t}){const[n,r]=v.useState(""),[s,i]=v.useState([]),[a,o]=v.useState(!1),[l,u]=v.useState(null),[d,f]=v.useState(!1),h=y=>e.some(w=>w.source==="skillhub"&&w.slug===y),p=y=>{y.slug&&(h(y.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===y.slug))):t([...e,{source:"skillhub",slug:y.slug,name:y.name,folder:y.slug.split("/").pop()||y.name,namespace:y.namespace||"public",description:y.description}]))},m=async y=>{o(!0),u(null),f(!0);try{const w=await Ate(y);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{o(!1)}};return v.useEffect(()=>{const y=n.trim();if(!y){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(y),300);return()=>clearTimeout(w)},[n]),c.jsxs("div",{className:"cw-skillhub",children:[c.jsxs("div",{className:"cw-skill-searchrow",children:[c.jsxs("div",{className:"cw-skill-searchbox",children:[c.jsx(t1,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),c.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:y=>r(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),n.trim()&&m(n))}})]}),c.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(t1,{className:"cw-i"}),"搜索"]})]}),l&&c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:l})]}),a&&s.length===0?c.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?c.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const w=h(y.slug||"");return c.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(y),"aria-pressed":w,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsx("span",{className:"cw-skill-result-name",children:y.name}),y.description&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(y.description)}),y.sourceRepo&&c.jsx("span",{className:"cw-skill-result-repo",children:y.sourceRepo})]})]},y.id||y.slug)})}):d&&!l?c.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&c.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const M1=/(^|\/)skill\.md$/i;class Vi extends Error{}function Ite(e,t){const n=(e??"").replace(/\r\n?/g,` `).split(` -`);if(!n.length||n[0].trim()!=="---")throw new zi(`${t} 的 SKILL.md 必须以 YAML frontmatter (--- ... ---) 开头`);let r=-1;for(let o=1;o=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function Ite(e,t){if(!e)throw new zi(`${t} 的 SKILL.md 缺少必填的 name frontmatter`);if(e.length>64)throw new zi(`${t} 的 name 长度超过 64 个字符`);if(!/^[a-z0-9-]+$/.test(e))throw new zi(`${t} 的 name 必须匹配 [a-z0-9-]+(小写字母、数字、短横线)`)}function Rte(e,t){if(!e)throw new zi(`${t} 的 SKILL.md 缺少必填的 description frontmatter`);if(e.length>1024)throw new zi(`${t} 的 description 长度超过 1024 个字符`);if(/<[^>]+>/.test(e))throw new zi(`${t} 的 description 不能包含 XML 标签`)}function d3(e){const t=e.map(r=>({path:r.path.replace(/\\/g,"/").replace(/^\.\//,""),text:r.text})).filter(r=>r.path.length>0&&!r.path.endsWith("/")),n=new Set(t.map(r=>r.path.split("/")[0]));if(n.size===1&&t.every(r=>r.path.includes("/"))){const r=[...n][0]+"/";return t.map(s=>({path:s.path.slice(r.length),text:s.text}))}return t}function Ote(e){const t=new Map,n=new Set;for(const r of e)if(L1.test("/"+r.path)){const s=r.path.split("/");n.add(s.slice(0,-1).join("/"))}for(const r of e){const s=r.path.split("/");let i="";for(let u=s.length-1;u>=0;u--){const d=s.slice(0,u).join("/");if(n.has(d)){i=d;break}}const a=L1.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const o=i?r.path.slice(i.length+1):r.path,l=t.get(i)||[];l.push({path:o,text:r.text}),t.set(i,l)}return t}function Lte(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(l=>L1.test("/"+l.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};let i;try{i=Ate(s.text,r)}catch(l){return{hit:null,error:l instanceof Error?l.message:String(l)}}const a=i.name,o=[];for(const l of t){if(l.path.split("/").some(f=>f===".."))return{hit:null,error:`${r} 包含非法路径(..):${l.path}`};const d=`skills/${a}/${l.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${r} 包含非法路径:${l.path}`};o.push({path:d,content:l.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:i.name,description:i.description,folder:a,localFiles:o},error:null}}async function Mte(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await Tte(t)).map(s=>({path:s.name,text:s.text}));return f3(d3(r),e.name)}async function Dte(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function jte(e){const t=e.createReader(),n=[];for(;;){const r=await new Promise((s,i)=>t.readEntries(s,i));if(r.length===0)return n;n.push(...r)}}async function h3(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await Pte(e),path:n}];if(!e.isDirectory)return[];const r=await jte(e);return(await Promise.all(r.map(s=>h3(s,n)))).flat()}function Bte({selected:e,onChange:t}){const[n,r]=v.useState([]),[s,i]=v.useState([]),[a,o]=v.useState(!1),[l,u]=v.useState(!1),d=v.useRef(0),f=y=>e.some(_=>_.source==="local"&&_.folder===y),h=y=>{y.localFiles&&(f(y.folder||y.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(y.folder||y.name)))):t([...e,{source:"local",folder:y.folder||y.name,name:y.name,description:y.description,localFiles:y.localFiles}]))},p=v.useRef([]),m=v.useRef(e);v.useEffect(()=>{p.current=s},[s]),v.useEffect(()=>{m.current=e},[e]);const b=y=>{const _=new Set([...p.current.map(N=>N.folder||N.name),...m.current.filter(N=>N.source==="local").map(N=>N.folder)]),k=[],T=[];for(const N of y.hits){const R=N.folder||N.name;if(_.has(R)){k.push(N.name);continue}_.add(R),T.push(N)}i(N=>[...N,...T]);const C=[...y.errors];if(k.length>0&&C.push(`已跳过重复技能:${k.join("、")}`),r(C),T.length===1&&y.errors.length===0&&k.length===0){const N=T[0];N.localFiles&&t([...m.current,{source:"local",folder:N.folder||N.name,name:N.name,description:N.description,localFiles:N.localFiles}])}},w=y=>{y.preventDefault(),d.current+=1,u(!0)},g=y=>{y.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},E=async y=>{if(y.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(y.dataTransfer.items).map(k=>{var T;return(T=k.webkitGetAsEntry)==null?void 0:T.call(k)}).filter(k=>k!==null);if(_.length===0){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}o(!0);try{const k=(await Promise.all(_.map(N=>h3(N)))).flat(),T=_.some(N=>N.isDirectory);if(!T&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){b(await Mte(k[0].file));return}if(!T){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const C=new Map(k.map(({file:N,path:R})=>[N,R]));b(await Dte(k.map(({file:N})=>N),C))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{o(!1)}};return c.jsxs("div",{className:"cw-local",children:[c.jsxs("div",{className:`cw-local-dropzone ${l?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:y=>y.preventDefault(),onDragLeave:g,onDrop:y=>void E(y),children:[c.jsx(NE,{className:"cw-local-drop-icon","aria-hidden":!0}),c.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),c.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md(含 name / description frontmatter)。支持包含多个技能的目录。"}),a&&c.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&c.jsxs("div",{className:"cw-banner",children:[c.jsx(cd,{className:"cw-i"}),c.jsx("span",{children:n.join(";")})]}),s.length>0&&c.jsx("div",{className:"cw-skill-results",children:s.map(y=>{var k;const _=f(y.folder||y.name);return c.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(y),"aria-pressed":_,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?c.jsx(Ds,{className:"cw-i cw-i-sm"}):c.jsx(hs,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsx("span",{className:"cw-skill-result-name",children:y.name}),y.description&&c.jsx("span",{className:"cw-skill-result-desc",children:Qr(y.description)}),c.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=y.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},y.id)})})]})}function Fte({selected:e,onChange:t}){const[n,r]=v.useState([]),[s,i]=v.useState([]),[a,o]=v.useState(""),[l,u]=v.useState(!0),[d,f]=v.useState(!1),[h,p]=v.useState(null);v.useEffect(()=>{let g=!1;return(async()=>{u(!0),p(null);try{const E=await dU();g||(r(E),E.length>0&&o(E[0].id))}catch(E){g||p(E instanceof Error?E.message:"加载失败")}finally{g||u(!1)}})(),()=>{g=!0}},[]),v.useEffect(()=>{if(!a){i([]);return}const g=n.find(y=>y.id===a);let E=!1;return(async()=>{f(!0),p(null);try{const y=await hU(a,g==null?void 0:g.region);E||i(y)}catch(y){E||p(y instanceof Error?y.message:"加载失败")}finally{E||f(!1)}})(),()=>{E=!0}},[a,n]);const m=n.find(g=>g.id===a),b=(g,E)=>e.some(y=>y.source==="skillspace"&&y.skillId===g&&(y.version||"")===E),w=g=>{if(m)if(b(g.skillId,g.version))t(e.filter(E=>!(E.source==="skillspace"&&E.skillId===g.skillId&&(E.version||"")===g.version)));else{const E=gU(m,g);t([...e,{source:"skillspace",folder:E.folder||g.skillName,name:E.name,description:E.description,skillSpaceId:E.skillSpaceId,skillSpaceName:E.skillSpaceName,skillSpaceRegion:E.skillSpaceRegion,skillId:E.skillId,version:E.version}])}};return c.jsx("div",{className:"cw-skillspace",children:l?c.jsxs("p",{className:"cw-empty-line",children:[c.jsx(wt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?c.jsxs("div",{className:"cw-banner",children:[c.jsx(cd,{className:"cw-i"}),c.jsx("span",{children:h})]}):n.length===0?c.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"cw-skillspace-header",children:[c.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:g=>o(g.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(g=>c.jsxs("option",{value:g.id,children:[g.name||g.id,g.region?` [${g.region}]`:"",g.description?` — ${Qr(g.description)}`:""]},g.id))}),m&&c.jsx("a",{href:yU(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:c.jsx(kE,{className:"cw-i cw-i-sm"})})]}),d?c.jsxs("p",{className:"cw-empty-line",children:[c.jsx(wt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?c.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):c.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const E=b(g.skillId,g.version);return c.jsxs("button",{type:"button",className:`cw-skill-result ${E?"is-on":""}`,onClick:()=>w(g),"aria-pressed":E,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:E?c.jsx(Ds,{className:"cw-i cw-i-sm"}):c.jsx(hs,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsxs("span",{className:"cw-skill-result-name",children:[g.skillName,g.version&&c.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",g.version]})]}),g.skillDescription&&c.jsx("span",{className:"cw-skill-result-desc",children:Qr(g.skillDescription)}),c.jsxs("span",{className:"cw-skill-result-repo",children:[c.jsx(cF,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${g.skillId}/${g.version}`)})})]})})}const Ute=v.lazy(()=>el(()=>import("./MarkdownPromptEditor--dxbgBhm.js"),__vite__mapDeps([0,1])));function $te(e,t,n="text/plain"){const r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),s=document.createElement("a");s.href=r,s.download=e,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(r)}const lN=[{id:"type",label:"类型",hint:"选择 Agent 类型",icon:PF,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:cd,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:TI},{id:"tools",label:"工具",hint:"可调用的能力",icon:CE},{id:"skills",label:"技能",hint:"声明式技能",icon:Ha},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:ah},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:RI},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:vI},{id:"review",label:"完成",hint:"预览并创建",icon:MF}];function Hte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m7.2 15.8 7.9-7.9a2 2 0 0 1 2.8 0l1.2 1.2a2 2 0 0 1 0 2.8l-7 7H8.7l-1.5-1.5a1.15 1.15 0 0 1 0-1.6Z"}),c.jsx("path",{d:"m12.7 10.3 4 4"}),c.jsx("path",{d:"M6.3 19h12.4"}),c.jsx("path",{d:"m5.5 8.2.5-1.4 1.4-.5L6 5.8l-.5-1.4L5 5.8l-1.4.5 1.4.5.5 1.4Z"})]})}function zte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"3.25",y:"4.25",width:"17.5",height:"15.5",rx:"2.75"}),c.jsx("path",{d:"M3.75 8.75h16.5"}),c.jsx("circle",{cx:"6.35",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"8.85",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none",opacity:"0.45"}),c.jsx("path",{d:"M6 14h2.2l1.35-2.8 2.1 5.5 1.7-3.1H18"})]})}function Vte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),c.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),c.jsx("path",{d:"M3 10v4",opacity:"0.45"}),c.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}const x0=4,Kte={llm:"LLM 智能体",sequential:"顺序型智能体",parallel:"并行型智能体",loop:"循环型智能体",a2a:"远程智能体"},cN={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"};function p3(e,t){var r,s,i;if(!(e!=null&&e.enabled))return{};const n={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(n.REGISTRY_TOP_K=((r=e.registryTopK)==null?void 0:r.trim())||ri.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||ri.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||ri.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function uN({items:e,selected:t,onToggle:n,scrollRows:r}){return c.jsx("div",{className:`cw-checklist ${r?"cw-checklist-tools":""}`,style:r?{"--cw-checklist-max-height":`${r*65+(r-1)*8}px`}:void 0,children:e.map(s=>{const i=t.includes(s.id);return c.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[c.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&c.jsx(Ds,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-check-text",children:[c.jsx("span",{className:"cw-check-title",children:s.label}),c.jsx("span",{className:"cw-check-desc",children:Qr(s.desc)})]})]},s.id)})})}function w0({options:e,value:t,onChange:n}){return c.jsx("div",{className:"cw-segmented",children:e.map(r=>{var i;const s=(t??((i=e[0])==null?void 0:i.id))===r.id;return c.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Qr(r.desc),children:[c.jsx("span",{className:"cw-seg-title",children:r.label}),c.jsx("span",{className:"cw-seg-desc",children:Qr(r.desc)})]},r.id)})})}function Yte(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function bc({env:e,values:t,onChange:n}){return e.length===0?c.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):c.jsx("div",{className:"cw-env-fields",children:e.map(r=>c.jsxs("label",{className:"cw-env-field",children:[c.jsxs("span",{className:"cw-env-field-head",children:[c.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&c.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&c.jsx("code",{title:r.key,children:r.key})]}),c.jsx("input",{className:"cw-input",type:Yte(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function Wte({tools:e,onChange:t}){const n=(i,a)=>t(e.map((o,l)=>l===i?{...o,...a}:o)),r=i=>t(e.filter((a,o)=>o!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return c.jsxs("div",{className:"cw-mcp",children:[e.length>0&&c.jsx("div",{className:"cw-mcp-list",children:c.jsx($i,{initial:!1,children:e.map((i,a)=>c.jsxs(Wt.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[c.jsxs("div",{className:"cw-mcp-rowhead",children:[c.jsxs("div",{className:"cw-mcp-transport",children:[c.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${i.transport==="http"?"is-on":""}`,onClick:()=>n(a,{transport:"http"}),"aria-pressed":i.transport==="http",children:c.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),c.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${i.transport==="stdio"?"is-on":""}`,onClick:()=>n(a,{transport:"stdio"}),"aria-pressed":i.transport==="stdio",children:c.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),c.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:c.jsx(jl,{className:"cw-i cw-i-sm"})})]}),c.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:o=>n(a,{name:o.target.value})}),i.transport==="http"?c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:o=>n(a,{url:o.target.value})}),c.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:o=>n(a,{authToken:o.target.value})})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:o=>n(a,{command:o.target.value})}),c.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:o=>n(a,{args:o.target.value.split(/\s+/).filter(Boolean)})}),c.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),c.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[c.jsx(hs,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&c.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function m3({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),c.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),c.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),c.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function qte({s:e,onRemove:t}){let n=Ha,r="火山 Find Skill 技能广场";return e.source==="local"?(n=NE,r="本地"):e.source==="skillspace"&&(n=m3,r="AgentKit Skills 中心"),c.jsxs(Wt.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[c.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:c.jsx(n,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-selected-skill-meta",children:[c.jsx("span",{className:"cw-selected-skill-name",children:e.name}),c.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Qr(e.description)}`:""]})]}),c.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:c.jsx(Gr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const v0=[{id:"local",label:"本地文件",icon:NE},{id:"skillspace",label:"AgentKit Skills 中心",icon:m3},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:lm}];function Gte({selected:e,onChange:t}){const[n,r]=v.useState("local"),[s,i]=v.useState(!1),a=v0.findIndex(l=>l.id===n),o=l=>t(e.filter(u=>_0(u)!==l));return v.useEffect(()=>{if(!s)return;const l=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[s]),c.jsxs("div",{className:"cw-skillspane",children:[c.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[c.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:c.jsx(hs,{className:"cw-i"})}),c.jsx("span",{children:"添加 Skill"})]}),e.length>0&&c.jsxs("div",{className:"cw-skill-selected",children:[c.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),c.jsx("div",{className:"cw-selected-skill-list",children:c.jsx($i,{initial:!1,children:e.map(l=>c.jsx(qte,{s:l,onRemove:()=>o(_0(l))},_0(l)))})})]}),c.jsx($i,{children:s&&c.jsx(Wt.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:l=>{l.target===l.currentTarget&&i(!1)},children:c.jsxs(Wt.div,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"cw-skill-dialog-title",initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-skill-dialog-head",children:[c.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),c.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:c.jsx(Gr,{className:"cw-i"})})]}),c.jsxs("div",{className:"cw-skill-dialog-body",children:[c.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${v0.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[c.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),v0.map(({id:l,label:u,icon:d})=>c.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${l}`,"aria-controls":"cw-skill-tabpanel","aria-selected":n===l,className:`cw-skill-pickertab ${n===l?"is-on":""}`,onClick:()=>r(l),children:[c.jsx(d,{className:"cw-i cw-i-sm"}),u]},l))]}),c.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&c.jsx(Ste,{selected:e,onChange:t}),n==="local"&&c.jsx(Bte,{selected:e,onChange:t}),n==="skillspace"&&c.jsx(Fte,{selected:e,onChange:t})]})]})]})})})]})}function _0(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function Ec({checked:e,onChange:t,title:n,desc:r,icon:s}){return c.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[c.jsx("span",{className:"cw-toggle-icon",children:c.jsx(s,{className:"cw-i"})}),c.jsxs("span",{className:"cw-toggle-text",children:[c.jsx("span",{className:"cw-toggle-title",children:n}),c.jsx("span",{className:"cw-toggle-desc",children:Qr(r)})]}),c.jsx("span",{className:"cw-switch","aria-hidden":!0,children:c.jsx(Wt.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}const dN=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]);function Xte(e,t){var r;let n=e;for(const s of t)if(n=(r=n.subAgents)==null?void 0:r[s],!n)return!1;return!0}function Eh(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Cd(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Cd(i[r],s,n),{...e,subAgents:i}}function Qte(e,t){return Cd(e,t,n=>({...n,subAgents:[...n.subAgents,Gi()]}))}function Zte(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Cd(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}function Jte(e,t,n,r){return Cd(e,t,s=>{const i=s.subAgents.slice(),[a]=i.splice(n,1);return i.splice(r,0,a),{...s,subAgents:i}})}const ene=e=>e==="sequential"||e==="loop",g3=e=>!Ad(e.agentType),tne=3;function y3(e,t,n=!1){var s;if(Ad(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心 ID";const r=tl(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":i3(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function b3(e,t,n=[]){const r=[],s=Ad(e.agentType),i=y3(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),g3(e)&&e.subAgents.forEach((a,o)=>r.push(...b3(a,t,[...n,o]))),r}function E3(e){return 1+e.subAgents.reduce((t,n)=>t+E3(n),0)}function nne(e){const t=[],n={},r=i=>{var a,o,l,u;for(const d of i.builtinTools??[]){const f=Ox.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:XM}),Object.assign(n,p3(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((o=Tp.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:o.env)??[]}),i.memory.longTerm&&t.push({env:((l=kp.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:l.env)??[]}),i.knowledgebase&&t.push({env:((u=Np.find(d=>d.id===(i.knowledgebaseBackend??"local")))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=Sp.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=a3(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function x3({root:e,path:t,selectedPath:n,duplicateNames:r,showErrors:s,validationPulse:i,onSelect:a,onChange:o,onClearRoot:l}){const u=Eh(e,t),d=Lx(u.agentType),f=d.icon,h=t.length===0,p=dN(t,n),m=g3(u),b=m&&t.length{const C=Qte(e,t),N=Eh(C,t).subAgents.length-1;o(C,[...t,N])},g=()=>o(Zte(e,t),t.slice(0,-1)),E=t.slice(0,-1),y=!h&&ene(Eh(e,E).agentType),[_,k]=v.useState(!1),T=C=>{C.preventDefault(),C.stopPropagation(),k(!1);const N=C.dataTransfer.getData("application/x-agent-path");if(!N)return;let R;try{R=JSON.parse(N)}catch{return}if(!dN(R.slice(0,-1),E))return;const I=R[R.length-1],M=t[t.length-1];I!==M&&o(Jte(e,E,I,M),[...E,M])};return c.jsxs("div",{className:"cw-tree-branch",children:[c.jsxs("div",{className:`cw-tree-node cw-tree-type-${u.agentType??"llm"} ${p?"is-selected":""} ${y?"is-draggable":""} ${_?"is-dragover":""} ${s&&y3(u,r,h)?`is-invalid cw-error-shake-${i%2}`:""}`,role:"button",tabIndex:0,draggable:y,onDragStart:y?C=>{C.dataTransfer.setData("application/x-agent-path",JSON.stringify(t)),C.dataTransfer.effectAllowed="move",C.stopPropagation()}:void 0,onDragOver:y?C=>{C.preventDefault(),k(!0)}:void 0,onDragLeave:y?()=>k(!1):void 0,onDrop:y?T:void 0,onClick:()=>a(t),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a(t))},children:[c.jsx(f,{className:"cw-tree-icon"}),c.jsxs("span",{className:"cw-tree-main",children:[c.jsx("span",{className:"cw-tree-name",children:Ad(u.agentType)?"远程 Agent":u.name.trim()||"未命名"}),c.jsx("span",{className:"cw-tree-type",children:d.label})]}),c.jsxs("span",{className:"cw-tree-actions",children:[h&&c.jsx("button",{type:"button",className:"cw-icon-btn cw-tree-clear",title:"清空根 Agent","aria-label":"清空根 Agent",onClick:C=>{C.stopPropagation(),l()},children:c.jsx(Hte,{className:"cw-i cw-i-sm"})}),b&&c.jsx("button",{type:"button",className:"cw-icon-btn",title:"添加子 Agent",onClick:C=>{C.stopPropagation(),w()},children:c.jsx(hs,{className:"cw-i cw-i-sm"})}),!h&&c.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",title:"删除",onClick:C=>{C.stopPropagation(),g()},children:c.jsx(jl,{className:"cw-i cw-i-sm"})})]})]}),m&&u.subAgents.length>0&&c.jsx("div",{className:"cw-tree-children",children:u.subAgents.map((C,N)=>c.jsx(x3,{root:e,path:[...t,N],selectedPath:n,duplicateNames:r,showErrors:s,validationPulse:i,onSelect:a,onChange:o,onClearRoot:l},N))})]})}function xh(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function fN(e){return JSON.stringify(xh(e))}function rne({enabled:e,disabledReason:t,phase:n,stale:r,run:s,projectName:i,logs:a,messages:o,input:l,error:u,deploying:d,deployError:f,onInput:h,onSend:p,onRestart:m,onIgnoreChanges:b,onDeploy:w}){const[g,E]=v.useState(!1),y=n==="ready"||n==="sending",_=n==="building"||n==="starting"||n==="sending",k=e&&!s&&n==="idle",T=e&&(n==="building"||n==="starting"),C=!!(s&&r&&!T);return g?c.jsx("aside",{className:"cw-debug is-collapsed","aria-label":"调试窗口(已收起)",children:c.jsx("button",{type:"button",className:"cw-debug-expand",onClick:()=>E(!1),"aria-label":"展开调试栏",title:"展开调试栏",children:c.jsx(zte,{className:"cw-i"})})}):c.jsxs("aside",{className:"cw-debug","aria-label":"调试窗口",children:[c.jsxs("div",{className:"cw-debug-head",children:[c.jsxs("div",{className:"cw-debug-title",children:[c.jsx("button",{type:"button",className:"cw-debug-collapse",onClick:()=>E(!0),"aria-label":"收起调试栏",title:"收起调试栏",children:c.jsx(or,{className:"cw-i cw-i-sm"})}),c.jsx("span",{children:"调试"})]}),c.jsx("div",{className:"cw-debug-head-actions",children:c.jsxs("button",{type:"button",className:"cw-debug-deploy",disabled:d,onClick:w,title:"查看源码、填写环境变量并部署",children:["去部署",d?c.jsx(wt,{className:"cw-i cw-spin"}):c.jsx(EI,{className:"cw-i"})]})})]}),!s&&n==="idle"&&!e&&c.jsx("div",{className:"cw-debug-sub",children:c.jsx("span",{children:t})}),f&&c.jsx("div",{className:"cw-debug-deploy-error",role:"alert",children:f}),c.jsxs("div",{className:"cw-debug-stage",children:[c.jsx("div",{className:"cw-debug-body",children:e?n==="error"?c.jsxs("div",{className:"cw-debug-error",children:[c.jsx(Ap,{message:u||"调试失败",className:"cw-debug-error-detail",onRetry:async()=>{await m()}}),a.length>0&&c.jsx("div",{className:"cw-debug-progress",children:a.map((N,R)=>c.jsx("div",{className:"cw-debug-logline",children:c.jsx("span",{children:N})},`${N}-${R}`))})]}):c.jsx("div",{className:"cw-debug-chat",children:o.length===0?c.jsx("div",{className:"cw-debug-chat-empty",children:"输入消息开始验证当前 Agent。"}):o.map((N,R)=>c.jsxs("div",{className:`cw-debug-msg cw-debug-msg-${N.role}`,children:[c.jsx("div",{className:"cw-debug-role",children:N.role==="user"?"你":i||"Agent"}),c.jsx("div",{className:"cw-debug-content",children:N.role==="user"?N.content:N.error?c.jsx(Ap,{message:N.error,className:"cw-debug-msg-error"}):N.blocks&&N.blocks.length>0?c.jsx(mx,{blocks:N.blocks,onAction:()=>{}}):N.content?N.content:R===o.length-1&&n==="sending"?c.jsx(uM,{}):null})]},R))}):c.jsx("div",{className:"cw-debug-empty",children:t})}),c.jsx("div",{className:"cw-debug-composer",children:c.jsxs("div",{className:"cw-debug-composerbox",children:[c.jsx("textarea",{className:"cw-debug-input",rows:1,value:l,placeholder:r?"更新 Agent 后可继续调试":y?"输入测试消息...":"调试环境启动后可输入",disabled:!y||_||r,onChange:N=>h(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),p())}}),c.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||_||r||!l.trim(),onClick:p,children:n==="sending"?c.jsx(wt,{className:"cw-i cw-spin"}):c.jsx(xI,{className:"cw-i"})})]})}),(k||T||C)&&c.jsx("div",{className:"cw-debug-overlay",role:"status","aria-live":"polite",children:c.jsxs("div",{className:"cw-debug-overlay-content",children:[c.jsx("strong",{className:"cw-debug-overlay-title",children:T?"正在初始化调试环境":C?"Agent 配置已变更":"启动调试环境"}),T?c.jsx("div",{className:"cw-debug-overlay-progress",children:a.map((N,R)=>c.jsxs("div",{className:"cw-debug-logline",children:[R===a.length-1?c.jsx(wt,{className:"cw-i cw-spin"}):c.jsx(Ds,{className:"cw-i"}),c.jsx("span",{children:N})]},`${N}-${R}`))}):C?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"cw-debug-overlay-copy",children:"当前对话仍在使用上一次配置。更新后,新配置才会生效。"}),c.jsxs("div",{className:"cw-debug-overlay-actions",children:[c.jsx("button",{type:"button",className:"cw-debug-ignore",disabled:_,onClick:b,children:"忽略"}),c.jsxs("button",{type:"button",className:"cw-debug-start",disabled:_,onClick:m,children:[c.jsx(SE,{className:"cw-i"}),"更新 Agent"]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"cw-debug-overlay-copy",children:"启动后会生成代码并创建临时运行环境。"}),c.jsxs("button",{type:"button",className:"cw-debug-start",onClick:m,children:[c.jsx(Vte,{className:"cw-i cw-debug-run-icon"}),"启动调试环境"]})]})]})})]})]})}function sne({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i}){var Pn,tr,zn,Sn,st,An,jt,Qt,Cn,jn,xn;const[a,o]=v.useState(()=>r??Gi()),[l,u]=v.useState(!1),[d,f]=v.useState(0),[h,p]=v.useState(null),[m,b]=v.useState(!1),[w,g]=v.useState("cn-beijing"),E=(s==null?void 0:s.generatedAgentTestRun)===!0,y=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[_,k]=v.useState("idle"),[T,C]=v.useState(null),N=v.useRef(null),[R,I]=v.useState(null),[M,B]=v.useState(""),[Y,P]=v.useState([]),[U,A]=v.useState([]),[L,O]=v.useState(""),[j,S]=v.useState(null),[H,V]=v.useState(""),[D,ne]=v.useState(""),[J,re]=v.useState("basic"),[de,G]=v.useState(""),[W,ae]=v.useState(!1),[he,Z]=v.useState(!1),[ce,Ce]=v.useState(!1),[Ee,ge]=v.useState([]),Me=v.useRef(null),ve=v.useRef({});v.useEffect(()=>()=>{const te=N.current;te&&r1(te.runId).catch(Ne=>console.warn("清理调试运行失败",Ne))},[]);const $e=v.useRef(null);$e.current||($e.current=({meta:te,children:Ne})=>c.jsxs("section",{ref:Ie=>{ve.current[te.id]=Ie},id:`cw-sec-${te.id}`,"data-step-id":te.id,className:"cw-section",children:[c.jsx("header",{className:"cw-sec-head",children:c.jsxs("h2",{className:"cw-sec-title",children:[te.label,te.required&&c.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),Ne]}));const Re=Xte(a,Ee)?Ee:[],oe=Eh(a,Re),_t=Re.length===0,we=`cw-model-advanced-${Re.join("-")||"root"}`,Tt=`cw-more-tool-types-${Re.join("-")||"root"}`,ct=`cw-advanced-config-${Re.join("-")||"root"}`,K=Math.max(0,Lf.findIndex(te=>te.id===(oe.agentType??"llm"))),X=te=>o(Ne=>Cd(Ne,Re,Ie=>({...Ie,...te}))),le=(te,Ne)=>o(Ie=>{var je;return{...Ie,deployment:{...Ie.deployment??{feishuEnabled:!1},envValues:{...((je=Ie.deployment)==null?void 0:je.envValues)??{},[te]:Ne}}}}),ke=te=>X({a2aRegistry:{...oe.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...te}}),Oe=(te,Ne)=>{if(!(te in cN))return;const Ie=cN[te];ke({[Ie]:Ne}),le(te,Ne)},ut=te=>{if(!(_t&&te==="a2a")){if(te==="a2a"){X({agentType:te,a2aRegistry:{...oe.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}X({agentType:te,a2aRegistry:oe.a2aRegistry?{...oe.a2aRegistry,enabled:!1}:void 0})}},We=(te,Ne)=>{o(te),Ne&&ge(Ne)},ot=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(o(Gi()),ge([]),u(!1),Ce(!1))},Xt=oe.builtinTools??[],It=oe.mcpTools??[],Ge=oe.tracingExporters??[],bt=oe.selectedSkills??[],$t=[oe.memory.shortTerm,oe.memory.longTerm,oe.tracing].filter(Boolean).length,Tn=te=>X({builtinTools:Xt.includes(te)?Xt.filter(Ne=>Ne!==te):[...Xt,te]}),Ue=te=>{const Ne=Ge.includes(te)?Ge.filter(Ie=>Ie!==te):[...Ge,te];X({tracingExporters:Ne,tracing:Ne.length>0?!0:oe.tracing})},rt=i3(oe.agentType),tt=Ad(oe.agentType),gt=v.useMemo(()=>u3(a),[a]),ue=tt?null:tl(oe.name)??(gt.has(oe.name)?"Agent 名称在当前结构中必须唯一":null),Le=ue!==null,Qe=!tt&&oe.description.trim().length===0,on=oe.instruction.trim().length===0,ln=tt&&!((Pn=oe.a2aRegistry)!=null&&Pn.registrySpaceId.trim()),ie=te=>l&&te?`is-error cw-error-shake-${d%2}`:"",_e=v.useMemo(()=>b3(a,gt),[a,gt]),ye=_e.length===0,Pe=v.useMemo(()=>fN(a),[a]),He=v.useMemo(()=>nne(a),[a]),qe=!!(T&&H&&H!==Pe&&D!==Pe);v.useEffect(()=>{D&&D!==Pe&&ne("")},[Pe,D]);const yt=v.useMemo(()=>{var te,Ne,Ie,je;return{type:!0,basic:tt?!ln:!Le&&(rt||!on),model:!!((te=oe.modelName)!=null&&te.trim()||(Ne=oe.modelProvider)!=null&&Ne.trim()||(Ie=oe.modelApiBase)!=null&&Ie.trim()),tools:Xt.length>0||It.length>0,skills:bt.length>0,knowledge:oe.knowledgebase,advanced:oe.memory.shortTerm||oe.memory.longTerm||oe.tracing,subagents:(((je=oe.subAgents)==null?void 0:je.length)??0)>0,review:ye}},[oe,Le,on,rt,tt,ye,Xt,It,bt]),Ot=rt||tt?["basic"]:["basic","model","tools","skills","knowledge",..._t?["advanced"]:[]],mn=lN.filter(te=>Ot.includes(te.id)),gn=Ot.join("|"),Ht=Re.join("."),kn=mn.findIndex(te=>te.id===J),Jn=te=>{var Ne;(Ne=ve.current[te])==null||Ne.scrollIntoView({behavior:"smooth",block:"start"})};v.useEffect(()=>{if(h)return;const te=Me.current;if(!te)return;const Ne=gn.split("|");let Ie=0;const je=()=>{Ie=0;const ht=Ne[Ne.length-1];let Zt=Ne[0];if(te.scrollTop+te.clientHeight>=te.scrollHeight-2)Zt=ht;else{const xt=te.getBoundingClientRect().top+24;for(const In of Ne){const kt=ve.current[In];if(!kt||kt.getBoundingClientRect().top>xt)break;Zt=In}}Zt&&re(xt=>xt===Zt?xt:Zt)},Et=()=>{Ie||(Ie=window.requestAnimationFrame(je))};return je(),te.addEventListener("scroll",Et,{passive:!0}),window.addEventListener("resize",Et),()=>{te.removeEventListener("scroll",Et),window.removeEventListener("resize",Et),Ie&&window.cancelAnimationFrame(Ie)}},[h,gn,Ht]);const wr=()=>ye?!0:(u(!0),f(te=>te+1),_e[0]&&(ge(_e[0].path),window.requestAnimationFrame(()=>Jn("basic"))),!1),Dn=async()=>{const te=N.current;if(N.current=null,C(null),I(null),V(""),ne(""),te)try{await r1(te.runId)}catch(Ne){console.warn("清理调试运行失败",Ne)}},Hn=async()=>{if(G(""),!!wr()){b(!0);try{const te=await up(xh(a));await Dn(),k("idle"),B(""),P([]),A([]),O(""),S(null),p(te)}catch(te){G(`打开部署页失败:${te instanceof Error?te.message:String(te)}`)}finally{b(!1)}}},er=async()=>{if(!E||m||!wr())return;const te=fN(a);ne(""),S(null),A([]),O(""),P([]),k("building");try{await Dn();const Ne=[],Ie=ht=>{Ne.push(ht),P([...Ne])};Ie("提交 Agent 配置"),k("starting"),Ie("初始化调试环境");const je=await nR(xh(a));N.current=je,C(je),B(je.appName),Ie("创建调试会话");const Et=await rR(je.runId,"test_user");I(Et),V(te),Ie("调试环境就绪"),k("ready")}catch(Ne){S(Ne instanceof Error?Ne.message:String(Ne)),k("error")}},vr=async()=>{const te=N.current,Ne=R,Ie=L.trim();if(!(!te||!Ne||!Ie||_==="sending")){O(""),k("sending"),A(je=>[...je,{role:"user",content:Ie},{role:"assistant",content:"",blocks:[]}]);try{let je=qs(),Et="";for await(const ht of sR({runId:te.runId,userId:"test_user",sessionId:Ne,text:Ie})){const Zt=ht.error||ht.errorMessage||ht.error_message;if(Zt){A(xt=>{const In=[...xt],kt=In[In.length-1];return(kt==null?void 0:kt.role)==="assistant"&&(kt.error=String(Zt)),In});break}je=pl(je,ht),Et=je.blocks.filter(xt=>xt.kind==="text").map(xt=>xt.text).join(""),A(xt=>{const In=[...xt],kt=In[In.length-1];return(kt==null?void 0:kt.role)==="assistant"&&(kt.content=Et,kt.blocks=je.blocks),In})}k("ready")}catch(je){A(Et=>{const ht=[...Et],Zt=ht[ht.length-1];return(Zt==null?void 0:Zt.role)==="assistant"&&(Zt.error=je instanceof Error?je.message:String(je)),ht}),k("ready")}}};if(h){const te=async(Ne,Ie,je)=>{var Zt;const Et=(Zt=a.deployment)==null?void 0:Zt.network,ht=Et&&Et.mode&&Et.mode!=="public"?{mode:Et.mode,vpc_id:Et.vpcId,subnet_ids:Et.subnetIds,enable_shared_internet_access:Et.enableSharedInternetAccess}:void 0;return LE(Ne.name,Ne.files,{region:w,projectName:"default",network:ht},{...je,onStage:Ie})};return c.jsx("div",{className:"cw-root cw-root-preview",children:c.jsx("div",{className:"cw-preview-body",children:c.jsx(Mx,{project:h,agentDraft:a,agentName:a.name||"未命名 Agent",agentCount:E3(a),onChange:p,onDeploy:te,onAgentAdded:n,onDeploymentTaskChange:i,feishuEnabled:!!((tr=a.deployment)!=null&&tr.feishuEnabled),onFeishuEnabledChange:async Ne=>{const Ie={...a,deployment:{...a.deployment??{feishuEnabled:!1},feishuEnabled:Ne}},je=await up(xh(Ie));o(Ie),p(je)},deploymentEnv:He.specs,deploymentEnvValues:{...(zn=a.deployment)==null?void 0:zn.envValues,...He.fixedValues},onDeploymentEnvChange:le,network:(Sn=a.deployment)==null?void 0:Sn.network,onNetworkChange:Ne=>o(Ie=>({...Ie,deployment:{...Ie.deployment??{feishuEnabled:!1},network:Ne}})),deployRegion:w,onDeployRegionChange:g,onBack:()=>p(null),onExportYaml:()=>$te(`${a.name||"agent"}.yaml`,Kee(a),"text/yaml")})})})}const zt=$e.current,Nn=te=>lN.find(Ne=>Ne.id===te);return c.jsx("div",{className:"cw-root",children:c.jsxs("div",{className:"cw-editor",children:[c.jsxs("aside",{className:"cw-tree","aria-label":"Agent 结构",children:[c.jsx("div",{className:"cw-tree-head",children:"Agent 结构"}),c.jsx(x3,{root:a,path:[],selectedPath:Re,duplicateNames:gt,showErrors:l,validationPulse:d,onSelect:ge,onChange:We,onClearRoot:ot})]}),c.jsxs("div",{className:"cw-detail",children:[c.jsx("div",{className:"cw-typebar",children:c.jsx("div",{className:"cw-typebar-inner",children:c.jsxs("div",{className:"cw-typeradio cw-typeradio--row",role:"radiogroup","aria-label":"Agent 类型",style:{"--cw-agent-type-gap":`${x0}px`,"--cw-agent-type-slider-width":`calc((100% - ${8+x0*(Lf.length-1)}px) / ${Lf.length})`,"--cw-active-type-offset":`calc(${K*100}% + ${K*x0}px)`},children:[c.jsx("span",{className:"cw-typeradio-slider","aria-hidden":!0}),Lf.map(te=>{const Ne=(oe.agentType??"llm")===te.id,Ie=_t&&te.id==="a2a",je=Ie?"cw-remote-agent-disabled-hint":void 0;return c.jsxs("label",{className:`cw-typeradio-item ${Ne?"is-on":""} ${Ie?"is-disabled":""}`,title:Ie?void 0:te.desc,tabIndex:Ie?0:void 0,"aria-describedby":je,children:[c.jsx("input",{type:"radio",name:"agentType",className:"cw-typeradio-input",checked:Ne,disabled:Ie,onChange:()=>ut(te.id)}),c.jsxs("span",{className:"cw-typeradio-title",children:[Kte[te.id].replace("智能体",""),c.jsx("wbr",{}),"智能体"]}),Ie&&c.jsx("span",{id:je,className:"cw-typeradio-disabled-hint",role:"tooltip",children:"远程 Agent 仅可作为子 Agent"})]},te.id)})]})})}),c.jsx("div",{className:"cw-detail-scroll",ref:Me,children:c.jsx("div",{className:"cw-detail-inner",children:c.jsxs("div",{className:"cw-lower",children:[c.jsxs("div",{className:"cw-form-col",children:[c.jsx(zt,{meta:Nn("basic"),children:c.jsxs("div",{className:"cw-form",children:[!tt&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["Agent 名称",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("input",{className:`cw-input ${ie(Le)}`,value:oe.name,placeholder:"customer_service",onChange:te=>X({name:te.target.value})}),l&&ue?c.jsx("span",{className:"cw-error-text",children:ue}):c.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在 Agent 结构中保持唯一。"})]}),c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["描述",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${ie(Qe)}`,value:oe.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:te=>X({description:te.target.value})}),l&&Qe?c.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):c.jsx("span",{className:"cw-help",children:"描述会显示在 Agent 列表与选择器中。"})]})]}),rt?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"cw-section-desc",children:"编排型 Agent 只负责调度子 Agent,不需要模型或系统提示词。请在左侧 「Agent 结构」中为它添加、排序子 Agent。"}),oe.agentType==="loop"&&c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"最大轮次"}),c.jsx("input",{className:"cw-input",type:"number",min:1,value:oe.maxIterations??3,onChange:te=>X({maxIterations:Math.max(1,Number(te.target.value)||1)})}),c.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):tt?c.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[c.jsxs("div",{className:"cw-remote-center-head",children:[c.jsx("div",{className:"cw-label",children:"AgentKit 智能体中心"}),c.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),c.jsx(bc,{env:XM,values:p3(oe.a2aRegistry,{includeDefaults:!1}),onChange:Oe}),l&&ln&&c.jsx("span",{className:"cw-error-text",children:"AgentKit 智能体中心 ID 为必填项"})]}):c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["系统提示词",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:c.jsx(Ute,{value:oe.instruction,invalid:on,onChange:te=>X({instruction:te})})}),l&&on?c.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):c.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!rt&&!tt&&c.jsxs(c.Fragment,{children:[c.jsx(zt,{meta:Nn("model"),children:c.jsxs("div",{className:"cw-form",children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"模型名称"}),c.jsx("input",{className:"cw-input",value:oe.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:te=>X({modelName:te.target.value})})]}),c.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":W,"aria-controls":we,onClick:()=>ae(te=>!te),children:[c.jsx("span",{children:"更多选项"}),c.jsx(or,{className:`cw-more-options-chevron ${W?"is-open":""}`,"aria-hidden":!0})]}),c.jsx($i,{initial:!1,children:W&&c.jsxs(Wt.div,{id:we,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"服务商 Provider"}),c.jsx("input",{className:"cw-input",value:oe.modelProvider??"",placeholder:"openai",onChange:te=>X({modelProvider:te.target.value})})]}),c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"API Base"}),c.jsx("input",{className:"cw-input",value:oe.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:te=>X({modelApiBase:te.target.value})}),c.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),c.jsx(zt,{meta:Nn("tools"),children:c.jsxs("div",{className:"cw-form",children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"内置工具"}),c.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),c.jsx("div",{className:"cw-tools-list-shell",children:c.jsx(uN,{items:Ox,selected:Xt,onToggle:Tn,scrollRows:6})})]}),c.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":he,"aria-controls":Tt,onClick:()=>Z(te=>!te),children:[c.jsx("span",{children:"更多类型工具"}),It.length>0&&c.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",It.length]}),c.jsx(or,{className:`cw-more-options-chevron ${he?"is-open":""}`,"aria-hidden":!0})]}),c.jsx($i,{initial:!1,children:he&&c.jsx(Wt.div,{id:Tt,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"MCP 工具"}),c.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),c.jsx(Wte,{tools:It,onChange:te=>X({mcpTools:te})})]})})})]})}),c.jsx(zt,{meta:Nn("skills"),children:c.jsx("div",{className:"cw-form",children:c.jsx(Gte,{selected:bt,onChange:te=>X({selectedSkills:te})})})}),c.jsx(zt,{meta:Nn("knowledge"),children:c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(Ec,{checked:oe.knowledgebase,onChange:te=>X({knowledgebase:te}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:ah}),oe.knowledgebase&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"知识库后端"}),c.jsx(w0,{options:Np,value:oe.knowledgebaseBackend,onChange:te=>X({knowledgebaseBackend:te})}),c.jsx(bc,{env:((st=Np.find(te=>te.id===(oe.knowledgebaseBackend??"local")))==null?void 0:st.env)??[],values:((An=a.deployment)==null?void 0:An.envValues)??{},onChange:le})]})]})}),_t&&c.jsxs("section",{ref:te=>{ve.current.advanced=te},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[c.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":ce,"aria-controls":ct,onClick:()=>Ce(te=>!te),children:[c.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),c.jsx(or,{className:`cw-advanced-disclosure-chevron ${ce?"is-open":""}`,"aria-hidden":!0}),$t>0&&c.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",$t]})]}),c.jsx($i,{initial:!1,children:ce&&c.jsxs(Wt.div,{id:ct,className:"cw-advanced-content",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-advanced-group",children:[c.jsx("div",{className:"cw-advanced-group-head",children:c.jsx("span",{children:"记忆"})}),c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(Ec,{checked:oe.memory.shortTerm,onChange:te=>X({memory:{...oe.memory,shortTerm:te}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:RI}),oe.memory.shortTerm&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"短期记忆后端"}),c.jsx(w0,{options:Tp,value:oe.shortTermBackend,onChange:te=>X({shortTermBackend:te})}),c.jsx(bc,{env:((jt=Tp.find(te=>te.id===(oe.shortTermBackend??"local")))==null?void 0:jt.env)??[],values:((Qt=a.deployment)==null?void 0:Qt.envValues)??{},onChange:le})]}),c.jsx(Ec,{checked:oe.memory.longTerm,onChange:te=>X({memory:{...oe.memory,longTerm:te}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:ah}),oe.memory.longTerm&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"长期记忆后端"}),c.jsx(w0,{options:kp,value:oe.longTermBackend,onChange:te=>X({longTermBackend:te})}),c.jsx(bc,{env:((Cn=kp.find(te=>te.id===(oe.longTermBackend??"local")))==null?void 0:Cn.env)??[],values:((jn=a.deployment)==null?void 0:jn.envValues)??{},onChange:le}),c.jsx(Ec,{checked:!!oe.autoSaveSession,onChange:te=>X({autoSaveSession:te}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:ah})]})]})]}),c.jsxs("div",{className:"cw-advanced-group",children:[c.jsx("div",{className:"cw-advanced-group-head",children:c.jsx("span",{children:"观测"})}),c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(Ec,{checked:oe.tracing,onChange:te=>X({tracing:te}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:kI}),oe.tracing&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),c.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),c.jsx(uN,{items:Sp,selected:Ge,onToggle:Ue}),c.jsx(bc,{env:Sp.filter(te=>Ge.includes(te.id)).flatMap(te=>te.env),values:((xn=a.deployment)==null?void 0:xn.envValues)??{},onChange:le})]})]})]})]})})]})]})]}),c.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:c.jsxs("ol",{className:"cw-steps",children:[c.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:c.jsx(Wt.div,{className:"cw-rail-fill",animate:{height:`${Math.max(kn,0)/Math.max(mn.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),mn.map(te=>{const Ne=te.id===J,Ie=yt[te.id];return c.jsx("li",{children:c.jsxs("button",{type:"button",className:`cw-step ${Ne?"is-active":""} ${Ie?"is-done":""}`,onClick:()=>Jn(te.id),"aria-current":Ne?"step":void 0,"aria-label":te.label,children:[c.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:Ne?c.jsx("span",{className:"cw-dot"}):Ie?c.jsx(Ds,{className:"cw-step-check"}):c.jsx("span",{className:"cw-dot"})}),c.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:te.label})]})},te.id)})]})})]})})})]}),c.jsx(rne,{enabled:E,disabledReason:y,phase:_,stale:qe,run:T,projectName:M||a.name,logs:Y,messages:U,input:L,error:j,deploying:m,deployError:de,onInput:O,onSend:vr,onRestart:er,onIgnoreChanges:()=>ne(Pe),onDeploy:Hn})]})})}function Fs(e){return{...Gi(),...e}}const ine=[{id:"support",icon:EF,draft:Fs({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:iF,draft:Fs({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:xF,draft:Fs({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:vE,draft:Fs({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:AF,draft:Fs({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:FF,draft:Fs({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Fs({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Fs({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Fs({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function ane(e){const t=[];return e.tools.length&&t.push({icon:CE,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:sF,label:"记忆"}),e.knowledgebase&&t.push({icon:rF,label:"知识库"}),e.tracing&&t.push({icon:tF,label:"观测"}),e.subAgents.length&&t.push({icon:LI,label:`子Agent ${e.subAgents.length}`}),t}function one({onBack:e,onCreate:t}){const[n,r]=v.useState(null);return c.jsx("div",{className:"tpl-root",children:n?c.jsx(cne,{template:n,onBack:()=>r(null),onCreate:t}):c.jsx(lne,{onPick:r})})}function lne({onPick:e}){return c.jsxs("div",{className:"tpl-scroll",children:[c.jsxs("div",{className:"tpl-head",children:[c.jsx("h1",{className:"tpl-title",children:"从模板新建"}),c.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),c.jsx("div",{className:"tpl-grid",children:ine.map((t,n)=>c.jsxs(Wt.button,{type:"button",className:"tpl-card",onClick:()=>e(t),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:n*.03,duration:.24,ease:[.22,1,.36,1]},children:[c.jsx("span",{className:"tpl-card-icon",children:c.jsx(t.icon,{className:"icon"})}),c.jsx("span",{className:"tpl-card-name",children:t.draft.name}),c.jsx("span",{className:"tpl-card-desc",children:Qr(t.draft.description)})]},t.id))})]})}function cne({template:e,onBack:t,onCreate:n}){const[r,s]=v.useState(e.draft.name),i=e.icon,a=ane(e.draft);function o(){const l=r.trim()||e.draft.name;n({...e.draft,name:l})}return c.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[c.jsxs("button",{className:"tpl-back",onClick:t,children:[c.jsx(bI,{className:"icon"})," 返回模板列表"]}),c.jsxs(Wt.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[c.jsxs("div",{className:"tpl-detail-head",children:[c.jsx("span",{className:"tpl-detail-icon",children:c.jsx(i,{className:"icon"})}),c.jsxs("div",{className:"tpl-detail-headtext",children:[c.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),c.jsx("div",{className:"tpl-detail-desc",children:Qr(e.draft.description)})]})]}),a.length>0&&c.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(l=>c.jsxs("span",{className:"tpl-tag",children:[c.jsx(l.icon,{className:"tpl-tag-icon"})," ",l.label]},l.label))}),c.jsxs("label",{className:"tpl-field",children:[c.jsx("span",{className:"tpl-field-label",children:"名称"}),c.jsx("input",{className:"tpl-input",value:r,onChange:l=>s(l.target.value),placeholder:e.draft.name})]}),c.jsxs("div",{className:"tpl-field",children:[c.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),c.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),c.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"模型"}),c.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"工具"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"记忆"}),c.jsx("span",{className:"tpl-meta-val",children:une(e.draft)})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"知识库"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&c.jsxs("div",{className:"tpl-field",children:[c.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),c.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((l,u)=>c.jsxs("div",{className:"tpl-subagent",children:[c.jsxs("div",{className:"tpl-subagent-top",children:[c.jsx("span",{className:"tpl-subagent-name",children:l.name}),l.tools.length>0&&c.jsx("span",{className:"tpl-subagent-tools",children:l.tools.join("、")})]}),c.jsx("div",{className:"tpl-subagent-desc",children:Qr(l.description)})]},u))})]}),c.jsxs("button",{className:"tpl-create",onClick:o,children:["使用此模板创建 ",c.jsx(or,{className:"icon"})]})]})]})}function une(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}function En(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Lm(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}wh.prototype=Lm.prototype={constructor:wh,on:function(e,t){var n=this._,r=fne(e+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(s),r=0,s,i;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),pN.hasOwnProperty(t)?{space:pN[t],local:e}:e}function pne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===M1&&t.documentElement.namespaceURI===M1?t.createElement(e):t.createElementNS(n,e)}}function mne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function w3(e){var t=Mm(e);return(t.local?mne:pne)(t)}function gne(){}function Dx(e){return e==null?gne:function(){return this.querySelector(e)}}function yne(e){typeof e!="function"&&(e=Dx(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=y&&(y=E+1);!(k=w[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Hne(e){e||(e=zne);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,s=new Array(r),i=0;it?1:e>=t?0:NaN}function Vne(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Kne(){return Array.from(this)}function Yne(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?rre:typeof t=="function"?ire:sre)(e,t,n??"")):_l(this.node(),e)}function _l(e,t){return e.style.getPropertyValue(t)||N3(e).getComputedStyle(e,null).getPropertyValue(t)}function ore(e){return function(){delete this[e]}}function lre(e,t){return function(){this[e]=t}}function cre(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ure(e,t){return arguments.length>1?this.each((t==null?ore:typeof t=="function"?cre:lre)(e,t)):this.node()[e]}function S3(e){return e.trim().split(/^|\s+/)}function Px(e){return e.classList||new A3(e)}function A3(e){this._node=e,this._names=S3(e.getAttribute("class")||"")}A3.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function C3(e,t){for(var n=Px(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Bre(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function D1(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}D1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function qre(e){return!e.ctrlKey&&!e.button}function Gre(){return this.parentNode}function Xre(e,t){return t??{x:e.x,y:e.y}}function Qre(){return navigator.maxTouchPoints||"ontouchstart"in this}function D3(){var e=qre,t=Gre,n=Xre,r=Qre,s={},i=Lm("start","drag","end"),a=0,o,l,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",g,Wre).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,k){if(!(d||!e.call(this,_,k))){var T=y(this,t.call(this,_,k),_,k,"mouse");T&&(Sr(_.view).on("mousemove.drag",m,zu).on("mouseup.drag",b,zu),L3(_.view),T0(_),u=!1,o=_.clientX,l=_.clientY,T("start",_))}}function m(_){if(nl(_),!u){var k=_.clientX-o,T=_.clientY-l;u=k*k+T*T>f}s.mouse("drag",_)}function b(_){Sr(_.view).on("mousemove.drag mouseup.drag",null),M3(_.view,u),nl(_),s.mouse("end",_)}function w(_,k){if(e.call(this,_,k)){var T=_.changedTouches,C=t.call(this,_,k),N=T.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Jre.exec(e))?new mr(t[1],t[2],t[3],1):(t=ese.exec(e))?new mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tse.exec(e))?Pf(t[1],t[2],t[3],t[4]):(t=nse.exec(e))?Pf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rse.exec(e))?wN(t[1],t[2]/100,t[3]/100,1):(t=sse.exec(e))?wN(t[1],t[2]/100,t[3]/100,t[4]):mN.hasOwnProperty(e)?bN(mN[e]):e==="transparent"?new mr(NaN,NaN,NaN,0):null}function bN(e){return new mr(e>>16&255,e>>8&255,e&255,1)}function Pf(e,t,n,r){return r<=0&&(e=t=n=NaN),new mr(e,t,n,r)}function ose(e){return e instanceof Rd||(e=Ya(e)),e?(e=e.rgb(),new mr(e.r,e.g,e.b,e.opacity)):new mr}function P1(e,t,n,r){return arguments.length===1?ose(e):new mr(e,t,n,r??1)}function mr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jx(mr,P1,P3(Rd,{brighter(e){return e=e==null?Ip:Math.pow(Ip,e),new mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vu:Math.pow(Vu,e),new mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mr(La(this.r),La(this.g),La(this.b),Rp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:EN,formatHex:EN,formatHex8:lse,formatRgb:xN,toString:xN}));function EN(){return`#${Na(this.r)}${Na(this.g)}${Na(this.b)}`}function lse(){return`#${Na(this.r)}${Na(this.g)}${Na(this.b)}${Na((isNaN(this.opacity)?1:this.opacity)*255)}`}function xN(){const e=Rp(this.opacity);return`${e===1?"rgb(":"rgba("}${La(this.r)}, ${La(this.g)}, ${La(this.b)}${e===1?")":`, ${e})`}`}function Rp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function La(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Na(e){return e=La(e),(e<16?"0":"")+e.toString(16)}function wN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new as(e,t,n,r)}function j3(e){if(e instanceof as)return new as(e.h,e.s,e.l,e.opacity);if(e instanceof Rd||(e=Ya(e)),!e)return new as;if(e instanceof as)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,o=i-s,l=(i+s)/2;return o?(t===i?a=(n-r)/o+(n0&&l<1?0:a,new as(a,o,l,e.opacity)}function cse(e,t,n,r){return arguments.length===1?j3(e):new as(e,t,n,r??1)}function as(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jx(as,cse,P3(Rd,{brighter(e){return e=e==null?Ip:Math.pow(Ip,e),new as(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vu:Math.pow(Vu,e),new as(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new mr(k0(e>=240?e-240:e+120,s,r),k0(e,s,r),k0(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new as(vN(this.h),jf(this.s),jf(this.l),Rp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Rp(this.opacity);return`${e===1?"hsl(":"hsla("}${vN(this.h)}, ${jf(this.s)*100}%, ${jf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vN(e){return e=(e||0)%360,e<0?e+360:e}function jf(e){return Math.max(0,Math.min(1,e||0))}function k0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Bx=e=>()=>e;function use(e,t){return function(n){return e+n*t}}function dse(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function fse(e){return(e=+e)==1?B3:function(t,n){return n-t?dse(t,n,e):Bx(isNaN(t)?n:t)}}function B3(e,t){var n=t-e;return n?use(e,n):Bx(isNaN(e)?t:e)}const Op=function e(t){var n=fse(t);function r(s,i){var a=n((s=P1(s)).r,(i=P1(i)).r),o=n(s.g,i.g),l=n(s.b,i.b),u=B3(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=o(d),s.b=l(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function hse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;sn&&(i=t.slice(n,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:Ns(r,s)})),n=N0.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:Ns(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function o(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:Ns(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function l(u,d,f,h,p,m){if(u!==f||d!==h){var b=p.push(s(p)+"scale(",null,",",null,")");m.push({i:b-4,x:Ns(u,f)},{i:b-2,x:Ns(d,h)})}else(f!==1||h!==1)&&p.push(s(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),o(u.skewX,d.skewX,f,h),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,b=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--Tl}function kN(){Wa=(Mp=Yu.now())+Dm,Tl=Oc=0;try{Ase()}finally{Tl=0,Ise(),Wa=0}}function Cse(){var e=Yu.now(),t=e-Mp;t>H3&&(Dm-=t,Mp=e)}function Ise(){for(var e,t=Lp,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Lp=n);Lc=e,F1(r)}function F1(e){if(!Tl){Oc&&(Oc=clearTimeout(Oc));var t=e-Wa;t>24?(e<1/0&&(Oc=setTimeout(kN,e-Yu.now()-Dm)),xc&&(xc=clearInterval(xc))):(xc||(Mp=Yu.now(),xc=setInterval(Cse,H3)),Tl=1,z3(kN))}}function NN(e,t,n){var r=new Dp;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var Rse=Lm("start","end","cancel","interrupt"),Ose=[],K3=0,SN=1,U1=2,_h=3,AN=4,$1=5,Th=6;function Pm(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Lse(e,n,{name:t,index:r,group:s,on:Rse,tween:Ose,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:K3})}function Ux(e,t){var n=bs(e,t);if(n.state>K3)throw new Error("too late; already scheduled");return n}function Bs(e,t){var n=bs(e,t);if(n.state>_h)throw new Error("too late; already running");return n}function bs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Lse(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=V3(i,0,n.time);function i(u){n.state=SN,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,p;if(n.state!==SN)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===_h)return NN(a);p.state===AN?(p.state=Th,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dU1&&r.state<$1,r.state=Th,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}i&&delete e.__transition}}function Mse(e){return this.each(function(){kh(this,e)})}function Dse(e,t){var n,r;return function(){var s=Bs(this,e),i=s.tween;if(i!==n){r=n=i;for(var a=0,o=r.length;a=0&&(t=t.slice(0,n)),!t||t==="start"})}function cie(e,t,n){var r,s,i=lie(t)?Ux:Bs;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(t,n),a.on=s}}function uie(e,t){var n=this._id;return arguments.length<2?bs(this.node(),n).on.on(e):this.each(cie(n,e,t))}function die(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function fie(){return this.on("end.remove",die(this._id))}function hie(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Dx(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function Bie(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Qs(e,t,n){this.k=e,this.x=t,this.y=n}Qs.prototype={constructor:Qs,scale:function(e){return e===1?this:new Qs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Qs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var jm=new Qs(1,0,0);G3.prototype=Qs.prototype;function G3(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jm;return e.__zoom}function S0(e){e.stopImmediatePropagation()}function wc(e){e.preventDefault(),e.stopImmediatePropagation()}function Fie(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Uie(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function CN(){return this.__zoom||jm}function $ie(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Hie(){return navigator.maxTouchPoints||"ontouchstart"in this}function zie(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function X3(){var e=Fie,t=Uie,n=zie,r=$ie,s=Hie,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=vh,u=Lm("start","zoom","end"),d,f,h,p=500,m=150,b=0,w=10;function g(P){P.property("__zoom",CN).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(P,U,A,L){var O=P.selection?P.selection():P;O.property("__zoom",CN),P!==O?k(P,U,A,L):O.interrupt().each(function(){T(this,arguments).event(L).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},g.scaleBy=function(P,U,A,L){g.scaleTo(P,function(){var O=this.__zoom.k,j=typeof U=="function"?U.apply(this,arguments):U;return O*j},A,L)},g.scaleTo=function(P,U,A,L){g.transform(P,function(){var O=t.apply(this,arguments),j=this.__zoom,S=A==null?_(O):typeof A=="function"?A.apply(this,arguments):A,H=j.invert(S),V=typeof U=="function"?U.apply(this,arguments):U;return n(y(E(j,V),S,H),O,a)},A,L)},g.translateBy=function(P,U,A,L){g.transform(P,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),a)},null,L)},g.translateTo=function(P,U,A,L,O){g.transform(P,function(){var j=t.apply(this,arguments),S=this.__zoom,H=L==null?_(j):typeof L=="function"?L.apply(this,arguments):L;return n(jm.translate(H[0],H[1]).scale(S.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof A=="function"?-A.apply(this,arguments):-A),j,a)},L,O)};function E(P,U){return U=Math.max(i[0],Math.min(i[1],U)),U===P.k?P:new Qs(U,P.x,P.y)}function y(P,U,A){var L=U[0]-A[0]*P.k,O=U[1]-A[1]*P.k;return L===P.x&&O===P.y?P:new Qs(P.k,L,O)}function _(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function k(P,U,A,L){P.on("start.zoom",function(){T(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(L).end()}).tween("zoom",function(){var O=this,j=arguments,S=T(O,j).event(L),H=t.apply(O,j),V=A==null?_(H):typeof A=="function"?A.apply(O,j):A,D=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),ne=O.__zoom,J=typeof U=="function"?U.apply(O,j):U,re=l(ne.invert(V).concat(D/ne.k),J.invert(V).concat(D/J.k));return function(de){if(de===1)de=J;else{var G=re(de),W=D/G[2];de=new Qs(W,V[0]-G[0]*W,V[1]-G[1]*W)}S.zoom(null,de)}})}function T(P,U,A){return!A&&P.__zooming||new C(P,U)}function C(P,U){this.that=P,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,U),this.taps=0}C.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,U){return this.mouse&&P!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var U=Sr(this.that).datum();u.call(P,this.that,new Bie(P,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),U)}};function N(P,...U){if(!e.apply(this,arguments))return;var A=T(this,U).event(P),L=this.__zoom,O=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,r.apply(this,arguments)))),j=ss(P);if(A.wheel)(A.mouse[0][0]!==j[0]||A.mouse[0][1]!==j[1])&&(A.mouse[1]=L.invert(A.mouse[0]=j)),clearTimeout(A.wheel);else{if(L.k===O)return;A.mouse=[j,L.invert(j)],kh(this),A.start()}wc(P),A.wheel=setTimeout(S,m),A.zoom("mouse",n(y(E(L,O),A.mouse[0],A.mouse[1]),A.extent,a));function S(){A.wheel=null,A.end()}}function R(P,...U){if(h||!e.apply(this,arguments))return;var A=P.currentTarget,L=T(this,U,!0).event(P),O=Sr(P.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",D,!0),j=ss(P,A),S=P.clientX,H=P.clientY;L3(P.view),S0(P),L.mouse=[j,this.__zoom.invert(j)],kh(this),L.start();function V(ne){if(wc(ne),!L.moved){var J=ne.clientX-S,re=ne.clientY-H;L.moved=J*J+re*re>b}L.event(ne).zoom("mouse",n(y(L.that.__zoom,L.mouse[0]=ss(ne,A),L.mouse[1]),L.extent,a))}function D(ne){O.on("mousemove.zoom mouseup.zoom",null),M3(ne.view,L.moved),wc(ne),L.event(ne).end()}}function I(P,...U){if(e.apply(this,arguments)){var A=this.__zoom,L=ss(P.changedTouches?P.changedTouches[0]:P,this),O=A.invert(L),j=A.k*(P.shiftKey?.5:2),S=n(y(E(A,j),L,O),t.apply(this,U),a);wc(P),o>0?Sr(this).transition().duration(o).call(k,S,L,P):Sr(this).call(g.transform,S,L,P)}}function M(P,...U){if(e.apply(this,arguments)){var A=P.touches,L=A.length,O=T(this,U,P.changedTouches.length===L).event(P),j,S,H,V;for(S0(P),S=0;S`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Wu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Q3=["Enter"," ","Escape"],Z3={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var kl;(function(e){e.Strict="strict",e.Loose="loose"})(kl||(kl={}));var Ma;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ma||(Ma={}));var qu;(function(e){e.Partial="partial",e.Full="full"})(qu||(qu={}));const J3={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ai;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ai||(Ai={}));var Gu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Gu||(Gu={}));var De;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(De||(De={}));const IN={[De.Left]:De.Right,[De.Right]:De.Left,[De.Top]:De.Bottom,[De.Bottom]:De.Top};function eD(e){return e===null?null:e?"valid":"invalid"}const tD=e=>"id"in e&&"source"in e&&"target"in e,Vie=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Hx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Od=(e,t=[0,0])=>{const{width:n,height:r}=fi(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Kie=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const i=typeof s=="string";let a=!t.nodeLookup&&!i?s:void 0;t.nodeLookup&&(a=i?t.nodeLookup.get(s):Hx(s)?s:t.nodeLookup.get(s.id));const o=a?Pp(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Bm(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Fm(n)},Ld=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Bm(n,Pp(s)),r=!0)}),r?Fm(n):{x:0,y:0,width:0,height:0}},zx=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const o={...Xl(t,[n,r,s]),width:t.width/s,height:t.height/s},l=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(a&&!f||h)continue;const p=d.width??u.width??u.initialWidth??null,m=d.height??u.height??u.initialHeight??null,b=Xu(o,Sl(u)),w=(p??0)*(m??0),g=i&&b>0;(!u.internals.handleBounds||g||b>=w||u.dragging)&&l.push(u)}return l},Yie=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Wie(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function qie({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=Wie(e,a),l=Ld(o),u=Kx(l,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function nD({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),o=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",ps.error005());else{const p=o.measured.width,m=o.measured.height;p&&m&&(f=[[l,u],[l+p,u+m]])}else o&&Ga(a.extent)&&(f=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const h=Ga(f)?qa(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",ps.error015())),{position:{x:h.x-l+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function Gie({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const i=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=i.has(h.id),m=!p&&h.parentId&&a.find(b=>b.id===h.parentId);(p||m)&&a.push(h)}const o=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=Yie(a,l);for(const h of l)o.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!s)return{edges:d,nodes:a};const f=await s({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Nl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),qa=(e={x:0,y:0},t,n)=>({x:Nl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Nl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function rD(e,t,n){const{width:r,height:s}=fi(n),{x:i,y:a}=n.internals.positionAbsolute;return qa(e,[[i,a],[i+r,a+s]],t)}const RN=(e,t,n)=>en?-Nl(Math.abs(e-n),1,t)/t:0,Vx=(e,t,n=15,r=40)=>{const s=RN(e.x,r,t.width-r)*n,i=RN(e.y,r,t.height-r)*n;return[s,i]},Bm=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),H1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Fm=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Sl=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:Od(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Pp=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:Od(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},sD=(e,t)=>Fm(Bm(H1(e),H1(t))),Xu=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},ON=e=>os(e.width)&&os(e.height)&&os(e.x)&&os(e.y),os=e=>!isNaN(e)&&isFinite(e),iD=(e,t)=>(n,r)=>{},Md=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Xl=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const o={x:(e-n)/s,y:(t-r)/s};return i?Md(o,a):o},Al=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function mo(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Xie(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=mo(e,n),s=mo(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=mo(e.top??e.y??0,n),s=mo(e.bottom??e.y??0,n),i=mo(e.left??e.x??0,t),a=mo(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Qie(e,t,n,r,s,i){const{x:a,y:o}=Al(e,[t,n,r]),{x:l,y:u}=Al({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=s-l,f=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(d),bottom:Math.floor(f)}}const Kx=(e,t,n,r,s,i)=>{const a=Xie(i,t,n),o=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(o,l),d=Nl(u,r,s),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,b=Qie(e,p,m,d,t,n),w={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Qu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ga(e){return e!=null&&e!=="parent"}function fi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function aD(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function oD(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*o[1]}return i}function LN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Zie(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Jie(e){return{...Z3,...e||{}}}function ou(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=ls(e),o=Xl({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=n?Md(o,t):o;return{xSnapped:l,ySnapped:u,...o}}const Yx=e=>({width:e.offsetWidth,height:e.offsetHeight}),lD=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},eae=["INPUT","SELECT","TEXTAREA"];function cD(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:eae.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const uD=e=>"clientX"in e,ls=(e,t)=>{var i,a;const n=uD(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},MN=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Yx(a)}})};function dD({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+o*.375+r*.125,d=Math.abs(l-e),f=Math.abs(u-t);return[l,u,d,f]}function Uf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function DN({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case De.Left:return[t-Uf(t-r,i),n];case De.Right:return[t+Uf(r-t,i),n];case De.Top:return[t,n-Uf(n-s,i)];case De.Bottom:return[t,n+Uf(s-n,i)]}}function fD({sourceX:e,sourceY:t,sourcePosition:n=De.Bottom,targetX:r,targetY:s,targetPosition:i=De.Top,curvature:a=.25}){const[o,l]=DN({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=DN({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=dD({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${l} ${u},${d} ${r},${s}`,f,h,p,m]}function hD({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const rae=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,sae=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),iae=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",ps.error006()),t;const r=n.getEdgeId||rae;let s;return tD(e)?s={...e}:s={...e,id:r(e)},sae(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function pD({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,o]=hD({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,o]}const PN={[De.Left]:{x:-1,y:0},[De.Right]:{x:1,y:0},[De.Top]:{x:0,y:-1},[De.Bottom]:{x:0,y:1}},aae=({source:e,sourcePosition:t=De.Bottom,target:n})=>t===De.Left||t===De.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function oae({source:e,sourcePosition:t=De.Bottom,target:n,targetPosition:r=De.Top,center:s,offset:i,stepPosition:a}){const o=PN[t],l=PN[r],u={x:e.x+o.x*i,y:e.y+o.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},f=aae({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],b,w;const g={x:0,y:0},E={x:0,y:0},[,,y,_]=hD({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*l[h]===-1){h==="x"?(b=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(b=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const N=[{x:b,y:u.y},{x:b,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];o[h]===p?m=h==="x"?N:R:m=h==="x"?R:N}else{const N=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=o.x===p?R:N:m=o.y===p?N:R,t===r){const P=Math.abs(e[h]-n[h]);if(P<=i){const U=Math.min(i-1,i-P);o[h]===p?g[h]=(u[h]>e[h]?-1:1)*U:E[h]=(d[h]>n[h]?-1:1)*U}}if(t!==r){const P=h==="x"?"y":"x",U=o[h]===l[P],A=u[P]>d[P],L=u[P]=Y?(b=(I.x+M.x)/2,w=m[0].y):(b=m[0].x,w=(I.y+M.y)/2)}const k={x:u.x+g.x,y:u.y+g.y},T={x:d.x+E.x,y:d.y+E.y};return[[e,...k.x!==m[0].x||k.y!==m[0].y?[k]:[],...m,...T.x!==m[m.length-1].x||T.y!==m[m.length-1].y?[T]:[],n],b,w,y,_]}function lae(e,t,n,r){const s=Math.min(jN(e,t)/2,jN(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function V1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function uae(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=V1(l,t);i.has(u)||(a.push({id:u,color:l.color||n,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const mD=1e3,dae=10,Wx={nodeOrigin:[0,0],nodeExtent:Wu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},fae={...Wx,checkEquality:!0};function qx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function hae(e,t,n){const r=qx(Wx,n);for(const s of e.values())if(s.parentId)Xx(s,e,t,r);else{const i=Od(s,r.nodeOrigin),a=Ga(s.extent)?s.extent:r.nodeExtent,o=qa(i,a,fi(s));s.internals.positionAbsolute=o}}function pae(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(i):s.type==="target"&&r.push(i)}return{source:n,target:r}}function Gx(e){return e==="manual"}function K1(e,t,n,r={}){var d,f;const s=qx(fae,r),i={i:0},a=new Map(t),o=s!=null&&s.elevateNodesOnSelect&&!Gx(s.zIndexMode)?mD:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(s.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const m=Od(h,s.nodeOrigin),b=Ga(h.extent)?h.extent:s.nodeExtent,w=qa(m,b,fi(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:pae(h,p),z:gD(h,o,s.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(l=!1),h.parentId&&Xx(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function mae(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Xx(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=qx(Wx,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mae(e,n),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*dae),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!Gx(l)?mD:0,{x:h,y:p,z:m}=gae(e,d,a,o,f,l),{positionAbsolute:b}=e.internals,w=h!==b.x||p!==b.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:b,z:m}})}function gD(e,t,n){const r=os(e.zIndex)?e.zIndex:0;return Gx(n)?r:r+(e.selected?t:0)}function gae(e,t,n,r,s,i){const{x:a,y:o}=t.internals.positionAbsolute,l=fi(e),u=Od(e,n),d=Ga(e.extent)?qa(u,e.extent,l):u;let f=qa({x:a+d.x,y:o+d.y},r,l);e.extent==="parent"&&(f=rD(f,l,t));const h=gD(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function Qx(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=t.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??Sl(l),d=sD(u,o.rect);i.set(o.parentId,{expandedRect:d,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const d=l.internals.positionAbsolute,f=fi(l),h=l.origin??r,p=o.x0||m>0||g||E)&&(s.push({id:u,type:"position",position:{x:l.position.x-p+g,y:l.position.y-m+E}}),(y=n.get(u))==null||y.forEach(_=>{e.some(k=>k.id===_.id)||s.push({id:_.id,type:"position",position:{x:_.position.x+p,y:_.position.y+m}})})),(f.width0){const p=Qx(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:l}}async function bae({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:i}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function $N(e,t,n,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(n,t)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(n,t))}}function yD(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,d=`${i}-${o}--${s}-${a}`;$N("source",l,d,e,s,a),$N("target",l,u,e,i,o),t.set(r.id,r)}}function bD(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:bD(n,t):!1}function HN(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Eae(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!bD(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function A0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,o,l;const s=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&s.push({...f,position:d.position,dragging:r})}if(!e)return[s[0],s];const i=(o=n.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=t.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function xae({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:n-s.distance.x,y:r-s.distance.y},a=Md(i,t);return{x:a.x-i.x,y:a.y-i.y}}function wae({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,b=null;function w({noDragClassName:E,handleSelector:y,domNode:_,isSelectable:k,nodeId:T,nodeClickDistance:C=0}){h=Sr(_);function N({x:B,y:Y}){const{nodeLookup:P,nodeExtent:U,snapGrid:A,snapToGrid:L,nodeOrigin:O,onNodeDrag:j,onSelectionDrag:S,onError:H,updateNodePositions:V}=t();i={x:B,y:Y};let D=!1;const ne=o.size>1,J=ne&&U?H1(Ld(o)):null,re=ne&&L?xae({dragItems:o,snapGrid:A,x:B,y:Y}):null;for(const[de,G]of o){if(!P.has(de))continue;let W={x:B-G.distance.x,y:Y-G.distance.y};L&&(W=re?{x:Math.round(W.x+re.x),y:Math.round(W.y+re.y)}:Md(W,A));let ae=null;if(ne&&U&&!G.extent&&J){const{positionAbsolute:ce}=G.internals,Ce=ce.x-J.x+U[0][0],Ee=ce.x+G.measured.width-J.x2+U[1][0],ge=ce.y-J.y+U[0][1],Me=ce.y+G.measured.height-J.y2+U[1][1];ae=[[Ce,ge],[Ee,Me]]}const{position:he,positionAbsolute:Z}=nD({nodeId:de,nextPosition:W,nodeLookup:P,nodeExtent:ae||U,nodeOrigin:O,onError:H});D=D||G.position.x!==he.x||G.position.y!==he.y,G.position=he,G.internals.positionAbsolute=Z}if(m=m||D,!!D&&(V(o,!0),b&&(r||j||!T&&S))){const[de,G]=A0({nodeId:T,dragItems:o,nodeLookup:P});r==null||r(b,o,de,G),j==null||j(b,de,G),T||S==null||S(b,G)}}async function R(){if(!d)return;const{transform:B,panBy:Y,autoPanSpeed:P,autoPanOnNodeDrag:U}=t();if(!U){l=!1,cancelAnimationFrame(a);return}const[A,L]=Vx(u,d,P);(A!==0||L!==0)&&(i.x=(i.x??0)-A/B[2],i.y=(i.y??0)-L/B[2],await Y({x:A,y:L})&&N(i)),a=requestAnimationFrame(R)}function I(B){var ne;const{nodeLookup:Y,multiSelectionActive:P,nodesDraggable:U,transform:A,snapGrid:L,snapToGrid:O,selectNodesOnDrag:j,onNodeDragStart:S,onSelectionDragStart:H,unselectNodesAndEdges:V}=t();f=!0,(!j||!k)&&!P&&T&&((ne=Y.get(T))!=null&&ne.selected||V()),k&&j&&T&&(e==null||e(T));const D=ou(B.sourceEvent,{transform:A,snapGrid:L,snapToGrid:O,containerBounds:d});if(i=D,o=Eae(Y,U,D,T),o.size>0&&(n||S||!T&&H)){const[J,re]=A0({nodeId:T,dragItems:o,nodeLookup:Y});n==null||n(B.sourceEvent,o,J,re),S==null||S(B.sourceEvent,J,re),T||H==null||H(B.sourceEvent,re)}}const M=D3().clickDistance(C).on("start",B=>{const{domNode:Y,nodeDragThreshold:P,transform:U,snapGrid:A,snapToGrid:L}=t();d=(Y==null?void 0:Y.getBoundingClientRect())||null,p=!1,m=!1,b=B.sourceEvent,P===0&&I(B),i=ou(B.sourceEvent,{transform:U,snapGrid:A,snapToGrid:L,containerBounds:d}),u=ls(B.sourceEvent,d)}).on("drag",B=>{const{autoPanOnNodeDrag:Y,transform:P,snapGrid:U,snapToGrid:A,nodeDragThreshold:L,nodeLookup:O}=t(),j=ou(B.sourceEvent,{transform:P,snapGrid:U,snapToGrid:A,containerBounds:d});if(b=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||T&&!O.has(T))&&(p=!0),!p){if(!l&&Y&&f&&(l=!0,R()),!f){const S=ls(B.sourceEvent,d),H=S.x-u.x,V=S.y-u.y;Math.sqrt(H*H+V*V)>L&&I(B)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&o&&f&&(u=ls(B.sourceEvent,d),N(j))}}).on("end",B=>{if(!f||p){p&&o.size>0&&t().updateNodePositions(o,!1);return}if(l=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:Y,updateNodePositions:P,onNodeDragStop:U,onSelectionDragStop:A}=t();if(m&&(P(o,!1),m=!1),s||U||!T&&A){const[L,O]=A0({nodeId:T,dragItems:o,nodeLookup:Y,dragging:!1});s==null||s(B.sourceEvent,o,L,O),U==null||U(B.sourceEvent,L,O),T||A==null||A(B.sourceEvent,O)}}}).filter(B=>{const Y=B.target;return!B.button&&(!E||!HN(Y,`.${E}`,_))&&(!y||HN(Y,y,_))});h.call(M)}function g(){h==null||h.on(".drag",null)}return{update:w,destroy:g}}function vae(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Xu(s,Sl(i))>0&&r.push(i);return r}const _ae=250;function Tae(e,t,n,r){var o,l;let s=[],i=1/0;const a=vae(e,n,t+_ae);for(const u of a){const d=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const f of d){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:p}=Xa(u,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m1){const u=r.type==="source"?"target":"source";return s.find(d=>d.type===u)??s[0]}return s[0]}function ED(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],l=(n?o==null?void 0:o.find(h=>h.id===n):o==null?void 0:o[0])??null;return l&&i?{...l,...Xa(a,l,l.position,!0)}:l}function xD(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function kae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const wD=()=>!0;function Nae(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:b,onConnectEnd:w,isValidConnection:g=wD,onReconnectEnd:E,updateConnection:y,getTransform:_,getFromHandle:k,autoPanSpeed:T,dragThreshold:C=1,handleDomNode:N}){const R=lD(e.target);let I=0,M;const{x:B,y:Y}=ls(e),P=xD(i,N),U=o==null?void 0:o.getBoundingClientRect();let A=!1;if(!U||!P)return;const L=ED(s,P,r,l,t);if(!L)return;let O=ls(e,U),j=!1,S=null,H=!1,V=null;function D(){if(!d||!U)return;const[he,Z]=Vx(O,U,T);h({x:he,y:Z}),I=requestAnimationFrame(D)}const ne={...L,nodeId:s,type:P,position:L.position},J=l.get(s);let de={inProgress:!0,isValid:null,from:Xa(J,ne,De.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:J,to:O,toHandle:null,toPosition:IN[ne.position],toNode:null,pointer:O};function G(){A=!0,y(de),m==null||m(e,{nodeId:s,handleId:r,handleType:P})}C===0&&G();function W(he){if(!A){const{x:Me,y:ve}=ls(he),$e=Me-B,Re=ve-Y;if(!($e*$e+Re*Re>C*C))return;G()}if(!k()||!ne){ae(he);return}const Z=_();O=ls(he,U),M=Tae(Xl(O,Z,!1,[1,1]),n,l,ne),j||(D(),j=!0);const ce=vD(he,{handle:M,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:g,doc:R,lib:u,flowId:f,nodeLookup:l});V=ce.handleDomNode,S=ce.connection,H=kae(!!M,ce.isValid);const Ce=l.get(s),Ee=Ce?Xa(Ce,ne,De.Left,!0):de.from,ge={...de,from:Ee,isValid:H,to:ce.toHandle&&H?Al({x:ce.toHandle.x,y:ce.toHandle.y},Z):O,toHandle:ce.toHandle,toPosition:H&&ce.toHandle?ce.toHandle.position:IN[ne.position],toNode:ce.toHandle?l.get(ce.toHandle.nodeId):null,pointer:O};y(ge),de=ge}function ae(he){if(!("touches"in he&&he.touches.length>0)){if(A){(M||V)&&S&&H&&(b==null||b(S));const{inProgress:Z,...ce}=de,Ce={...ce,toPosition:de.toHandle?de.toPosition:null};w==null||w(he,Ce),i&&(E==null||E(he,Ce))}p(),cancelAnimationFrame(I),j=!1,H=!1,S=null,V=null,R.removeEventListener("mousemove",W),R.removeEventListener("mouseup",ae),R.removeEventListener("touchmove",W),R.removeEventListener("touchend",ae)}}R.addEventListener("mousemove",W),R.addEventListener("mouseup",ae),R.addEventListener("touchmove",W),R.addEventListener("touchend",ae)}function vD(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=wD,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${o}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=ls(e),b=a.elementFromPoint(p,m),w=b!=null&&b.classList.contains(`${o}-flow__handle`)?b:h,g={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const E=xD(void 0,w),y=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),k=w.classList.contains("connectable"),T=w.classList.contains("connectableend");if(!y||!E)return g;const C={source:f?y:r,sourceHandle:f?_:s,target:f?r:y,targetHandle:f?s:_};g.connection=C;const R=k&&T&&(n===kl.Strict?f&&E==="source"||!f&&E==="target":y!==r||_!==s);g.isValid=R&&u(C),g.toHandle=ED(y,E,_,d,n,!0)}return g}const Y1={onPointerDown:Nae,isValid:vD};function Sae({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Sr(e);function i({translateExtent:o,width:l,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const _=n(),k=y.sourceEvent.ctrlKey&&Qu()?10:1,T=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*d,C=_[2]*Math.pow(2,T*k);t.scaleTo(C)};let b=[0,0];const w=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(b=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},g=y=>{const _=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const k=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],T=[k[0]-b[0],k[1]-b[1]];b=k;const C=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),N={x:_[0]-T[0]*C,y:_[1]-T[1]*C},R=[[0,0],[l,u]];t.setViewportConstrained({x:N.x,y:N.y,zoom:_[2]},R,o)},E=X3().on("start",w).on("zoom",f?g:null).on("zoom.wheel",h?m:null);s.call(E,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:ss}}const Um=e=>({x:e.x,y:e.y,zoom:e.k}),C0=({x:e,y:t,zoom:n})=>jm.translate(e,t).scale(n),zo=(e,t)=>e.target.closest(`.${t}`),_D=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Aae=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,I0=(e,t=0,n=Aae,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},TD=e=>{const t=e.ctrlKey&&Qu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Cae({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(zo(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=ss(d),g=TD(d),E=f*Math.pow(2,g);r.scaleTo(n,E,w,d);return}const h=d.deltaMode===1?20:1;let p=s===Ma.Vertical?0:d.deltaX*h,m=s===Ma.Horizontal?0:d.deltaY*h;!Qu()&&d.shiftKey&&s!==Ma.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const b=Um(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(d,b))}}function Iae({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,o=zo(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,s)}}function Rae({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Um(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Oae({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(n&&_D(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,Um(i.transform)))}}function Lae({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&_D(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=Um(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},n?150:0)}}}function Mae({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(zo(f,`${u}-flow__node`)||zo(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||zo(f,o)&&m||zo(f,l)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&b}}function Dae({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=X3().scaleExtent([t,n]).translateExtent(r),h=Sr(e).call(f);E({x:s.x,y:s.y,zoom:Nl(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(TD);async function b(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?au:vh).transform(I0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}function w({noWheelClassName:M,noPanClassName:B,onPaneContextMenu:Y,userSelectionActive:P,panOnScroll:U,panOnDrag:A,panOnScrollMode:L,panOnScrollSpeed:O,preventScrolling:j,zoomOnPinch:S,zoomOnScroll:H,zoomOnDoubleClick:V,zoomActivationKeyPressed:D,lib:ne,onTransformChange:J,connectionInProgress:re,paneClickDistance:de,selectionOnDrag:G}){P&&!u.isZoomingOrPanning&&g();const W=U&&!D&&!P;f.clickDistance(G?1/0:!os(de)||de<0?0:de);const ae=W?Cae({zoomPanValues:u,noWheelClassName:M,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:O,zoomOnPinch:S,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Iae({noWheelClassName:M,preventScrolling:j,d3ZoomHandler:p});h.on("wheel.zoom",ae,{passive:!1});const he=Rae({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});f.on("start",he);const Z=Oae({zoomPanValues:u,panOnDrag:A,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:J});f.on("zoom",Z);const ce=Lae({zoomPanValues:u,panOnDrag:A,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:o,onDraggingChange:l});f.on("end",ce);const Ce=Mae({zoomActivationKeyPressed:D,panOnDrag:A,zoomOnScroll:H,panOnScroll:U,zoomOnDoubleClick:V,zoomOnPinch:S,userSelectionActive:P,noPanClassName:B,noWheelClassName:M,lib:ne,connectionInProgress:re});f.filter(Ce),V?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function E(M,B,Y){const P=C0(M),U=f==null?void 0:f.constrain()(P,B,Y);return U&&await b(U),U}async function y(M,B){const Y=C0(M);return await b(Y,B),Y}function _(M){if(h){const B=C0(M),Y=h.property("__zoom");(Y.k!==M.zoom||Y.x!==M.x||Y.y!==M.y)&&(f==null||f.transform(h,B,null,{sync:!0}))}}function k(){const M=h?G3(h.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}async function T(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?au:vh).scaleTo(I0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}async function C(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?au:vh).scaleBy(I0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}function N(M){f==null||f.scaleExtent(M)}function R(M){f==null||f.translateExtent(M)}function I(M){const B=!os(M)||M<0?0:M;f==null||f.clickDistance(B)}return{update:w,destroy:g,setViewport:y,setViewportConstrained:E,getViewport:k,scaleTo:T,scaleBy:C,setScaleExtent:N,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var Cl;(function(e){e.Line="line",e.Handle="handle"})(Cl||(Cl={}));function Pae({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,o=n-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function zN(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function yi(e,t){return Math.max(0,t-e)}function bi(e,t){return Math.max(0,e-t)}function $f(e,t,n){return Math.max(0,t-e,e-n)}function VN(e,t){return e?!t:t}function jae(e,t,n,r,s,i,a,o){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:b,maxWidth:w,minHeight:g,maxHeight:E}=r,{x:y,y:_,width:k,height:T,aspectRatio:C}=e;let N=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=k+(l?-N:N),M=T+(u?-R:R),B=-i[0]*k,Y=-i[1]*T;let P=$f(I,b,w),U=$f(M,g,E);if(a){let O=0,j=0;l&&N<0?O=yi(y+N+B,a[0][0]):!l&&N>0&&(O=bi(y+I+B,a[1][0])),u&&R<0?j=yi(_+R+Y,a[0][1]):!u&&R>0&&(j=bi(_+M+Y,a[1][1])),P=Math.max(P,O),U=Math.max(U,j)}if(o){let O=0,j=0;l&&N>0?O=bi(y+N,o[0][0]):!l&&N<0&&(O=yi(y+I,o[1][0])),u&&R>0?j=bi(_+R,o[0][1]):!u&&R<0&&(j=yi(_+M,o[1][1])),P=Math.max(P,O),U=Math.max(U,j)}if(s){if(d){const O=$f(I/C,g,E)*C;if(P=Math.max(P,O),a){let j=0;!l&&!u||l&&!u&&h?j=bi(_+Y+I/C,a[1][1])*C:j=yi(_+Y+(l?N:-N)/C,a[0][1])*C,P=Math.max(P,j)}if(o){let j=0;!l&&!u||l&&!u&&h?j=yi(_+I/C,o[1][1])*C:j=bi(_+(l?N:-N)/C,o[0][1])*C,P=Math.max(P,j)}}if(f){const O=$f(M*C,b,w)/C;if(U=Math.max(U,O),a){let j=0;!l&&!u||u&&!l&&h?j=bi(y+M*C+B,a[1][0])/C:j=yi(y+(u?R:-R)*C+B,a[0][0])/C,U=Math.max(U,j)}if(o){let j=0;!l&&!u||u&&!l&&h?j=yi(y+M*C,o[1][0])/C:j=bi(y+(u?R:-R)*C,o[0][0])/C,U=Math.max(U,j)}}}R=R+(R<0?U:-U),N=N+(N<0?P:-P),s&&(h?I>M*C?R=(VN(l,u)?-N:N)/C:N=(VN(l,u)?-R:R)*C:d?(R=N/C,u=l):(N=R*C,l=u));const A=l?y+N:y,L=u?_+R:_;return{width:k+(l?-N:N),height:T+(u?-R:R),x:i[0]*N*(l?-1:1)+A,y:i[1]*R*(u?-1:1)+L}}const kD={width:0,height:0,x:0,y:0},Bae={...kD,pointerX:0,pointerY:0,aspectRatio:1};function Fae(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=n[0]*i,l=n[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function Uae({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=Sr(e);let a={controlDirection:zN("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:b,shouldResize:w}){let g={...kD},E={...Bae};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:zN(u)};let y,_=null,k=[],T,C,N,R=!1;const I=D3().on("start",M=>{const{nodeLookup:B,transform:Y,snapGrid:P,snapToGrid:U,nodeOrigin:A,paneDomNode:L}=n();if(y=B.get(t),!y)return;_=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:j}=ou(M.sourceEvent,{transform:Y,snapGrid:P,snapToGrid:U,containerBounds:_});g={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},E={...g,pointerX:O,pointerY:j,aspectRatio:g.width/g.height},T=void 0,C=Ga(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(T=B.get(y.parentId)),T&&y.extent==="parent"&&(C=[[0,0],[T.measured.width,T.measured.height]]),k=[],N=void 0;for(const[S,H]of B)if(H.parentId===t&&(k.push({id:S,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const V=Fae(H,y,H.origin??A);N?N=[[Math.min(V[0][0],N[0][0]),Math.min(V[0][1],N[0][1])],[Math.max(V[1][0],N[1][0]),Math.max(V[1][1],N[1][1])]]:N=V}p==null||p(M,{...g})}).on("drag",M=>{const{transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U}=n(),A=ou(M.sourceEvent,{transform:B,snapGrid:Y,snapToGrid:P,containerBounds:_}),L=[];if(!y)return;const{x:O,y:j,width:S,height:H}=g,V={},D=y.origin??U,{width:ne,height:J,x:re,y:de}=jae(E,a.controlDirection,A,a.boundaries,a.keepAspectRatio,D,C,N),G=ne!==S,W=J!==H,ae=re!==O&&G,he=de!==j&&W;if(!ae&&!he&&!G&&!W)return;if((ae||he||D[0]===1||D[1]===1)&&(V.x=ae?re:g.x,V.y=he?de:g.y,g.x=V.x,g.y=V.y,k.length>0)){const Ee=re-O,ge=de-j;for(const Me of k)Me.position={x:Me.position.x-Ee+D[0]*(ne-S),y:Me.position.y-ge+D[1]*(J-H)},L.push(Me)}if((G||W)&&(V.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:g.width,V.height=W&&(!a.resizeDirection||a.resizeDirection==="vertical")?J:g.height,g.width=V.width,g.height=V.height),T&&y.expandParent){const Ee=D[0]*(V.width??0);V.x&&V.x{R&&(b==null||b(M,{...g}),s==null||s({...g}),R=!1)});i.call(I)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}var ND={exports:{}},SD={},AD={exports:{}},CD={};/** +`);if(!n.length||n[0].trim()!=="---")throw new Vi(`${t} 的 SKILL.md 必须以 YAML frontmatter (--- ... ---) 开头`);let r=-1;for(let o=1;o=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function Ote(e,t){if(!e)throw new Vi(`${t} 的 SKILL.md 缺少必填的 name frontmatter`);if(e.length>64)throw new Vi(`${t} 的 name 长度超过 64 个字符`);if(!/^[a-z0-9-]+$/.test(e))throw new Vi(`${t} 的 name 必须匹配 [a-z0-9-]+(小写字母、数字、短横线)`)}function Lte(e,t){if(!e)throw new Vi(`${t} 的 SKILL.md 缺少必填的 description frontmatter`);if(e.length>1024)throw new Vi(`${t} 的 description 长度超过 1024 个字符`);if(/<[^>]+>/.test(e))throw new Vi(`${t} 的 description 不能包含 XML 标签`)}function f3(e){const t=e.map(r=>({path:r.path.replace(/\\/g,"/").replace(/^\.\//,""),text:r.text})).filter(r=>r.path.length>0&&!r.path.endsWith("/")),n=new Set(t.map(r=>r.path.split("/")[0]));if(n.size===1&&t.every(r=>r.path.includes("/"))){const r=[...n][0]+"/";return t.map(s=>({path:s.path.slice(r.length),text:s.text}))}return t}function Mte(e){const t=new Map,n=new Set;for(const r of e)if(M1.test("/"+r.path)){const s=r.path.split("/");n.add(s.slice(0,-1).join("/"))}for(const r of e){const s=r.path.split("/");let i="";for(let u=s.length-1;u>=0;u--){const d=s.slice(0,u).join("/");if(n.has(d)){i=d;break}}const a=M1.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const o=i?r.path.slice(i.length+1):r.path,l=t.get(i)||[];l.push({path:o,text:r.text}),t.set(i,l)}return t}function Dte(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(l=>M1.test("/"+l.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};let i;try{i=Ite(s.text,r)}catch(l){return{hit:null,error:l instanceof Error?l.message:String(l)}}const a=i.name,o=[];for(const l of t){if(l.path.split("/").some(f=>f===".."))return{hit:null,error:`${r} 包含非法路径(..):${l.path}`};const d=`skills/${a}/${l.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${r} 包含非法路径:${l.path}`};o.push({path:d,content:l.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:i.name,description:i.description,folder:a,localFiles:o},error:null}}async function Pte(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await kte(t)).map(s=>({path:s.name,text:s.text}));return h3(f3(r),e.name)}async function jte(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function Fte(e){const t=e.createReader(),n=[];for(;;){const r=await new Promise((s,i)=>t.readEntries(s,i));if(r.length===0)return n;n.push(...r)}}async function p3(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await Bte(e),path:n}];if(!e.isDirectory)return[];const r=await Fte(e);return(await Promise.all(r.map(s=>p3(s,n)))).flat()}function Ute({selected:e,onChange:t}){const[n,r]=v.useState([]),[s,i]=v.useState([]),[a,o]=v.useState(!1),[l,u]=v.useState(!1),d=v.useRef(0),f=b=>e.some(_=>_.source==="local"&&_.folder===b),h=b=>{b.localFiles&&(f(b.folder||b.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(b.folder||b.name)))):t([...e,{source:"local",folder:b.folder||b.name,name:b.name,description:b.description,localFiles:b.localFiles}]))},p=v.useRef([]),m=v.useRef(e);v.useEffect(()=>{p.current=s},[s]),v.useEffect(()=>{m.current=e},[e]);const y=b=>{const _=new Set([...p.current.map(k=>k.folder||k.name),...m.current.filter(k=>k.source==="local").map(k=>k.folder)]),N=[],T=[];for(const k of b.hits){const R=k.folder||k.name;if(_.has(R)){N.push(k.name);continue}_.add(R),T.push(k)}i(k=>[...k,...T]);const A=[...b.errors];if(N.length>0&&A.push(`已跳过重复技能:${N.join("、")}`),r(A),T.length===1&&b.errors.length===0&&N.length===0){const k=T[0];k.localFiles&&t([...m.current,{source:"local",folder:k.folder||k.name,name:k.name,description:k.description,localFiles:k.localFiles}])}},w=b=>{b.preventDefault(),d.current+=1,u(!0)},g=b=>{b.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},E=async b=>{if(b.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(b.dataTransfer.items).map(N=>{var T;return(T=N.webkitGetAsEntry)==null?void 0:T.call(N)}).filter(N=>N!==null);if(_.length===0){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}o(!0);try{const N=(await Promise.all(_.map(k=>p3(k)))).flat(),T=_.some(k=>k.isDirectory);if(!T&&N.length===1&&N[0].file.name.toLowerCase().endsWith(".zip")){y(await Pte(N[0].file));return}if(!T){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const A=new Map(N.map(({file:k,path:R})=>[k,R]));y(await jte(N.map(({file:k})=>k),A))}catch(N){r([`读取失败:${N instanceof Error?N.message:String(N)}`])}finally{o(!1)}};return c.jsxs("div",{className:"cw-local",children:[c.jsxs("div",{className:`cw-local-dropzone ${l?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:b=>b.preventDefault(),onDragLeave:g,onDrop:b=>void E(b),children:[c.jsx(SE,{className:"cw-local-drop-icon","aria-hidden":!0}),c.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),c.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md(含 name / description frontmatter)。支持包含多个技能的目录。"}),a&&c.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:n.join(";")})]}),s.length>0&&c.jsx("div",{className:"cw-skill-results",children:s.map(b=>{var N;const _=f(b.folder||b.name);return c.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(b),"aria-pressed":_,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(b.description)}),c.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((N=b.localFiles)==null?void 0:N.length)??0," 个文件"]})]})]},b.id)})})]})}function $te({selected:e,onChange:t}){const[n,r]=v.useState([]),[s,i]=v.useState([]),[a,o]=v.useState(""),[l,u]=v.useState(!0),[d,f]=v.useState(!1),[h,p]=v.useState(null);v.useEffect(()=>{let g=!1;return(async()=>{u(!0),p(null);try{const E=await hU();g||(r(E),E.length>0&&o(E[0].id))}catch(E){g||p(E instanceof Error?E.message:"加载失败")}finally{g||u(!1)}})(),()=>{g=!0}},[]),v.useEffect(()=>{if(!a){i([]);return}const g=n.find(b=>b.id===a);let E=!1;return(async()=>{f(!0),p(null);try{const b=await mU(a,g==null?void 0:g.region);E||i(b)}catch(b){E||p(b instanceof Error?b.message:"加载失败")}finally{E||f(!1)}})(),()=>{E=!0}},[a,n]);const m=n.find(g=>g.id===a),y=(g,E)=>e.some(b=>b.source==="skillspace"&&b.skillId===g&&(b.version||"")===E),w=g=>{if(m)if(y(g.skillId,g.version))t(e.filter(E=>!(E.source==="skillspace"&&E.skillId===g.skillId&&(E.version||"")===g.version)));else{const E=bU(m,g);t([...e,{source:"skillspace",folder:E.folder||g.skillName,name:E.name,description:E.description,skillSpaceId:E.skillSpaceId,skillSpaceName:E.skillSpaceName,skillSpaceRegion:E.skillSpaceRegion,skillId:E.skillId,version:E.version}])}};return c.jsx("div",{className:"cw-skillspace",children:l?c.jsxs("p",{className:"cw-empty-line",children:[c.jsx(bt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:h})]}):n.length===0?c.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"cw-skillspace-header",children:[c.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:g=>o(g.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(g=>c.jsxs("option",{value:g.id,children:[g.name||g.id,g.region?` [${g.region}]`:"",g.description?` — ${Zr(g.description)}`:""]},g.id))}),m&&c.jsx("a",{href:EU(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:c.jsx(kE,{className:"cw-i cw-i-sm"})})]}),d?c.jsxs("p",{className:"cw-empty-line",children:[c.jsx(bt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?c.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):c.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const E=y(g.skillId,g.version);return c.jsxs("button",{type:"button",className:`cw-skill-result ${E?"is-on":""}`,onClick:()=>w(g),"aria-pressed":E,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:E?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsxs("span",{className:"cw-skill-result-name",children:[g.skillName,g.version&&c.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",g.version]})]}),g.skillDescription&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(g.skillDescription)}),c.jsxs("span",{className:"cw-skill-result-repo",children:[c.jsx(dF,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${g.skillId}/${g.version}`)})})]})})}async function Hte(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ds(void 0,dd)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 AgentKit 智能体中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit 智能体中心");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function zte(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await Hte(`/web/a2a-spaces?${t.toString()}`)).items||[]}const Vte=v.lazy(()=>tl(()=>import("./MarkdownPromptEditor-CwT7JlSU.js"),__vite__mapDeps([0,1])));function Kte(e,t,n="text/plain"){const r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),s=document.createElement("a");s.href=r,s.download=e,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(r)}const lk=[{id:"type",label:"类型",hint:"选择 Agent 类型",icon:BF,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:Bl,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:NI},{id:"tools",label:"工具",hint:"可调用的能力",icon:CE},{id:"skills",label:"技能",hint:"声明式技能",icon:za},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:lh},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:OI},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:_I},{id:"review",label:"完成",hint:"预览并创建",icon:PF}];function Yte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m7.2 15.8 7.9-7.9a2 2 0 0 1 2.8 0l1.2 1.2a2 2 0 0 1 0 2.8l-7 7H8.7l-1.5-1.5a1.15 1.15 0 0 1 0-1.6Z"}),c.jsx("path",{d:"m12.7 10.3 4 4"}),c.jsx("path",{d:"M6.3 19h12.4"}),c.jsx("path",{d:"m5.5 8.2.5-1.4 1.4-.5L6 5.8l-.5-1.4L5 5.8l-1.4.5 1.4.5.5 1.4Z"})]})}function Wte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"3.25",y:"4.25",width:"17.5",height:"15.5",rx:"2.75"}),c.jsx("path",{d:"M3.75 8.75h16.5"}),c.jsx("circle",{cx:"6.35",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"8.85",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none",opacity:"0.45"}),c.jsx("path",{d:"M6 14h2.2l1.35-2.8 2.1 5.5 1.7-3.1H18"})]})}function qte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),c.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),c.jsx("path",{d:"M3 10v4",opacity:"0.45"}),c.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}const w0=4,Gte={llm:"LLM 智能体",sequential:"顺序型智能体",parallel:"并行型智能体",loop:"循环型智能体",a2a:"远程智能体"},ck={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},m3="REGISTRY_SPACE_ID",Xte=QM.filter(e=>e.key!==m3);function g3(e,t){var r,s,i;if(!(e!=null&&e.enabled))return{};const n={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(n.REGISTRY_TOP_K=((r=e.registryTopK)==null?void 0:r.trim())||hs.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||hs.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||hs.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function uk({items:e,selected:t,onToggle:n,scrollRows:r}){return c.jsx("div",{className:`cw-checklist ${r?"cw-checklist-tools":""}`,style:r?{"--cw-checklist-max-height":`${r*65+(r-1)*8}px`}:void 0,children:e.map(s=>{const i=t.includes(s.id);return c.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[c.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&c.jsx(Bs,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-check-text",children:[c.jsx("span",{className:"cw-check-title",children:s.label}),c.jsx("span",{className:"cw-check-desc",children:Zr(s.desc)})]})]},s.id)})})}function v0({options:e,value:t,onChange:n}){return c.jsx("div",{className:"cw-segmented",children:e.map(r=>{var i;const s=(t??((i=e[0])==null?void 0:i.id))===r.id;return c.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Zr(r.desc),children:[c.jsx("span",{className:"cw-seg-title",children:r.label}),c.jsx("span",{className:"cw-seg-desc",children:Zr(r.desc)})]},r.id)})})}function Qte(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function xc({env:e,values:t,onChange:n}){return e.length===0?c.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):c.jsx("div",{className:"cw-env-fields",children:e.map(r=>c.jsxs("label",{className:"cw-env-field",children:[c.jsxs("span",{className:"cw-env-field-head",children:[c.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&c.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&c.jsx("code",{title:r.key,children:r.key})]}),c.jsx("input",{className:"cw-input",type:Qte(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function dk(e){return e.name.trim()||"未命名智能体中心"}function Zte({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||hs.region,[i,a]=v.useState([]),[o,l]=v.useState(!1),[u,d]=v.useState(null),[f,h]=v.useState(0),[p,m]=v.useState(!1),y=v.useRef(null);v.useEffect(()=>{let N=!1;return l(!0),d(null),zte({region:s}).then(T=>{N||a(T)}).catch(T=>{N||(a([]),d(T instanceof Error?T.message:"加载失败"))}).finally(()=>{N||l(!1)}),()=>{N=!0}},[s,f]);const w=!e||i.some(N=>N.id===e.trim()),g=i.find(N=>N.id===e.trim()),E=g?dk(g):e&&!w?"已选择的智能体中心":"请选择智能体中心",b=o&&i.length===0;v.useEffect(()=>{if(!p)return;const N=A=>{const k=A.target;k instanceof Node&&y.current&&!y.current.contains(k)&&m(!1)},T=A=>{A.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",T)}},[p]);const _=N=>{r(N),m(!1)};return c.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[c.jsxs("div",{className:"cw-a2a-space-row",children:[c.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[c.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:b,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>m(N=>!N),children:[c.jsx("span",{children:E}),c.jsx(Xn,{className:"cw-a2a-space-trigger-icon","aria-hidden":!0})]}),p&&c.jsxs("div",{className:"cw-a2a-space-menu",role:"listbox","aria-label":"AgentKit 智能体中心",children:[c.jsx("button",{type:"button",role:"option","aria-selected":!e,className:`cw-a2a-space-option ${e?"":"is-selected"}`,onClick:()=>_(""),children:"请选择智能体中心"}),e&&!w&&c.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>_(e),children:"已选择的智能体中心"}),i.map(N=>{const T=dk(N),A=N.id===e;return c.jsx("button",{type:"button",role:"option","aria-selected":A,className:`cw-a2a-space-option ${A?"is-selected":""}`,title:T,onClick:()=>_(N.id),children:T},N.id)})]})]}),c.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:o,onClick:()=>h(N=>N+1),children:o?c.jsx(bt,{className:"cw-i cw-i-sm cw-spin"}):c.jsx(dm,{className:"cw-i cw-i-sm"})})]}),u?c.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:u})]}):o?c.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[c.jsx(bt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?c.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):c.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function Jte({tools:e,onChange:t}){const n=(i,a)=>t(e.map((o,l)=>l===i?{...o,...a}:o)),r=i=>t(e.filter((a,o)=>o!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return c.jsxs("div",{className:"cw-mcp",children:[e.length>0&&c.jsx("div",{className:"cw-mcp-list",children:c.jsx(Hi,{initial:!1,children:e.map((i,a)=>c.jsxs(Gt.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[c.jsxs("div",{className:"cw-mcp-rowhead",children:[c.jsxs("div",{className:"cw-mcp-transport",children:[c.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${i.transport==="http"?"is-on":""}`,onClick:()=>n(a,{transport:"http"}),"aria-pressed":i.transport==="http",children:c.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),c.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${i.transport==="stdio"?"is-on":""}`,onClick:()=>n(a,{transport:"stdio"}),"aria-pressed":i.transport==="stdio",children:c.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),c.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:c.jsx(Fl,{className:"cw-i cw-i-sm"})})]}),c.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:o=>n(a,{name:o.target.value})}),i.transport==="http"?c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:o=>n(a,{url:o.target.value})}),c.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:o=>n(a,{authToken:o.target.value})})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:o=>n(a,{command:o.target.value})}),c.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:o=>n(a,{args:o.target.value.split(/\s+/).filter(Boolean)})}),c.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),c.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[c.jsx(ms,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&c.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function y3({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),c.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),c.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),c.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function ene({s:e,onRemove:t}){let n=za,r="火山 Find Skill 技能广场";return e.source==="local"?(n=SE,r="本地"):e.source==="skillspace"&&(n=y3,r="AgentKit Skills 中心"),c.jsxs(Gt.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[c.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:c.jsx(n,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-selected-skill-meta",children:[c.jsx("span",{className:"cw-selected-skill-name",children:e.name}),c.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Zr(e.description)}`:""]})]}),c.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:c.jsx(Xr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const _0=[{id:"local",label:"本地文件",icon:SE},{id:"skillspace",label:"AgentKit Skills 中心",icon:y3},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:um}];function tne({selected:e,onChange:t}){const[n,r]=v.useState("local"),[s,i]=v.useState(!1),a=_0.findIndex(l=>l.id===n),o=l=>t(e.filter(u=>T0(u)!==l));return v.useEffect(()=>{if(!s)return;const l=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[s]),c.jsxs("div",{className:"cw-skillspane",children:[c.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[c.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:c.jsx(ms,{className:"cw-i"})}),c.jsx("span",{children:"添加 Skill"})]}),e.length>0&&c.jsxs("div",{className:"cw-skill-selected",children:[c.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),c.jsx("div",{className:"cw-selected-skill-list",children:c.jsx(Hi,{initial:!1,children:e.map(l=>c.jsx(ene,{s:l,onRemove:()=>o(T0(l))},T0(l)))})})]}),c.jsx(Hi,{children:s&&c.jsx(Gt.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:l=>{l.target===l.currentTarget&&i(!1)},children:c.jsxs(Gt.div,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"cw-skill-dialog-title",initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-skill-dialog-head",children:[c.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),c.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:c.jsx(Xr,{className:"cw-i"})})]}),c.jsxs("div",{className:"cw-skill-dialog-body",children:[c.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${_0.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[c.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),_0.map(({id:l,label:u,icon:d})=>c.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${l}`,"aria-controls":"cw-skill-tabpanel","aria-selected":n===l,className:`cw-skill-pickertab ${n===l?"is-on":""}`,onClick:()=>r(l),children:[c.jsx(d,{className:"cw-i cw-i-sm"}),u]},l))]}),c.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&c.jsx(Cte,{selected:e,onChange:t}),n==="local"&&c.jsx(Ute,{selected:e,onChange:t}),n==="skillspace"&&c.jsx($te,{selected:e,onChange:t})]})]})]})})})]})}function T0(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function wc({checked:e,onChange:t,title:n,desc:r,icon:s}){return c.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[c.jsx("span",{className:"cw-toggle-icon",children:c.jsx(s,{className:"cw-i"})}),c.jsxs("span",{className:"cw-toggle-text",children:[c.jsx("span",{className:"cw-toggle-title",children:n}),c.jsx("span",{className:"cw-toggle-desc",children:Zr(r)})]}),c.jsx("span",{className:"cw-switch","aria-hidden":!0,children:c.jsx(Gt.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}const fk=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]);function nne(e,t){var r;let n=e;for(const s of t)if(n=(r=n.subAgents)==null?void 0:r[s],!n)return!1;return!0}function wh(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Rd(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Rd(i[r],s,n),{...e,subAgents:i}}function rne(e,t){return Rd(e,t,n=>({...n,subAgents:[...n.subAgents,Xi()]}))}function sne(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Rd(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}function ine(e,t,n,r){return Rd(e,t,s=>{const i=s.subAgents.slice(),[a]=i.splice(n,1);return i.splice(r,0,a),{...s,subAgents:i}})}const ane=e=>e==="sequential"||e==="loop",b3=e=>!Id(e.agentType),one=3;function E3(e,t,n=!1){var s;if(Id(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const r=nl(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":a3(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function x3(e,t,n=[]){const r=[],s=Id(e.agentType),i=E3(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),b3(e)&&e.subAgents.forEach((a,o)=>r.push(...x3(a,t,[...n,o]))),r}function w3(e){return 1+e.subAgents.reduce((t,n)=>t+w3(n),0)}function lne(e){const t=[],n={},r=i=>{var a,o,l,u;for(const d of i.builtinTools??[]){const f=Ox.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:QM}),Object.assign(n,g3(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((o=kp.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:o.env)??[]}),i.memory.longTerm&&t.push({env:((l=Sp.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:l.env)??[]}),i.knowledgebase&&t.push({env:((u=Ap.find(d=>d.id===(i.knowledgebaseBackend??"local")))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=Cp.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=o3(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function v3({root:e,path:t,selectedPath:n,duplicateNames:r,showErrors:s,validationPulse:i,onSelect:a,onChange:o,onClearRoot:l}){const u=wh(e,t),d=Lx(u.agentType),f=d.icon,h=t.length===0,p=fk(t,n),m=b3(u),y=m&&t.length{const A=rne(e,t),k=wh(A,t).subAgents.length-1;o(A,[...t,k])},g=()=>o(sne(e,t),t.slice(0,-1)),E=t.slice(0,-1),b=!h&&ane(wh(e,E).agentType),[_,N]=v.useState(!1),T=A=>{A.preventDefault(),A.stopPropagation(),N(!1);const k=A.dataTransfer.getData("application/x-agent-path");if(!k)return;let R;try{R=JSON.parse(k)}catch{return}if(!fk(R.slice(0,-1),E))return;const I=R[R.length-1],M=t[t.length-1];I!==M&&o(ine(e,E,I,M),[...E,M])};return c.jsxs("div",{className:"cw-tree-branch",children:[c.jsxs("div",{className:`cw-tree-node cw-tree-type-${u.agentType??"llm"} ${p?"is-selected":""} ${b?"is-draggable":""} ${_?"is-dragover":""} ${s&&E3(u,r,h)?`is-invalid cw-error-shake-${i%2}`:""}`,role:"button",tabIndex:0,draggable:b,onDragStart:b?A=>{A.dataTransfer.setData("application/x-agent-path",JSON.stringify(t)),A.dataTransfer.effectAllowed="move",A.stopPropagation()}:void 0,onDragOver:b?A=>{A.preventDefault(),N(!0)}:void 0,onDragLeave:b?()=>N(!1):void 0,onDrop:b?T:void 0,onClick:()=>a(t),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),a(t))},children:[c.jsx(f,{className:"cw-tree-icon"}),c.jsxs("span",{className:"cw-tree-main",children:[c.jsx("span",{className:"cw-tree-name",children:Id(u.agentType)?"远程 Agent":u.name.trim()||"未命名"}),c.jsx("span",{className:"cw-tree-type",children:d.label})]}),c.jsxs("span",{className:"cw-tree-actions",children:[h&&c.jsx("button",{type:"button",className:"cw-icon-btn cw-tree-clear",title:"清空根 Agent","aria-label":"清空根 Agent",onClick:A=>{A.stopPropagation(),l()},children:c.jsx(Yte,{className:"cw-i cw-i-sm"})}),y&&c.jsx("button",{type:"button",className:"cw-icon-btn",title:"添加子 Agent",onClick:A=>{A.stopPropagation(),w()},children:c.jsx(ms,{className:"cw-i cw-i-sm"})}),!h&&c.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",title:"删除",onClick:A=>{A.stopPropagation(),g()},children:c.jsx(Fl,{className:"cw-i cw-i-sm"})})]})]}),m&&u.subAgents.length>0&&c.jsx("div",{className:"cw-tree-children",children:u.subAgents.map((A,k)=>c.jsx(v3,{root:e,path:[...t,k],selectedPath:n,duplicateNames:r,showErrors:s,validationPulse:i,onSelect:a,onChange:o,onClearRoot:l},k))})]})}function vh(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function hk(e){return JSON.stringify(vh(e))}function cne({enabled:e,disabledReason:t,phase:n,stale:r,run:s,projectName:i,logs:a,messages:o,input:l,error:u,deploying:d,deployError:f,onInput:h,onSend:p,onRestart:m,onIgnoreChanges:y,onDeploy:w}){const[g,E]=v.useState(!1),b=n==="ready"||n==="sending",_=n==="building"||n==="starting"||n==="sending",N=e&&!s&&n==="idle",T=e&&(n==="building"||n==="starting"),A=!!(s&&r&&!T);return g?c.jsx("aside",{className:"cw-debug is-collapsed","aria-label":"调试窗口(已收起)",children:c.jsx("button",{type:"button",className:"cw-debug-expand",onClick:()=>E(!1),"aria-label":"展开调试栏",title:"展开调试栏",children:c.jsx(Wte,{className:"cw-i"})})}):c.jsxs("aside",{className:"cw-debug","aria-label":"调试窗口",children:[c.jsxs("div",{className:"cw-debug-head",children:[c.jsxs("div",{className:"cw-debug-title",children:[c.jsx("button",{type:"button",className:"cw-debug-collapse",onClick:()=>E(!0),"aria-label":"收起调试栏",title:"收起调试栏",children:c.jsx(Xn,{className:"cw-i cw-i-sm"})}),c.jsx("span",{children:"调试"})]}),c.jsx("div",{className:"cw-debug-head-actions",children:c.jsxs("button",{type:"button",className:"cw-debug-deploy",disabled:d,onClick:w,title:"查看源码、填写环境变量并部署",children:["去部署",d?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(xI,{className:"cw-i"})]})})]}),!s&&n==="idle"&&!e&&c.jsx("div",{className:"cw-debug-sub",children:c.jsx("span",{children:t})}),f&&c.jsx("div",{className:"cw-debug-deploy-error",role:"alert",children:f}),c.jsxs("div",{className:"cw-debug-stage",children:[c.jsx("div",{className:"cw-debug-body",children:e?n==="error"?c.jsxs("div",{className:"cw-debug-error",children:[c.jsx(Ip,{message:u||"调试失败",className:"cw-debug-error-detail",onRetry:async()=>{await m()}}),a.length>0&&c.jsx("div",{className:"cw-debug-progress",children:a.map((k,R)=>c.jsx("div",{className:"cw-debug-logline",children:c.jsx("span",{children:k})},`${k}-${R}`))})]}):c.jsx("div",{className:"cw-debug-chat",children:o.length===0?c.jsx("div",{className:"cw-debug-chat-empty",children:"输入消息开始验证当前 Agent。"}):o.map((k,R)=>c.jsxs("div",{className:`cw-debug-msg cw-debug-msg-${k.role}`,children:[c.jsx("div",{className:"cw-debug-role",children:k.role==="user"?"你":i||"Agent"}),c.jsx("div",{className:"cw-debug-content",children:k.role==="user"?k.content:k.error?c.jsx(Ip,{message:k.error,className:"cw-debug-msg-error"}):k.blocks&&k.blocks.length>0?c.jsx(mx,{blocks:k.blocks,onAction:()=>{}}):k.content?k.content:R===o.length-1&&n==="sending"?c.jsx(dM,{}):null})]},R))}):c.jsx("div",{className:"cw-debug-empty",children:t})}),c.jsx("div",{className:"cw-debug-composer",children:c.jsxs("div",{className:"cw-debug-composerbox",children:[c.jsx("textarea",{className:"cw-debug-input",rows:1,value:l,placeholder:r?"更新 Agent 后可继续调试":b?"输入测试消息...":"调试环境启动后可输入",disabled:!b||_||r,onChange:k=>h(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),p())}}),c.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!b||_||r||!l.trim(),onClick:p,children:n==="sending"?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(wI,{className:"cw-i"})})]})}),(N||T||A)&&c.jsx("div",{className:"cw-debug-overlay",role:"status","aria-live":"polite",children:c.jsxs("div",{className:"cw-debug-overlay-content",children:[c.jsx("strong",{className:"cw-debug-overlay-title",children:T?"正在初始化调试环境":A?"Agent 配置已变更":"启动调试环境"}),T?c.jsx("div",{className:"cw-debug-overlay-progress",children:a.map((k,R)=>c.jsxs("div",{className:"cw-debug-logline",children:[R===a.length-1?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(Bs,{className:"cw-i"}),c.jsx("span",{children:k})]},`${k}-${R}`))}):A?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"cw-debug-overlay-copy",children:"当前对话仍在使用上一次配置。更新后,新配置才会生效。"}),c.jsxs("div",{className:"cw-debug-overlay-actions",children:[c.jsx("button",{type:"button",className:"cw-debug-ignore",disabled:_,onClick:y,children:"忽略"}),c.jsxs("button",{type:"button",className:"cw-debug-start",disabled:_,onClick:m,children:[c.jsx(dm,{className:"cw-i"}),"更新 Agent"]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"cw-debug-overlay-copy",children:"启动后会生成代码并创建临时运行环境。"}),c.jsxs("button",{type:"button",className:"cw-debug-start",onClick:m,children:[c.jsx(qte,{className:"cw-i cw-debug-run-icon"}),"启动调试环境"]})]})]})})]})]})}function une({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i}){var Pn,nr,zn,An,st,Cn,Bt,Jt,In,jn,wn,rr,Ot;const[a,o]=v.useState(()=>r??Xi()),[l,u]=v.useState(!1),[d,f]=v.useState(0),[h,p]=v.useState(null),[m,y]=v.useState(!1),[w,g]=v.useState("cn-beijing"),E=(s==null?void 0:s.generatedAgentTestRun)===!0,b=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[_,N]=v.useState("idle"),[T,A]=v.useState(null),k=v.useRef(null),[R,I]=v.useState(null),[M,B]=v.useState(""),[Y,P]=v.useState([]),[U,C]=v.useState([]),[L,O]=v.useState(""),[j,S]=v.useState(null),[H,V]=v.useState(""),[D,ne]=v.useState(""),[ee,re]=v.useState("basic"),[de,G]=v.useState(""),[W,oe]=v.useState(!1),[he,J]=v.useState(!1),[ce,Ce]=v.useState(!1),[Ee,ge]=v.useState([]),Le=v.useRef(null),ve=v.useRef({});v.useEffect(()=>()=>{const Z=k.current;Z&&s1(Z.runId).catch(ke=>console.warn("清理调试运行失败",ke))},[]);const Ue=v.useRef(null);Ue.current||(Ue.current=({meta:Z,children:ke})=>c.jsxs("section",{ref:Me=>{ve.current[Z.id]=Me},id:`cw-sec-${Z.id}`,"data-step-id":Z.id,className:"cw-section",children:[c.jsx("header",{className:"cw-sec-head",children:c.jsxs("h2",{className:"cw-sec-title",children:[Z.label,Z.required&&c.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),ke]}));const Ie=nne(a,Ee)?Ee:[],ae=wh(a,Ie),wt=Ie.length===0,we=`cw-model-advanced-${Ie.join("-")||"root"}`,vt=`cw-more-tool-types-${Ie.join("-")||"root"}`,ct=`cw-advanced-config-${Ie.join("-")||"root"}`,K=Math.max(0,Df.findIndex(Z=>Z.id===(ae.agentType??"llm"))),X=Z=>o(ke=>Rd(ke,Ie,Me=>({...Me,...Z}))),le=(Z,ke)=>o(Me=>{var He;return{...Me,deployment:{...Me.deployment??{feishuEnabled:!1},envValues:{...((He=Me.deployment)==null?void 0:He.envValues)??{},[Z]:ke}}}}),Ne=Z=>X({a2aRegistry:{...ae.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...Z}}),Re=(Z,ke)=>{if(!(Z in ck))return;const Me=ck[Z];Ne({[Me]:ke}),le(Z,ke)},ut=Z=>{if(!(wt&&Z==="a2a")){if(Z==="a2a"){X({agentType:Z,a2aRegistry:{...ae.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}X({agentType:Z,a2aRegistry:ae.a2aRegistry?{...ae.a2aRegistry,enabled:!1}:void 0})}},We=(Z,ke)=>{o(Z),ke&&ge(ke)},ot=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(o(Xi()),ge([]),u(!1),Ce(!1))},Zt=ae.builtinTools??[],Ct=ae.mcpTools??[],Ge=ae.tracingExporters??[],Et=ae.selectedSkills??[],Ht=[ae.memory.shortTerm,ae.memory.longTerm,ae.tracing].filter(Boolean).length,Nn=Z=>X({builtinTools:Zt.includes(Z)?Zt.filter(ke=>ke!==Z):[...Zt,Z]}),Fe=Z=>{const ke=Ge.includes(Z)?Ge.filter(Me=>Me!==Z):[...Ge,Z];X({tracingExporters:ke,tracing:ke.length>0?!0:ae.tracing})},rt=a3(ae.agentType),tt=Id(ae.agentType),mt=v.useMemo(()=>d3(a),[a]),ue=tt?null:nl(ae.name)??(mt.has(ae.name)?"Agent 名称在当前结构中必须唯一":null),Oe=ue!==null,Qe=!tt&&ae.description.trim().length===0,cn=ae.instruction.trim().length===0,an=tt&&!((Pn=ae.a2aRegistry)!=null&&Pn.registrySpaceId.trim()),ie=Z=>l&&Z?`is-error cw-error-shake-${d%2}`:"",_e=v.useMemo(()=>x3(a,mt),[a,mt]),ye=_e.length===0,Pe=v.useMemo(()=>hk(a),[a]),$e=v.useMemo(()=>lne(a),[a]),qe=!!(T&&H&&H!==Pe&&D!==Pe);v.useEffect(()=>{D&&D!==Pe&&ne("")},[Pe,D]);const gt=v.useMemo(()=>{var Z,ke,Me,He;return{type:!0,basic:tt?!an:!Oe&&(rt||!cn),model:!!((Z=ae.modelName)!=null&&Z.trim()||(ke=ae.modelProvider)!=null&&ke.trim()||(Me=ae.modelApiBase)!=null&&Me.trim()),tools:Zt.length>0||Ct.length>0,skills:Et.length>0,knowledge:ae.knowledgebase,advanced:ae.memory.shortTerm||ae.memory.longTerm||ae.tracing,subagents:(((He=ae.subAgents)==null?void 0:He.length)??0)>0,review:ye}},[ae,Oe,cn,rt,tt,ye,Zt,Ct,Et]),Rt=rt||tt?["basic"]:["basic","model","tools","skills","knowledge",...wt?["advanced"]:[]],gn=lk.filter(Z=>Rt.includes(Z.id)),yn=Rt.join("|"),zt=Ie.join("."),kn=gn.findIndex(Z=>Z.id===ee),er=Z=>{var ke;(ke=ve.current[Z])==null||ke.scrollIntoView({behavior:"smooth",block:"start"})};v.useEffect(()=>{if(h)return;const Z=Le.current;if(!Z)return;const ke=yn.split("|");let Me=0;const He=()=>{Me=0;const yt=ke[ke.length-1];let Kt=ke[0];if(Z.scrollTop+Z.clientHeight>=Z.scrollHeight-2)Kt=yt;else{const kt=Z.getBoundingClientRect().top+24;for(const fr of ke){const St=ve.current[fr];if(!St||St.getBoundingClientRect().top>kt)break;Kt=fr}}Kt&&re(kt=>kt===Kt?kt:Kt)},Lt=()=>{Me||(Me=window.requestAnimationFrame(He))};return He(),Z.addEventListener("scroll",Lt,{passive:!0}),window.addEventListener("resize",Lt),()=>{Z.removeEventListener("scroll",Lt),window.removeEventListener("resize",Lt),Me&&window.cancelAnimationFrame(Me)}},[h,yn,zt]);const _r=()=>ye?!0:(u(!0),f(Z=>Z+1),_e[0]&&(ge(_e[0].path),window.requestAnimationFrame(()=>er("basic"))),!1),Dn=async()=>{const Z=k.current;if(k.current=null,A(null),I(null),V(""),ne(""),Z)try{await s1(Z.runId)}catch(ke){console.warn("清理调试运行失败",ke)}},Hn=async()=>{if(G(""),!!_r()){y(!0);try{const Z=await fp(vh(a));await Dn(),N("idle"),B(""),P([]),C([]),O(""),S(null),p(Z)}catch(Z){G(`打开部署页失败:${Z instanceof Error?Z.message:String(Z)}`)}finally{y(!1)}}},tr=async()=>{if(!E||m||!_r())return;const Z=hk(a);ne(""),S(null),C([]),O(""),P([]),N("building");try{await Dn();const ke=[],Me=yt=>{ke.push(yt),P([...ke])};Me("提交 Agent 配置"),N("starting"),Me("初始化调试环境");const He=await rR(vh(a));k.current=He,A(He),B(He.appName),Me("创建调试会话");const Lt=await sR(He.runId,"test_user");I(Lt),V(Z),Me("调试环境就绪"),N("ready")}catch(ke){S(ke instanceof Error?ke.message:String(ke)),N("error")}},Tr=async()=>{const Z=k.current,ke=R,Me=L.trim();if(!(!Z||!ke||!Me||_==="sending")){O(""),N("sending"),C(He=>[...He,{role:"user",content:Me},{role:"assistant",content:"",blocks:[]}]);try{let He=Qs(),Lt="";for await(const yt of iR({runId:Z.runId,userId:"test_user",sessionId:ke,text:Me})){const Kt=yt.error||yt.errorMessage||yt.error_message;if(Kt){C(kt=>{const fr=[...kt],St=fr[fr.length-1];return(St==null?void 0:St.role)==="assistant"&&(St.error=String(Kt)),fr});break}He=ml(He,yt),Lt=He.blocks.filter(kt=>kt.kind==="text").map(kt=>kt.text).join(""),C(kt=>{const fr=[...kt],St=fr[fr.length-1];return(St==null?void 0:St.role)==="assistant"&&(St.content=Lt,St.blocks=He.blocks),fr})}N("ready")}catch(He){C(Lt=>{const yt=[...Lt],Kt=yt[yt.length-1];return(Kt==null?void 0:Kt.role)==="assistant"&&(Kt.error=He instanceof Error?He.message:String(He)),yt}),N("ready")}}};if(h){const Z=async(ke,Me,He)=>{var Kt;const Lt=(Kt=a.deployment)==null?void 0:Kt.network,yt=Lt&&Lt.mode&&Lt.mode!=="public"?{mode:Lt.mode,vpc_id:Lt.vpcId,subnet_ids:Lt.subnetIds,enable_shared_internet_access:Lt.enableSharedInternetAccess}:void 0;return LE(ke.name,ke.files,{region:w,projectName:"default",network:yt},{...He,onStage:Me})};return c.jsx("div",{className:"cw-root cw-root-preview",children:c.jsx("div",{className:"cw-preview-body",children:c.jsx(Mx,{project:h,agentDraft:a,agentName:a.name||"未命名 Agent",agentCount:w3(a),onChange:p,onDeploy:Z,onAgentAdded:n,onDeploymentTaskChange:i,feishuEnabled:!!((nr=a.deployment)!=null&&nr.feishuEnabled),onFeishuEnabledChange:async ke=>{const Me={...a,deployment:{...a.deployment??{feishuEnabled:!1},feishuEnabled:ke}},He=await fp(vh(Me));o(Me),p(He)},deploymentEnv:$e.specs,deploymentEnvValues:{...(zn=a.deployment)==null?void 0:zn.envValues,...$e.fixedValues},onDeploymentEnvChange:le,network:(An=a.deployment)==null?void 0:An.network,onNetworkChange:ke=>o(Me=>({...Me,deployment:{...Me.deployment??{feishuEnabled:!1},network:ke}})),deployRegion:w,onDeployRegionChange:g,onBack:()=>p(null),onExportYaml:()=>Kte(`${a.name||"agent"}.yaml`,Wee(a),"text/yaml")})})})}const Vt=Ue.current,Sn=Z=>lk.find(ke=>ke.id===Z);return c.jsx("div",{className:"cw-root",children:c.jsxs("div",{className:"cw-editor",children:[c.jsxs("aside",{className:"cw-tree","aria-label":"Agent 结构",children:[c.jsx("div",{className:"cw-tree-head",children:"Agent 结构"}),c.jsx(v3,{root:a,path:[],selectedPath:Ie,duplicateNames:mt,showErrors:l,validationPulse:d,onSelect:ge,onChange:We,onClearRoot:ot})]}),c.jsxs("div",{className:"cw-detail",children:[c.jsx("div",{className:"cw-typebar",children:c.jsx("div",{className:"cw-typebar-inner",children:c.jsxs("div",{className:"cw-typeradio cw-typeradio--row",role:"radiogroup","aria-label":"Agent 类型",style:{"--cw-agent-type-gap":`${w0}px`,"--cw-agent-type-slider-width":`calc((100% - ${8+w0*(Df.length-1)}px) / ${Df.length})`,"--cw-active-type-offset":`calc(${K*100}% + ${K*w0}px)`},children:[c.jsx("span",{className:"cw-typeradio-slider","aria-hidden":!0}),Df.map(Z=>{const ke=(ae.agentType??"llm")===Z.id,Me=wt&&Z.id==="a2a",He=Me?"cw-remote-agent-disabled-hint":void 0;return c.jsxs("label",{className:`cw-typeradio-item ${ke?"is-on":""} ${Me?"is-disabled":""}`,title:Me?void 0:Z.desc,tabIndex:Me?0:void 0,"aria-describedby":He,children:[c.jsx("input",{type:"radio",name:"agentType",className:"cw-typeradio-input",checked:ke,disabled:Me,onChange:()=>ut(Z.id)}),c.jsxs("span",{className:"cw-typeradio-title",children:[Gte[Z.id].replace("智能体",""),c.jsx("wbr",{}),"智能体"]}),Me&&c.jsx("span",{id:He,className:"cw-typeradio-disabled-hint",role:"tooltip",children:"远程 Agent 仅可作为子 Agent"})]},Z.id)})]})})}),c.jsx("div",{className:"cw-detail-scroll",ref:Le,children:c.jsx("div",{className:"cw-detail-inner",children:c.jsxs("div",{className:"cw-lower",children:[c.jsxs("div",{className:"cw-form-col",children:[c.jsx(Vt,{meta:Sn("basic"),children:c.jsxs("div",{className:"cw-form",children:[!tt&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["Agent 名称",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("input",{className:`cw-input ${ie(Oe)}`,value:ae.name,placeholder:"customer_service",onChange:Z=>X({name:Z.target.value})}),l&&ue?c.jsx("span",{className:"cw-error-text",children:ue}):c.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在 Agent 结构中保持唯一。"})]}),c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["描述",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${ie(Qe)}`,value:ae.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:Z=>X({description:Z.target.value})}),l&&Qe?c.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):c.jsx("span",{className:"cw-help",children:"描述会显示在 Agent 列表与选择器中。"})]})]}),rt?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"cw-section-desc",children:"编排型 Agent 只负责调度子 Agent,不需要模型或系统提示词。请在左侧 「Agent 结构」中为它添加、排序子 Agent。"}),ae.agentType==="loop"&&c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"最大轮次"}),c.jsx("input",{className:"cw-input",type:"number",min:1,value:ae.maxIterations??3,onChange:Z=>X({maxIterations:Math.max(1,Number(Z.target.value)||1)})}),c.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):tt?c.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[c.jsxs("div",{className:"cw-remote-center-head",children:[c.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),c.jsx(Zte,{value:((st=ae.a2aRegistry)==null?void 0:st.registrySpaceId)??"",region:((Cn=ae.a2aRegistry)==null?void 0:Cn.registryRegion)||hs.region,invalid:l&&an,onChange:Z=>Re(m3,Z)}),c.jsx(xc,{env:Xte,values:g3(ae.a2aRegistry,{includeDefaults:!1}),onChange:Re}),l&&an&&c.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["系统提示词",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:c.jsx(Vte,{value:ae.instruction,invalid:cn,onChange:Z=>X({instruction:Z})})}),l&&cn?c.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):c.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!rt&&!tt&&c.jsxs(c.Fragment,{children:[c.jsx(Vt,{meta:Sn("model"),children:c.jsxs("div",{className:"cw-form",children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"模型名称"}),c.jsx("input",{className:"cw-input",value:ae.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:Z=>X({modelName:Z.target.value})})]}),c.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":W,"aria-controls":we,onClick:()=>oe(Z=>!Z),children:[c.jsx("span",{children:"更多选项"}),c.jsx(Xn,{className:`cw-more-options-chevron ${W?"is-open":""}`,"aria-hidden":!0})]}),c.jsx(Hi,{initial:!1,children:W&&c.jsxs(Gt.div,{id:we,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"服务商 Provider"}),c.jsx("input",{className:"cw-input",value:ae.modelProvider??"",placeholder:"openai",onChange:Z=>X({modelProvider:Z.target.value})})]}),c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"API Base"}),c.jsx("input",{className:"cw-input",value:ae.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:Z=>X({modelApiBase:Z.target.value})}),c.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),c.jsx(Vt,{meta:Sn("tools"),children:c.jsxs("div",{className:"cw-form",children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"内置工具"}),c.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),c.jsx("div",{className:"cw-tools-list-shell",children:c.jsx(uk,{items:Ox,selected:Zt,onToggle:Nn,scrollRows:6})})]}),c.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":he,"aria-controls":vt,onClick:()=>J(Z=>!Z),children:[c.jsx("span",{children:"更多类型工具"}),Ct.length>0&&c.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",Ct.length]}),c.jsx(Xn,{className:`cw-more-options-chevron ${he?"is-open":""}`,"aria-hidden":!0})]}),c.jsx(Hi,{initial:!1,children:he&&c.jsx(Gt.div,{id:vt,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"MCP 工具"}),c.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),c.jsx(Jte,{tools:Ct,onChange:Z=>X({mcpTools:Z})})]})})})]})}),c.jsx(Vt,{meta:Sn("skills"),children:c.jsx("div",{className:"cw-form",children:c.jsx(tne,{selected:Et,onChange:Z=>X({selectedSkills:Z})})})}),c.jsx(Vt,{meta:Sn("knowledge"),children:c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.knowledgebase,onChange:Z=>X({knowledgebase:Z}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:lh}),ae.knowledgebase&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"知识库后端"}),c.jsx(v0,{options:Ap,value:ae.knowledgebaseBackend,onChange:Z=>X({knowledgebaseBackend:Z})}),c.jsx(xc,{env:((Bt=Ap.find(Z=>Z.id===(ae.knowledgebaseBackend??"local")))==null?void 0:Bt.env)??[],values:((Jt=a.deployment)==null?void 0:Jt.envValues)??{},onChange:le})]})]})}),wt&&c.jsxs("section",{ref:Z=>{ve.current.advanced=Z},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[c.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":ce,"aria-controls":ct,onClick:()=>Ce(Z=>!Z),children:[c.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),c.jsx(Xn,{className:`cw-advanced-disclosure-chevron ${ce?"is-open":""}`,"aria-hidden":!0}),Ht>0&&c.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",Ht]})]}),c.jsx(Hi,{initial:!1,children:ce&&c.jsxs(Gt.div,{id:ct,className:"cw-advanced-content",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-advanced-group",children:[c.jsx("div",{className:"cw-advanced-group-head",children:c.jsx("span",{children:"记忆"})}),c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.memory.shortTerm,onChange:Z=>X({memory:{...ae.memory,shortTerm:Z}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:OI}),ae.memory.shortTerm&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"短期记忆后端"}),c.jsx(v0,{options:kp,value:ae.shortTermBackend,onChange:Z=>X({shortTermBackend:Z})}),c.jsx(xc,{env:((In=kp.find(Z=>Z.id===(ae.shortTermBackend??"local")))==null?void 0:In.env)??[],values:((jn=a.deployment)==null?void 0:jn.envValues)??{},onChange:le})]}),c.jsx(wc,{checked:ae.memory.longTerm,onChange:Z=>X({memory:{...ae.memory,longTerm:Z}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:lh}),ae.memory.longTerm&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"长期记忆后端"}),c.jsx(v0,{options:Sp,value:ae.longTermBackend,onChange:Z=>X({longTermBackend:Z})}),c.jsx(xc,{env:((wn=Sp.find(Z=>Z.id===(ae.longTermBackend??"local")))==null?void 0:wn.env)??[],values:((rr=a.deployment)==null?void 0:rr.envValues)??{},onChange:le}),c.jsx(wc,{checked:!!ae.autoSaveSession,onChange:Z=>X({autoSaveSession:Z}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:lh})]})]})]}),c.jsxs("div",{className:"cw-advanced-group",children:[c.jsx("div",{className:"cw-advanced-group-head",children:c.jsx("span",{children:"观测"})}),c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.tracing,onChange:Z=>X({tracing:Z}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:kI}),ae.tracing&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),c.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),c.jsx(uk,{items:Cp,selected:Ge,onToggle:Fe}),c.jsx(xc,{env:Cp.filter(Z=>Ge.includes(Z.id)).flatMap(Z=>Z.env),values:((Ot=a.deployment)==null?void 0:Ot.envValues)??{},onChange:le})]})]})]})]})})]})]})]}),c.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:c.jsxs("ol",{className:"cw-steps",children:[c.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:c.jsx(Gt.div,{className:"cw-rail-fill",animate:{height:`${Math.max(kn,0)/Math.max(gn.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),gn.map(Z=>{const ke=Z.id===ee,Me=gt[Z.id];return c.jsx("li",{children:c.jsxs("button",{type:"button",className:`cw-step ${ke?"is-active":""} ${Me?"is-done":""}`,onClick:()=>er(Z.id),"aria-current":ke?"step":void 0,"aria-label":Z.label,children:[c.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:ke?c.jsx("span",{className:"cw-dot"}):Me?c.jsx(Bs,{className:"cw-step-check"}):c.jsx("span",{className:"cw-dot"})}),c.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:Z.label})]})},Z.id)})]})})]})})})]}),c.jsx(cne,{enabled:E,disabledReason:b,phase:_,stale:qe,run:T,projectName:M||a.name,logs:Y,messages:U,input:L,error:j,deploying:m,deployError:de,onInput:O,onSend:Tr,onRestart:tr,onIgnoreChanges:()=>ne(Pe),onDeploy:Hn})]})})}function Hs(e){return{...Xi(),...e}}const dne=[{id:"support",icon:wF,draft:Hs({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:oF,draft:Hs({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:vF,draft:Hs({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:_E,draft:Hs({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:IF,draft:Hs({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:$F,draft:Hs({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Hs({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Hs({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Hs({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function fne(e){const t=[];return e.tools.length&&t.push({icon:CE,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:aF,label:"记忆"}),e.knowledgebase&&t.push({icon:iF,label:"知识库"}),e.tracing&&t.push({icon:rF,label:"观测"}),e.subAgents.length&&t.push({icon:MI,label:`子Agent ${e.subAgents.length}`}),t}function hne({onBack:e,onCreate:t}){const[n,r]=v.useState(null);return c.jsx("div",{className:"tpl-root",children:n?c.jsx(mne,{template:n,onBack:()=>r(null),onCreate:t}):c.jsx(pne,{onPick:r})})}function pne({onPick:e}){return c.jsxs("div",{className:"tpl-scroll",children:[c.jsxs("div",{className:"tpl-head",children:[c.jsx("h1",{className:"tpl-title",children:"从模板新建"}),c.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),c.jsx("div",{className:"tpl-grid",children:dne.map((t,n)=>c.jsxs(Gt.button,{type:"button",className:"tpl-card",onClick:()=>e(t),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:n*.03,duration:.24,ease:[.22,1,.36,1]},children:[c.jsx("span",{className:"tpl-card-icon",children:c.jsx(t.icon,{className:"icon"})}),c.jsx("span",{className:"tpl-card-name",children:t.draft.name}),c.jsx("span",{className:"tpl-card-desc",children:Zr(t.draft.description)})]},t.id))})]})}function mne({template:e,onBack:t,onCreate:n}){const[r,s]=v.useState(e.draft.name),i=e.icon,a=fne(e.draft);function o(){const l=r.trim()||e.draft.name;n({...e.draft,name:l})}return c.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[c.jsxs("button",{className:"tpl-back",onClick:t,children:[c.jsx(EI,{className:"icon"})," 返回模板列表"]}),c.jsxs(Gt.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[c.jsxs("div",{className:"tpl-detail-head",children:[c.jsx("span",{className:"tpl-detail-icon",children:c.jsx(i,{className:"icon"})}),c.jsxs("div",{className:"tpl-detail-headtext",children:[c.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),c.jsx("div",{className:"tpl-detail-desc",children:Zr(e.draft.description)})]})]}),a.length>0&&c.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(l=>c.jsxs("span",{className:"tpl-tag",children:[c.jsx(l.icon,{className:"tpl-tag-icon"})," ",l.label]},l.label))}),c.jsxs("label",{className:"tpl-field",children:[c.jsx("span",{className:"tpl-field-label",children:"名称"}),c.jsx("input",{className:"tpl-input",value:r,onChange:l=>s(l.target.value),placeholder:e.draft.name})]}),c.jsxs("div",{className:"tpl-field",children:[c.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),c.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),c.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"模型"}),c.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"工具"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"记忆"}),c.jsx("span",{className:"tpl-meta-val",children:gne(e.draft)})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"知识库"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&c.jsxs("div",{className:"tpl-field",children:[c.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),c.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((l,u)=>c.jsxs("div",{className:"tpl-subagent",children:[c.jsxs("div",{className:"tpl-subagent-top",children:[c.jsx("span",{className:"tpl-subagent-name",children:l.name}),l.tools.length>0&&c.jsx("span",{className:"tpl-subagent-tools",children:l.tools.join("、")})]}),c.jsx("div",{className:"tpl-subagent-desc",children:Zr(l.description)})]},u))})]}),c.jsxs("button",{className:"tpl-create",onClick:o,children:["使用此模板创建 ",c.jsx(Xn,{className:"icon"})]})]})]})}function gne(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}function xn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Dm(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_h.prototype=Dm.prototype={constructor:_h,on:function(e,t){var n=this._,r=bne(e+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(s),r=0,s,i;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mk.hasOwnProperty(t)?{space:mk[t],local:e}:e}function xne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===D1&&t.documentElement.namespaceURI===D1?t.createElement(e):t.createElementNS(n,e)}}function wne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function _3(e){var t=Pm(e);return(t.local?wne:xne)(t)}function vne(){}function Dx(e){return e==null?vne:function(){return this.querySelector(e)}}function _ne(e){typeof e!="function"&&(e=Dx(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=b&&(b=E+1);!(N=w[b])&&++b=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function qne(e){e||(e=Gne);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,s=new Array(r),i=0;it?1:e>=t?0:NaN}function Xne(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Qne(){return Array.from(this)}function Zne(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?cre:typeof t=="function"?dre:ure)(e,t,n??"")):Tl(this.node(),e)}function Tl(e,t){return e.style.getPropertyValue(t)||A3(e).getComputedStyle(e,null).getPropertyValue(t)}function hre(e){return function(){delete this[e]}}function pre(e,t){return function(){this[e]=t}}function mre(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function gre(e,t){return arguments.length>1?this.each((t==null?hre:typeof t=="function"?mre:pre)(e,t)):this.node()[e]}function C3(e){return e.trim().split(/^|\s+/)}function Px(e){return e.classList||new I3(e)}function I3(e){this._node=e,this._names=C3(e.getAttribute("class")||"")}I3.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function R3(e,t){for(var n=Px(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Vre(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function P1(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}P1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ese(e){return!e.ctrlKey&&!e.button}function tse(){return this.parentNode}function nse(e,t){return t??{x:e.x,y:e.y}}function rse(){return navigator.maxTouchPoints||"ontouchstart"in this}function j3(){var e=ese,t=tse,n=nse,r=rse,s={},i=Dm("start","drag","end"),a=0,o,l,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",g,Jre).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,N){if(!(d||!e.call(this,_,N))){var T=b(this,t.call(this,_,N),_,N,"mouse");T&&(Ar(_.view).on("mousemove.drag",m,Ku).on("mouseup.drag",y,Ku),D3(_.view),N0(_),u=!1,o=_.clientX,l=_.clientY,T("start",_))}}function m(_){if(rl(_),!u){var N=_.clientX-o,T=_.clientY-l;u=N*N+T*T>f}s.mouse("drag",_)}function y(_){Ar(_.view).on("mousemove.drag mouseup.drag",null),P3(_.view,u),rl(_),s.mouse("end",_)}function w(_,N){if(e.call(this,_,N)){var T=_.changedTouches,A=t.call(this,_,N),k=T.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ise.exec(e))?new yr(t[1],t[2],t[3],1):(t=ase.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ose.exec(e))?Bf(t[1],t[2],t[3],t[4]):(t=lse.exec(e))?Bf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cse.exec(e))?vk(t[1],t[2]/100,t[3]/100,1):(t=use.exec(e))?vk(t[1],t[2]/100,t[3]/100,t[4]):gk.hasOwnProperty(e)?Ek(gk[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function Ek(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function Bf(e,t,n,r){return r<=0&&(e=t=n=NaN),new yr(e,t,n,r)}function hse(e){return e instanceof Ld||(e=Wa(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function j1(e,t,n,r){return arguments.length===1?hse(e):new yr(e,t,n,r??1)}function yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jx(yr,j1,B3(Ld,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Ma(this.r),Ma(this.g),Ma(this.b),Lp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xk,formatHex:xk,formatHex8:pse,formatRgb:wk,toString:wk}));function xk(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function pse(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function wk(){const e=Lp(this.opacity);return`${e===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${e===1?")":`, ${e})`}`}function Lp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ma(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sa(e){return e=Ma(e),(e<16?"0":"")+e.toString(16)}function vk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new os(e,t,n,r)}function F3(e){if(e instanceof os)return new os(e.h,e.s,e.l,e.opacity);if(e instanceof Ld||(e=Wa(e)),!e)return new os;if(e instanceof os)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,o=i-s,l=(i+s)/2;return o?(t===i?a=(n-r)/o+(n0&&l<1?0:a,new os(a,o,l,e.opacity)}function mse(e,t,n,r){return arguments.length===1?F3(e):new os(e,t,n,r??1)}function os(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jx(os,mse,B3(Ld,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new os(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new os(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new yr(k0(e>=240?e-240:e+120,s,r),k0(e,s,r),k0(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new os(_k(this.h),Ff(this.s),Ff(this.l),Lp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lp(this.opacity);return`${e===1?"hsl(":"hsla("}${_k(this.h)}, ${Ff(this.s)*100}%, ${Ff(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _k(e){return e=(e||0)%360,e<0?e+360:e}function Ff(e){return Math.max(0,Math.min(1,e||0))}function k0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Bx=e=>()=>e;function gse(e,t){return function(n){return e+n*t}}function yse(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function bse(e){return(e=+e)==1?U3:function(t,n){return n-t?yse(t,n,e):Bx(isNaN(t)?n:t)}}function U3(e,t){var n=t-e;return n?gse(e,n):Bx(isNaN(e)?t:e)}const Mp=function e(t){var n=bse(t);function r(s,i){var a=n((s=j1(s)).r,(i=j1(i)).r),o=n(s.g,i.g),l=n(s.b,i.b),u=U3(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=o(d),s.b=l(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Ese(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;sn&&(i=t.slice(n,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:As(r,s)})),n=S0.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:As(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function o(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:As(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function l(u,d,f,h,p,m){if(u!==f||d!==h){var y=p.push(s(p)+"scale(",null,",",null,")");m.push({i:y-4,x:As(u,f)},{i:y-2,x:As(d,h)})}else(f!==1||h!==1)&&p.push(s(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),o(u.skewX,d.skewX,f,h),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,y=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--Nl}function kk(){qa=(Pp=qu.now())+jm,Nl=Mc=0;try{Mse()}finally{Nl=0,Pse(),qa=0}}function Dse(){var e=qu.now(),t=e-Pp;t>V3&&(jm-=t,Pp=e)}function Pse(){for(var e,t=Dp,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Dp=n);Dc=e,U1(r)}function U1(e){if(!Nl){Mc&&(Mc=clearTimeout(Mc));var t=e-qa;t>24?(e<1/0&&(Mc=setTimeout(kk,e-qu.now()-jm)),vc&&(vc=clearInterval(vc))):(vc||(Pp=qu.now(),vc=setInterval(Dse,V3)),Nl=1,K3(kk))}}function Sk(e,t,n){var r=new jp;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var jse=Dm("start","end","cancel","interrupt"),Bse=[],W3=0,Ak=1,$1=2,Nh=3,Ck=4,H1=5,kh=6;function Bm(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Fse(e,n,{name:t,index:r,group:s,on:jse,tween:Bse,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:W3})}function Ux(e,t){var n=xs(e,t);if(n.state>W3)throw new Error("too late; already scheduled");return n}function $s(e,t){var n=xs(e,t);if(n.state>Nh)throw new Error("too late; already running");return n}function xs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Fse(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Y3(i,0,n.time);function i(u){n.state=Ak,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,p;if(n.state!==Ak)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===Nh)return Sk(a);p.state===Ck?(p.state=kh,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d$1&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function mie(e,t,n){var r,s,i=pie(t)?Ux:$s;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(t,n),a.on=s}}function gie(e,t){var n=this._id;return arguments.length<2?xs(this.node(),n).on.on(e):this.each(mie(n,e,t))}function yie(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function bie(){return this.on("end.remove",yie(this._id))}function Eie(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Dx(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function Vie(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function ei(e,t,n){this.k=e,this.x=t,this.y=n}ei.prototype={constructor:ei,scale:function(e){return e===1?this:new ei(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ei(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fm=new ei(1,0,0);Q3.prototype=ei.prototype;function Q3(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fm;return e.__zoom}function A0(e){e.stopImmediatePropagation()}function _c(e){e.preventDefault(),e.stopImmediatePropagation()}function Kie(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Yie(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ik(){return this.__zoom||Fm}function Wie(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qie(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gie(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Z3(){var e=Kie,t=Yie,n=Gie,r=Wie,s=qie,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=Th,u=Dm("start","zoom","end"),d,f,h,p=500,m=150,y=0,w=10;function g(P){P.property("__zoom",Ik).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(P,U,C,L){var O=P.selection?P.selection():P;O.property("__zoom",Ik),P!==O?N(P,U,C,L):O.interrupt().each(function(){T(this,arguments).event(L).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},g.scaleBy=function(P,U,C,L){g.scaleTo(P,function(){var O=this.__zoom.k,j=typeof U=="function"?U.apply(this,arguments):U;return O*j},C,L)},g.scaleTo=function(P,U,C,L){g.transform(P,function(){var O=t.apply(this,arguments),j=this.__zoom,S=C==null?_(O):typeof C=="function"?C.apply(this,arguments):C,H=j.invert(S),V=typeof U=="function"?U.apply(this,arguments):U;return n(b(E(j,V),S,H),O,a)},C,L)},g.translateBy=function(P,U,C,L){g.transform(P,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,L)},g.translateTo=function(P,U,C,L,O){g.transform(P,function(){var j=t.apply(this,arguments),S=this.__zoom,H=L==null?_(j):typeof L=="function"?L.apply(this,arguments):L;return n(Fm.translate(H[0],H[1]).scale(S.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof C=="function"?-C.apply(this,arguments):-C),j,a)},L,O)};function E(P,U){return U=Math.max(i[0],Math.min(i[1],U)),U===P.k?P:new ei(U,P.x,P.y)}function b(P,U,C){var L=U[0]-C[0]*P.k,O=U[1]-C[1]*P.k;return L===P.x&&O===P.y?P:new ei(P.k,L,O)}function _(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function N(P,U,C,L){P.on("start.zoom",function(){T(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(L).end()}).tween("zoom",function(){var O=this,j=arguments,S=T(O,j).event(L),H=t.apply(O,j),V=C==null?_(H):typeof C=="function"?C.apply(O,j):C,D=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),ne=O.__zoom,ee=typeof U=="function"?U.apply(O,j):U,re=l(ne.invert(V).concat(D/ne.k),ee.invert(V).concat(D/ee.k));return function(de){if(de===1)de=ee;else{var G=re(de),W=D/G[2];de=new ei(W,V[0]-G[0]*W,V[1]-G[1]*W)}S.zoom(null,de)}})}function T(P,U,C){return!C&&P.__zooming||new A(P,U)}function A(P,U){this.that=P,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,U),this.taps=0}A.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,U){return this.mouse&&P!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var U=Ar(this.that).datum();u.call(P,this.that,new Vie(P,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),U)}};function k(P,...U){if(!e.apply(this,arguments))return;var C=T(this,U).event(P),L=this.__zoom,O=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,r.apply(this,arguments)))),j=is(P);if(C.wheel)(C.mouse[0][0]!==j[0]||C.mouse[0][1]!==j[1])&&(C.mouse[1]=L.invert(C.mouse[0]=j)),clearTimeout(C.wheel);else{if(L.k===O)return;C.mouse=[j,L.invert(j)],Sh(this),C.start()}_c(P),C.wheel=setTimeout(S,m),C.zoom("mouse",n(b(E(L,O),C.mouse[0],C.mouse[1]),C.extent,a));function S(){C.wheel=null,C.end()}}function R(P,...U){if(h||!e.apply(this,arguments))return;var C=P.currentTarget,L=T(this,U,!0).event(P),O=Ar(P.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",D,!0),j=is(P,C),S=P.clientX,H=P.clientY;D3(P.view),A0(P),L.mouse=[j,this.__zoom.invert(j)],Sh(this),L.start();function V(ne){if(_c(ne),!L.moved){var ee=ne.clientX-S,re=ne.clientY-H;L.moved=ee*ee+re*re>y}L.event(ne).zoom("mouse",n(b(L.that.__zoom,L.mouse[0]=is(ne,C),L.mouse[1]),L.extent,a))}function D(ne){O.on("mousemove.zoom mouseup.zoom",null),P3(ne.view,L.moved),_c(ne),L.event(ne).end()}}function I(P,...U){if(e.apply(this,arguments)){var C=this.__zoom,L=is(P.changedTouches?P.changedTouches[0]:P,this),O=C.invert(L),j=C.k*(P.shiftKey?.5:2),S=n(b(E(C,j),L,O),t.apply(this,U),a);_c(P),o>0?Ar(this).transition().duration(o).call(N,S,L,P):Ar(this).call(g.transform,S,L,P)}}function M(P,...U){if(e.apply(this,arguments)){var C=P.touches,L=C.length,O=T(this,U,P.changedTouches.length===L).event(P),j,S,H,V;for(A0(P),S=0;S`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Gu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],J3=["Enter"," ","Escape"],eD={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var kl;(function(e){e.Strict="strict",e.Loose="loose"})(kl||(kl={}));var Da;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Da||(Da={}));var Xu;(function(e){e.Partial="partial",e.Full="full"})(Xu||(Xu={}));const tD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ci;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ci||(Ci={}));var Qu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Qu||(Qu={}));var De;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(De||(De={}));const Rk={[De.Left]:De.Right,[De.Right]:De.Left,[De.Top]:De.Bottom,[De.Bottom]:De.Top};function nD(e){return e===null?null:e?"valid":"invalid"}const rD=e=>"id"in e&&"source"in e&&"target"in e,Xie=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Hx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Md=(e,t=[0,0])=>{const{width:n,height:r}=hi(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Qie=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const i=typeof s=="string";let a=!t.nodeLookup&&!i?s:void 0;t.nodeLookup&&(a=i?t.nodeLookup.get(s):Hx(s)?s:t.nodeLookup.get(s.id));const o=a?Bp(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Um(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return $m(n)},Dd=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Um(n,Bp(s)),r=!0)}),r?$m(n):{x:0,y:0,width:0,height:0}},zx=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const o={...Zl(t,[n,r,s]),width:t.width/s,height:t.height/s},l=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(a&&!f||h)continue;const p=d.width??u.width??u.initialWidth??null,m=d.height??u.height??u.initialHeight??null,y=Zu(o,Al(u)),w=(p??0)*(m??0),g=i&&y>0;(!u.internals.handleBounds||g||y>=w||u.dragging)&&l.push(u)}return l},Zie=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Jie(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function eae({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=Jie(e,a),l=Dd(o),u=Kx(l,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function sD({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),o=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",gs.error005());else{const p=o.measured.width,m=o.measured.height;p&&m&&(f=[[l,u],[l+p,u+m]])}else o&&Xa(a.extent)&&(f=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const h=Xa(f)?Ga(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",gs.error015())),{position:{x:h.x-l+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function tae({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const i=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=i.has(h.id),m=!p&&h.parentId&&a.find(y=>y.id===h.parentId);(p||m)&&a.push(h)}const o=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=Zie(a,l);for(const h of l)o.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!s)return{edges:d,nodes:a};const f=await s({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Sl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ga=(e={x:0,y:0},t,n)=>({x:Sl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Sl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function iD(e,t,n){const{width:r,height:s}=hi(n),{x:i,y:a}=n.internals.positionAbsolute;return Ga(e,[[i,a],[i+r,a+s]],t)}const Ok=(e,t,n)=>en?-Sl(Math.abs(e-n),1,t)/t:0,Vx=(e,t,n=15,r=40)=>{const s=Ok(e.x,r,t.width-r)*n,i=Ok(e.y,r,t.height-r)*n;return[s,i]},Um=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),z1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),$m=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Al=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:Md(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Bp=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:Md(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},aD=(e,t)=>$m(Um(z1(e),z1(t))),Zu=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Lk=e=>ls(e.width)&&ls(e.height)&&ls(e.x)&&ls(e.y),ls=e=>!isNaN(e)&&isFinite(e),oD=(e,t)=>(n,r)=>{},Pd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zl=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const o={x:(e-n)/s,y:(t-r)/s};return i?Pd(o,a):o},Cl=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function go(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nae(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=go(e,n),s=go(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=go(e.top??e.y??0,n),s=go(e.bottom??e.y??0,n),i=go(e.left??e.x??0,t),a=go(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rae(e,t,n,r,s,i){const{x:a,y:o}=Cl(e,[t,n,r]),{x:l,y:u}=Cl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=s-l,f=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(d),bottom:Math.floor(f)}}const Kx=(e,t,n,r,s,i)=>{const a=nae(i,t,n),o=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(o,l),d=Sl(u,r,s),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,y=rae(e,p,m,d,t,n),w={left:Math.min(y.left-a.left,0),top:Math.min(y.top-a.top,0),right:Math.min(y.right-a.right,0),bottom:Math.min(y.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Ju=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Xa(e){return e!=null&&e!=="parent"}function hi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function lD(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function cD(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*o[1]}return i}function Mk(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function sae(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function iae(e){return{...eD,...e||{}}}function cu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=cs(e),o=Zl({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=n?Pd(o,t):o;return{xSnapped:l,ySnapped:u,...o}}const Yx=e=>({width:e.offsetWidth,height:e.offsetHeight}),uD=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aae=["INPUT","SELECT","TEXTAREA"];function dD(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:aae.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const fD=e=>"clientX"in e,cs=(e,t)=>{var i,a;const n=fD(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Dk=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Yx(a)}})};function hD({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+o*.375+r*.125,d=Math.abs(l-e),f=Math.abs(u-t);return[l,u,d,f]}function Hf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Pk({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case De.Left:return[t-Hf(t-r,i),n];case De.Right:return[t+Hf(r-t,i),n];case De.Top:return[t,n-Hf(n-s,i)];case De.Bottom:return[t,n+Hf(s-n,i)]}}function pD({sourceX:e,sourceY:t,sourcePosition:n=De.Bottom,targetX:r,targetY:s,targetPosition:i=De.Top,curvature:a=.25}){const[o,l]=Pk({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=Pk({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=hD({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${l} ${u},${d} ${r},${s}`,f,h,p,m]}function mD({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const cae=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,uae=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),dae=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",gs.error006()),t;const r=n.getEdgeId||cae;let s;return rD(e)?s={...e}:s={...e,id:r(e)},uae(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function gD({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,o]=mD({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,o]}const jk={[De.Left]:{x:-1,y:0},[De.Right]:{x:1,y:0},[De.Top]:{x:0,y:-1},[De.Bottom]:{x:0,y:1}},fae=({source:e,sourcePosition:t=De.Bottom,target:n})=>t===De.Left||t===De.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function hae({source:e,sourcePosition:t=De.Bottom,target:n,targetPosition:r=De.Top,center:s,offset:i,stepPosition:a}){const o=jk[t],l=jk[r],u={x:e.x+o.x*i,y:e.y+o.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},f=fae({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,w;const g={x:0,y:0},E={x:0,y:0},[,,b,_]=mD({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*l[h]===-1){h==="x"?(y=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(y=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const k=[{x:y,y:u.y},{x:y,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];o[h]===p?m=h==="x"?k:R:m=h==="x"?R:k}else{const k=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=o.x===p?R:k:m=o.y===p?k:R,t===r){const P=Math.abs(e[h]-n[h]);if(P<=i){const U=Math.min(i-1,i-P);o[h]===p?g[h]=(u[h]>e[h]?-1:1)*U:E[h]=(d[h]>n[h]?-1:1)*U}}if(t!==r){const P=h==="x"?"y":"x",U=o[h]===l[P],C=u[P]>d[P],L=u[P]=Y?(y=(I.x+M.x)/2,w=m[0].y):(y=m[0].x,w=(I.y+M.y)/2)}const N={x:u.x+g.x,y:u.y+g.y},T={x:d.x+E.x,y:d.y+E.y};return[[e,...N.x!==m[0].x||N.y!==m[0].y?[N]:[],...m,...T.x!==m[m.length-1].x||T.y!==m[m.length-1].y?[T]:[],n],y,w,b,_]}function pae(e,t,n,r){const s=Math.min(Bk(e,t)/2,Bk(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function K1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function gae(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=K1(l,t);i.has(u)||(a.push({id:u,color:l.color||n,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const yD=1e3,yae=10,Wx={nodeOrigin:[0,0],nodeExtent:Gu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},bae={...Wx,checkEquality:!0};function qx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Eae(e,t,n){const r=qx(Wx,n);for(const s of e.values())if(s.parentId)Xx(s,e,t,r);else{const i=Md(s,r.nodeOrigin),a=Xa(s.extent)?s.extent:r.nodeExtent,o=Ga(i,a,hi(s));s.internals.positionAbsolute=o}}function xae(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(i):s.type==="target"&&r.push(i)}return{source:n,target:r}}function Gx(e){return e==="manual"}function Y1(e,t,n,r={}){var d,f;const s=qx(bae,r),i={i:0},a=new Map(t),o=s!=null&&s.elevateNodesOnSelect&&!Gx(s.zIndexMode)?yD:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(s.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const m=Md(h,s.nodeOrigin),y=Xa(h.extent)?h.extent:s.nodeExtent,w=Ga(m,y,hi(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:xae(h,p),z:bD(h,o,s.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(l=!1),h.parentId&&Xx(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function wae(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Xx(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=qx(Wx,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}wae(e,n),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*yae),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!Gx(l)?yD:0,{x:h,y:p,z:m}=vae(e,d,a,o,f,l),{positionAbsolute:y}=e.internals,w=h!==y.x||p!==y.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:y,z:m}})}function bD(e,t,n){const r=ls(e.zIndex)?e.zIndex:0;return Gx(n)?r:r+(e.selected?t:0)}function vae(e,t,n,r,s,i){const{x:a,y:o}=t.internals.positionAbsolute,l=hi(e),u=Md(e,n),d=Xa(e.extent)?Ga(u,e.extent,l):u;let f=Ga({x:a+d.x,y:o+d.y},r,l);e.extent==="parent"&&(f=iD(f,l,t));const h=bD(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function Qx(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=t.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??Al(l),d=aD(u,o.rect);i.set(o.parentId,{expandedRect:d,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var b;const d=l.internals.positionAbsolute,f=hi(l),h=l.origin??r,p=o.x0||m>0||g||E)&&(s.push({id:u,type:"position",position:{x:l.position.x-p+g,y:l.position.y-m+E}}),(b=n.get(u))==null||b.forEach(_=>{e.some(N=>N.id===_.id)||s.push({id:_.id,type:"position",position:{x:_.position.x+p,y:_.position.y+m}})})),(f.width0){const p=Qx(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:l}}async function Tae({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:i}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function Hk(e,t,n,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(n,t)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(n,t))}}function ED(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,d=`${i}-${o}--${s}-${a}`;Hk("source",l,d,e,s,a),Hk("target",l,u,e,i,o),t.set(r.id,r)}}function xD(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:xD(n,t):!1}function zk(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Nae(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!xD(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function C0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,o,l;const s=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&s.push({...f,position:d.position,dragging:r})}if(!e)return[s[0],s];const i=(o=n.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=t.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function kae({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:n-s.distance.x,y:r-s.distance.y},a=Pd(i,t);return{x:a.x-i.x,y:a.y-i.y}}function Sae({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,y=null;function w({noDragClassName:E,handleSelector:b,domNode:_,isSelectable:N,nodeId:T,nodeClickDistance:A=0}){h=Ar(_);function k({x:B,y:Y}){const{nodeLookup:P,nodeExtent:U,snapGrid:C,snapToGrid:L,nodeOrigin:O,onNodeDrag:j,onSelectionDrag:S,onError:H,updateNodePositions:V}=t();i={x:B,y:Y};let D=!1;const ne=o.size>1,ee=ne&&U?z1(Dd(o)):null,re=ne&&L?kae({dragItems:o,snapGrid:C,x:B,y:Y}):null;for(const[de,G]of o){if(!P.has(de))continue;let W={x:B-G.distance.x,y:Y-G.distance.y};L&&(W=re?{x:Math.round(W.x+re.x),y:Math.round(W.y+re.y)}:Pd(W,C));let oe=null;if(ne&&U&&!G.extent&&ee){const{positionAbsolute:ce}=G.internals,Ce=ce.x-ee.x+U[0][0],Ee=ce.x+G.measured.width-ee.x2+U[1][0],ge=ce.y-ee.y+U[0][1],Le=ce.y+G.measured.height-ee.y2+U[1][1];oe=[[Ce,ge],[Ee,Le]]}const{position:he,positionAbsolute:J}=sD({nodeId:de,nextPosition:W,nodeLookup:P,nodeExtent:oe||U,nodeOrigin:O,onError:H});D=D||G.position.x!==he.x||G.position.y!==he.y,G.position=he,G.internals.positionAbsolute=J}if(m=m||D,!!D&&(V(o,!0),y&&(r||j||!T&&S))){const[de,G]=C0({nodeId:T,dragItems:o,nodeLookup:P});r==null||r(y,o,de,G),j==null||j(y,de,G),T||S==null||S(y,G)}}async function R(){if(!d)return;const{transform:B,panBy:Y,autoPanSpeed:P,autoPanOnNodeDrag:U}=t();if(!U){l=!1,cancelAnimationFrame(a);return}const[C,L]=Vx(u,d,P);(C!==0||L!==0)&&(i.x=(i.x??0)-C/B[2],i.y=(i.y??0)-L/B[2],await Y({x:C,y:L})&&k(i)),a=requestAnimationFrame(R)}function I(B){var ne;const{nodeLookup:Y,multiSelectionActive:P,nodesDraggable:U,transform:C,snapGrid:L,snapToGrid:O,selectNodesOnDrag:j,onNodeDragStart:S,onSelectionDragStart:H,unselectNodesAndEdges:V}=t();f=!0,(!j||!N)&&!P&&T&&((ne=Y.get(T))!=null&&ne.selected||V()),N&&j&&T&&(e==null||e(T));const D=cu(B.sourceEvent,{transform:C,snapGrid:L,snapToGrid:O,containerBounds:d});if(i=D,o=Nae(Y,U,D,T),o.size>0&&(n||S||!T&&H)){const[ee,re]=C0({nodeId:T,dragItems:o,nodeLookup:Y});n==null||n(B.sourceEvent,o,ee,re),S==null||S(B.sourceEvent,ee,re),T||H==null||H(B.sourceEvent,re)}}const M=j3().clickDistance(A).on("start",B=>{const{domNode:Y,nodeDragThreshold:P,transform:U,snapGrid:C,snapToGrid:L}=t();d=(Y==null?void 0:Y.getBoundingClientRect())||null,p=!1,m=!1,y=B.sourceEvent,P===0&&I(B),i=cu(B.sourceEvent,{transform:U,snapGrid:C,snapToGrid:L,containerBounds:d}),u=cs(B.sourceEvent,d)}).on("drag",B=>{const{autoPanOnNodeDrag:Y,transform:P,snapGrid:U,snapToGrid:C,nodeDragThreshold:L,nodeLookup:O}=t(),j=cu(B.sourceEvent,{transform:P,snapGrid:U,snapToGrid:C,containerBounds:d});if(y=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||T&&!O.has(T))&&(p=!0),!p){if(!l&&Y&&f&&(l=!0,R()),!f){const S=cs(B.sourceEvent,d),H=S.x-u.x,V=S.y-u.y;Math.sqrt(H*H+V*V)>L&&I(B)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&o&&f&&(u=cs(B.sourceEvent,d),k(j))}}).on("end",B=>{if(!f||p){p&&o.size>0&&t().updateNodePositions(o,!1);return}if(l=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:Y,updateNodePositions:P,onNodeDragStop:U,onSelectionDragStop:C}=t();if(m&&(P(o,!1),m=!1),s||U||!T&&C){const[L,O]=C0({nodeId:T,dragItems:o,nodeLookup:Y,dragging:!1});s==null||s(B.sourceEvent,o,L,O),U==null||U(B.sourceEvent,L,O),T||C==null||C(B.sourceEvent,O)}}}).filter(B=>{const Y=B.target;return!B.button&&(!E||!zk(Y,`.${E}`,_))&&(!b||zk(Y,b,_))});h.call(M)}function g(){h==null||h.on(".drag",null)}return{update:w,destroy:g}}function Aae(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Zu(s,Al(i))>0&&r.push(i);return r}const Cae=250;function Iae(e,t,n,r){var o,l;let s=[],i=1/0;const a=Aae(e,n,t+Cae);for(const u of a){const d=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const f of d){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:p}=Qa(u,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m1){const u=r.type==="source"?"target":"source";return s.find(d=>d.type===u)??s[0]}return s[0]}function wD(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],l=(n?o==null?void 0:o.find(h=>h.id===n):o==null?void 0:o[0])??null;return l&&i?{...l,...Qa(a,l,l.position,!0)}:l}function vD(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Rae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const _D=()=>!0;function Oae(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:y,onConnectEnd:w,isValidConnection:g=_D,onReconnectEnd:E,updateConnection:b,getTransform:_,getFromHandle:N,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:k}){const R=uD(e.target);let I=0,M;const{x:B,y:Y}=cs(e),P=vD(i,k),U=o==null?void 0:o.getBoundingClientRect();let C=!1;if(!U||!P)return;const L=wD(s,P,r,l,t);if(!L)return;let O=cs(e,U),j=!1,S=null,H=!1,V=null;function D(){if(!d||!U)return;const[he,J]=Vx(O,U,T);h({x:he,y:J}),I=requestAnimationFrame(D)}const ne={...L,nodeId:s,type:P,position:L.position},ee=l.get(s);let de={inProgress:!0,isValid:null,from:Qa(ee,ne,De.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:ee,to:O,toHandle:null,toPosition:Rk[ne.position],toNode:null,pointer:O};function G(){C=!0,b(de),m==null||m(e,{nodeId:s,handleId:r,handleType:P})}A===0&&G();function W(he){if(!C){const{x:Le,y:ve}=cs(he),Ue=Le-B,Ie=ve-Y;if(!(Ue*Ue+Ie*Ie>A*A))return;G()}if(!N()||!ne){oe(he);return}const J=_();O=cs(he,U),M=Iae(Zl(O,J,!1,[1,1]),n,l,ne),j||(D(),j=!0);const ce=TD(he,{handle:M,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:g,doc:R,lib:u,flowId:f,nodeLookup:l});V=ce.handleDomNode,S=ce.connection,H=Rae(!!M,ce.isValid);const Ce=l.get(s),Ee=Ce?Qa(Ce,ne,De.Left,!0):de.from,ge={...de,from:Ee,isValid:H,to:ce.toHandle&&H?Cl({x:ce.toHandle.x,y:ce.toHandle.y},J):O,toHandle:ce.toHandle,toPosition:H&&ce.toHandle?ce.toHandle.position:Rk[ne.position],toNode:ce.toHandle?l.get(ce.toHandle.nodeId):null,pointer:O};b(ge),de=ge}function oe(he){if(!("touches"in he&&he.touches.length>0)){if(C){(M||V)&&S&&H&&(y==null||y(S));const{inProgress:J,...ce}=de,Ce={...ce,toPosition:de.toHandle?de.toPosition:null};w==null||w(he,Ce),i&&(E==null||E(he,Ce))}p(),cancelAnimationFrame(I),j=!1,H=!1,S=null,V=null,R.removeEventListener("mousemove",W),R.removeEventListener("mouseup",oe),R.removeEventListener("touchmove",W),R.removeEventListener("touchend",oe)}}R.addEventListener("mousemove",W),R.addEventListener("mouseup",oe),R.addEventListener("touchmove",W),R.addEventListener("touchend",oe)}function TD(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=_D,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${o}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=cs(e),y=a.elementFromPoint(p,m),w=y!=null&&y.classList.contains(`${o}-flow__handle`)?y:h,g={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const E=vD(void 0,w),b=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),N=w.classList.contains("connectable"),T=w.classList.contains("connectableend");if(!b||!E)return g;const A={source:f?b:r,sourceHandle:f?_:s,target:f?r:b,targetHandle:f?s:_};g.connection=A;const R=N&&T&&(n===kl.Strict?f&&E==="source"||!f&&E==="target":b!==r||_!==s);g.isValid=R&&u(A),g.toHandle=wD(b,E,_,d,n,!0)}return g}const W1={onPointerDown:Oae,isValid:TD};function Lae({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Ar(e);function i({translateExtent:o,width:l,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const _=n(),N=b.sourceEvent.ctrlKey&&Ju()?10:1,T=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,A=_[2]*Math.pow(2,T*N);t.scaleTo(A)};let y=[0,0];const w=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(y=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},g=b=>{const _=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const N=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],T=[N[0]-y[0],N[1]-y[1]];y=N;const A=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),k={x:_[0]-T[0]*A,y:_[1]-T[1]*A},R=[[0,0],[l,u]];t.setViewportConstrained({x:k.x,y:k.y,zoom:_[2]},R,o)},E=Z3().on("start",w).on("zoom",f?g:null).on("zoom.wheel",h?m:null);s.call(E,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:is}}const Hm=e=>({x:e.x,y:e.y,zoom:e.k}),I0=({x:e,y:t,zoom:n})=>Fm.translate(e,t).scale(n),Vo=(e,t)=>e.target.closest(`.${t}`),ND=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Mae=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,R0=(e,t=0,n=Mae,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},kD=e=>{const t=e.ctrlKey&&Ju()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Dae({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Vo(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=is(d),g=kD(d),E=f*Math.pow(2,g);r.scaleTo(n,E,w,d);return}const h=d.deltaMode===1?20:1;let p=s===Da.Vertical?0:d.deltaX*h,m=s===Da.Horizontal?0:d.deltaY*h;!Ju()&&d.shiftKey&&s!==Da.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const y=Hm(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(d,y))}}function Pae({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,o=Vo(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,s)}}function jae({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Hm(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Bae({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(n&&ND(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,Hm(i.transform)))}}function Fae({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&ND(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=Hm(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},n?150:0)}}}function Uae({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Vo(f,`${u}-flow__node`)||Vo(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||Vo(f,o)&&m||Vo(f,l)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const y=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&y}}function $ae({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=Z3().scaleExtent([t,n]).translateExtent(r),h=Ar(e).call(f);E({x:s.x,y:s.y,zoom:Sl(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(kD);async function y(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).transform(R0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}function w({noWheelClassName:M,noPanClassName:B,onPaneContextMenu:Y,userSelectionActive:P,panOnScroll:U,panOnDrag:C,panOnScrollMode:L,panOnScrollSpeed:O,preventScrolling:j,zoomOnPinch:S,zoomOnScroll:H,zoomOnDoubleClick:V,zoomActivationKeyPressed:D,lib:ne,onTransformChange:ee,connectionInProgress:re,paneClickDistance:de,selectionOnDrag:G}){P&&!u.isZoomingOrPanning&&g();const W=U&&!D&&!P;f.clickDistance(G?1/0:!ls(de)||de<0?0:de);const oe=W?Dae({zoomPanValues:u,noWheelClassName:M,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:O,zoomOnPinch:S,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Pae({noWheelClassName:M,preventScrolling:j,d3ZoomHandler:p});h.on("wheel.zoom",oe,{passive:!1});const he=jae({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});f.on("start",he);const J=Bae({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:ee});f.on("zoom",J);const ce=Fae({zoomPanValues:u,panOnDrag:C,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:o,onDraggingChange:l});f.on("end",ce);const Ce=Uae({zoomActivationKeyPressed:D,panOnDrag:C,zoomOnScroll:H,panOnScroll:U,zoomOnDoubleClick:V,zoomOnPinch:S,userSelectionActive:P,noPanClassName:B,noWheelClassName:M,lib:ne,connectionInProgress:re});f.filter(Ce),V?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function E(M,B,Y){const P=I0(M),U=f==null?void 0:f.constrain()(P,B,Y);return U&&await y(U),U}async function b(M,B){const Y=I0(M);return await y(Y,B),Y}function _(M){if(h){const B=I0(M),Y=h.property("__zoom");(Y.k!==M.zoom||Y.x!==M.x||Y.y!==M.y)&&(f==null||f.transform(h,B,null,{sync:!0}))}}function N(){const M=h?Q3(h.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}async function T(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).scaleTo(R0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}async function A(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).scaleBy(R0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}function k(M){f==null||f.scaleExtent(M)}function R(M){f==null||f.translateExtent(M)}function I(M){const B=!ls(M)||M<0?0:M;f==null||f.clickDistance(B)}return{update:w,destroy:g,setViewport:b,setViewportConstrained:E,getViewport:N,scaleTo:T,scaleBy:A,setScaleExtent:k,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var Il;(function(e){e.Line="line",e.Handle="handle"})(Il||(Il={}));function Hae({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,o=n-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function Vk(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function bi(e,t){return Math.max(0,t-e)}function Ei(e,t){return Math.max(0,e-t)}function zf(e,t,n){return Math.max(0,t-e,e-n)}function Kk(e,t){return e?!t:t}function zae(e,t,n,r,s,i,a,o){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:y,maxWidth:w,minHeight:g,maxHeight:E}=r,{x:b,y:_,width:N,height:T,aspectRatio:A}=e;let k=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=N+(l?-k:k),M=T+(u?-R:R),B=-i[0]*N,Y=-i[1]*T;let P=zf(I,y,w),U=zf(M,g,E);if(a){let O=0,j=0;l&&k<0?O=bi(b+k+B,a[0][0]):!l&&k>0&&(O=Ei(b+I+B,a[1][0])),u&&R<0?j=bi(_+R+Y,a[0][1]):!u&&R>0&&(j=Ei(_+M+Y,a[1][1])),P=Math.max(P,O),U=Math.max(U,j)}if(o){let O=0,j=0;l&&k>0?O=Ei(b+k,o[0][0]):!l&&k<0&&(O=bi(b+I,o[1][0])),u&&R>0?j=Ei(_+R,o[0][1]):!u&&R<0&&(j=bi(_+M,o[1][1])),P=Math.max(P,O),U=Math.max(U,j)}if(s){if(d){const O=zf(I/A,g,E)*A;if(P=Math.max(P,O),a){let j=0;!l&&!u||l&&!u&&h?j=Ei(_+Y+I/A,a[1][1])*A:j=bi(_+Y+(l?k:-k)/A,a[0][1])*A,P=Math.max(P,j)}if(o){let j=0;!l&&!u||l&&!u&&h?j=bi(_+I/A,o[1][1])*A:j=Ei(_+(l?k:-k)/A,o[0][1])*A,P=Math.max(P,j)}}if(f){const O=zf(M*A,y,w)/A;if(U=Math.max(U,O),a){let j=0;!l&&!u||u&&!l&&h?j=Ei(b+M*A+B,a[1][0])/A:j=bi(b+(u?R:-R)*A+B,a[0][0])/A,U=Math.max(U,j)}if(o){let j=0;!l&&!u||u&&!l&&h?j=bi(b+M*A,o[1][0])/A:j=Ei(b+(u?R:-R)*A,o[0][0])/A,U=Math.max(U,j)}}}R=R+(R<0?U:-U),k=k+(k<0?P:-P),s&&(h?I>M*A?R=(Kk(l,u)?-k:k)/A:k=(Kk(l,u)?-R:R)*A:d?(R=k/A,u=l):(k=R*A,l=u));const C=l?b+k:b,L=u?_+R:_;return{width:N+(l?-k:k),height:T+(u?-R:R),x:i[0]*k*(l?-1:1)+C,y:i[1]*R*(u?-1:1)+L}}const SD={width:0,height:0,x:0,y:0},Vae={...SD,pointerX:0,pointerY:0,aspectRatio:1};function Kae(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=n[0]*i,l=n[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function Yae({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=Ar(e);let a={controlDirection:Vk("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:y,shouldResize:w}){let g={...SD},E={...Vae};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:Vk(u)};let b,_=null,N=[],T,A,k,R=!1;const I=j3().on("start",M=>{const{nodeLookup:B,transform:Y,snapGrid:P,snapToGrid:U,nodeOrigin:C,paneDomNode:L}=n();if(b=B.get(t),!b)return;_=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:j}=cu(M.sourceEvent,{transform:Y,snapGrid:P,snapToGrid:U,containerBounds:_});g={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},E={...g,pointerX:O,pointerY:j,aspectRatio:g.width/g.height},T=void 0,A=Xa(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(T=B.get(b.parentId)),T&&b.extent==="parent"&&(A=[[0,0],[T.measured.width,T.measured.height]]),N=[],k=void 0;for(const[S,H]of B)if(H.parentId===t&&(N.push({id:S,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const V=Kae(H,b,H.origin??C);k?k=[[Math.min(V[0][0],k[0][0]),Math.min(V[0][1],k[0][1])],[Math.max(V[1][0],k[1][0]),Math.max(V[1][1],k[1][1])]]:k=V}p==null||p(M,{...g})}).on("drag",M=>{const{transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U}=n(),C=cu(M.sourceEvent,{transform:B,snapGrid:Y,snapToGrid:P,containerBounds:_}),L=[];if(!b)return;const{x:O,y:j,width:S,height:H}=g,V={},D=b.origin??U,{width:ne,height:ee,x:re,y:de}=zae(E,a.controlDirection,C,a.boundaries,a.keepAspectRatio,D,A,k),G=ne!==S,W=ee!==H,oe=re!==O&&G,he=de!==j&&W;if(!oe&&!he&&!G&&!W)return;if((oe||he||D[0]===1||D[1]===1)&&(V.x=oe?re:g.x,V.y=he?de:g.y,g.x=V.x,g.y=V.y,N.length>0)){const Ee=re-O,ge=de-j;for(const Le of N)Le.position={x:Le.position.x-Ee+D[0]*(ne-S),y:Le.position.y-ge+D[1]*(ee-H)},L.push(Le)}if((G||W)&&(V.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:g.width,V.height=W&&(!a.resizeDirection||a.resizeDirection==="vertical")?ee:g.height,g.width=V.width,g.height=V.height),T&&b.expandParent){const Ee=D[0]*(V.width??0);V.x&&V.x{R&&(y==null||y(M,{...g}),s==null||s({...g}),R=!1)});i.call(I)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}var AD={exports:{}},CD={},ID={exports:{}},RD={};/** * @license React * use-sync-external-store-shim.production.js * @@ -675,7 +675,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Il=v;function $ae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Hae=typeof Object.is=="function"?Object.is:$ae,zae=Il.useState,Vae=Il.useEffect,Kae=Il.useLayoutEffect,Yae=Il.useDebugValue;function Wae(e,t){var n=t(),r=zae({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Kae(function(){s.value=n,s.getSnapshot=t,R0(s)&&i({inst:s})},[e,n,t]),Vae(function(){return R0(s)&&i({inst:s}),e(function(){R0(s)&&i({inst:s})})},[e]),Yae(n),n}function R0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hae(e,n)}catch{return!0}}function qae(e,t){return t()}var Gae=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qae:Wae;CD.useSyncExternalStore=Il.useSyncExternalStore!==void 0?Il.useSyncExternalStore:Gae;AD.exports=CD;var Xae=AD.exports;/** + */var Rl=v;function Wae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qae=typeof Object.is=="function"?Object.is:Wae,Gae=Rl.useState,Xae=Rl.useEffect,Qae=Rl.useLayoutEffect,Zae=Rl.useDebugValue;function Jae(e,t){var n=t(),r=Gae({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Qae(function(){s.value=n,s.getSnapshot=t,O0(s)&&i({inst:s})},[e,n,t]),Xae(function(){return O0(s)&&i({inst:s}),e(function(){O0(s)&&i({inst:s})})},[e]),Zae(n),n}function O0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qae(e,n)}catch{return!0}}function eoe(e,t){return t()}var toe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?eoe:Jae;RD.useSyncExternalStore=Rl.useSyncExternalStore!==void 0?Rl.useSyncExternalStore:toe;ID.exports=RD;var noe=ID.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -683,13 +683,13 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var $m=v,Qae=Xae;function Zae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jae=typeof Object.is=="function"?Object.is:Zae,eoe=Qae.useSyncExternalStore,toe=$m.useRef,noe=$m.useEffect,roe=$m.useMemo,soe=$m.useDebugValue;SD.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=toe(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=roe(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),s!==void 0&&a.hasValue){var m=a.value;if(s(m,p))return f=m}return f=p}if(m=f,Jae(d,p))return m;var b=r(p);return s!==void 0&&s(m,b)?(d=p,m):(d=p,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var o=eoe(e,i[0],i[1]);return noe(function(){a.hasValue=!0,a.value=o},[o]),soe(o),o};ND.exports=SD;var ioe=ND.exports;const aoe=Ju(ioe),ooe={},KN=e=>{let t;const n=new Set,r=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(ooe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,s,l);return l},loe=e=>e?KN(e):KN,{useDebugValue:coe}=et,{useSyncExternalStoreWithSelector:uoe}=aoe,doe=e=>e;function ID(e,t=doe,n){const r=uoe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return coe(r),r}const YN=(e,t)=>{const n=loe(e),r=(s,i=t)=>ID(n,s,i);return Object.assign(r,n),r},foe=(e,t)=>e?YN(e,t):YN;function qt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Hm=v.createContext(null),hoe=Hm.Provider,RD=ps.error001("react");function ft(e,t){const n=v.useContext(Hm);if(n===null)throw new Error(RD);return ID(n,e,t)}function Gt(){const e=v.useContext(Hm);if(e===null)throw new Error(RD);return v.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const WN={display:"none"},poe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},OD="react-flow__node-desc",LD="react-flow__edge-desc",moe="react-flow__aria-live",goe=e=>e.ariaLiveMessage,yoe=e=>e.ariaLabelConfig;function boe({rfId:e}){const t=ft(goe);return c.jsx("div",{id:`${moe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:poe,children:t})}function Eoe({rfId:e,disableKeyboardA11y:t}){const n=ft(yoe);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${OD}-${e}`,style:WN,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${LD}-${e}`,style:WN,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(boe,{rfId:e})]})}const zm=v.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return c.jsx("div",{className:En(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});zm.displayName="Panel";function xoe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(zm,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:c.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const woe=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Hf=e=>e.id;function voe(e,t){return qt(e.selectedNodes.map(Hf),t.selectedNodes.map(Hf))&&qt(e.selectedEdges.map(Hf),t.selectedEdges.map(Hf))}function _oe({onSelectionChange:e}){const t=Gt(),{selectedNodes:n,selectedEdges:r}=ft(woe,voe);return v.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const Toe=e=>!!e.onSelectionChangeHandlers;function koe({onSelectionChange:e}){const t=ft(Toe);return e||t?c.jsx(_oe,{onSelectionChange:e}):null}const MD=[0,0],Noe={x:0,y:0,zoom:1},Soe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],qN=[...Soe,"rfId"],Aoe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),GN={translateExtent:Wu,nodeOrigin:MD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Coe(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=ft(Aoe,qt),u=Gt();v.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=GN,o()}),[]);const d=v.useRef(GN);return v.useEffect(()=>{for(const f of qN){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?s(h):f==="translateExtent"?i(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Jie(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},qN.map(f=>e[f])),null}function XN(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Ioe(e){var r;const[t,n]=v.useState(e==="system"?null:e);return v.useEffect(()=>{if(e!=="system"){n(e);return}const s=XN(),i=()=>n(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),t!==null?t:(r=XN())!=null&&r.matches?"dark":"light"}const QN=typeof document<"u"?document:null;function Zu(e=null,t={target:QN,actInsideInputWithModifier:!0}){const[n,r]=v.useState(!1),s=v.useRef(!1),i=v.useRef(new Set([])),[a,o]=v.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` + */var zm=v,roe=noe;function soe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ioe=typeof Object.is=="function"?Object.is:soe,aoe=roe.useSyncExternalStore,ooe=zm.useRef,loe=zm.useEffect,coe=zm.useMemo,uoe=zm.useDebugValue;CD.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=ooe(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=coe(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),s!==void 0&&a.hasValue){var m=a.value;if(s(m,p))return f=m}return f=p}if(m=f,ioe(d,p))return m;var y=r(p);return s!==void 0&&s(m,y)?(d=p,m):(d=p,f=y)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var o=aoe(e,i[0],i[1]);return loe(function(){a.hasValue=!0,a.value=o},[o]),uoe(o),o};AD.exports=CD;var doe=AD.exports;const foe=td(doe),hoe={},Yk=e=>{let t;const n=new Set,r=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(hoe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,s,l);return l},poe=e=>e?Yk(e):Yk,{useDebugValue:moe}=et,{useSyncExternalStoreWithSelector:goe}=foe,yoe=e=>e;function OD(e,t=yoe,n){const r=goe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return moe(r),r}const Wk=(e,t)=>{const n=poe(e),r=(s,i=t)=>OD(n,s,i);return Object.assign(r,n),r},boe=(e,t)=>e?Wk(e,t):Wk;function Xt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Vm=v.createContext(null),Eoe=Vm.Provider,LD=gs.error001("react");function ft(e,t){const n=v.useContext(Vm);if(n===null)throw new Error(LD);return OD(n,e,t)}function Qt(){const e=v.useContext(Vm);if(e===null)throw new Error(LD);return v.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const qk={display:"none"},xoe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},MD="react-flow__node-desc",DD="react-flow__edge-desc",woe="react-flow__aria-live",voe=e=>e.ariaLiveMessage,_oe=e=>e.ariaLabelConfig;function Toe({rfId:e}){const t=ft(voe);return c.jsx("div",{id:`${woe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:xoe,children:t})}function Noe({rfId:e,disableKeyboardA11y:t}){const n=ft(_oe);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${MD}-${e}`,style:qk,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${DD}-${e}`,style:qk,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(Toe,{rfId:e})]})}const Km=v.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return c.jsx("div",{className:xn(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});Km.displayName="Panel";function koe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(Km,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:c.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Soe=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Vf=e=>e.id;function Aoe(e,t){return Xt(e.selectedNodes.map(Vf),t.selectedNodes.map(Vf))&&Xt(e.selectedEdges.map(Vf),t.selectedEdges.map(Vf))}function Coe({onSelectionChange:e}){const t=Qt(),{selectedNodes:n,selectedEdges:r}=ft(Soe,Aoe);return v.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const Ioe=e=>!!e.onSelectionChangeHandlers;function Roe({onSelectionChange:e}){const t=ft(Ioe);return e||t?c.jsx(Coe,{onSelectionChange:e}):null}const PD=[0,0],Ooe={x:0,y:0,zoom:1},Loe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Gk=[...Loe,"rfId"],Moe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Xk={translateExtent:Gu,nodeOrigin:PD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Doe(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=ft(Moe,Xt),u=Qt();v.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Xk,o()}),[]);const d=v.useRef(Xk);return v.useEffect(()=>{for(const f of Gk){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?s(h):f==="translateExtent"?i(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:iae(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Gk.map(f=>e[f])),null}function Qk(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Poe(e){var r;const[t,n]=v.useState(e==="system"?null:e);return v.useEffect(()=>{if(e!=="system"){n(e);return}const s=Qk(),i=()=>n(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),t!==null?t:(r=Qk())!=null&&r.matches?"dark":"light"}const Zk=typeof document<"u"?document:null;function ed(e=null,t={target:Zk,actInsideInputWithModifier:!0}){const[n,r]=v.useState(!1),s=v.useRef(!1),i=v.useRef(new Set([])),[a,o]=v.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return v.useEffect(()=>{const l=(t==null?void 0:t.target)??QN,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,g;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&cD(p))return!1;const b=JN(p.code,o);if(i.current.add(p[b]),ZN(a,i.current,!1)){const E=((g=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:g[0])||p.target,y=(E==null?void 0:E.nodeName)==="BUTTON"||(E==null?void 0:E.nodeName)==="A";t.preventDefault!==!1&&(s.current||!y)&&p.preventDefault(),r(!0)}},f=p=>{const m=JN(p.code,o);ZN(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[m]),p.key==="Meta"&&i.current.clear(),s.current=!1},h=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function ZN(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function JN(e,t){return t.includes(e)?"code":"key"}const Roe=()=>{const e=Gt();return v.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Kx(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:o,y:l}=a.getBoundingClientRect(),u={x:t.x-o,y:t.y-l},d=n.snapGrid??s,f=n.snapToGrid??i;return Xl(u,r,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:i}=r.getBoundingClientRect(),a=Al(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function DD(e,t){const n=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of t){const a=r.get(i.id);if(!a){n.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const o={...i};for(const l of a)Ooe(l,o);n.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Ooe(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function PD(e,t){return DD(e,t)}function jD(e,t){return DD(e,t)}function ga(e,t){return{id:e,type:"select",selected:t}}function Vo(e,t=new Set,n=!1){const r=[];for(const[s,i]of e){const a=t.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(n&&(i.selected=a),r.push(ga(i.id,a)))}return r}function eS({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=t.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&n.push({id:a.id,item:a,type:"replace"}),l===void 0&&n.push({item:a,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function tS(e){return{id:e.id,type:"remove"}}const Loe=iD();function BD(e,t,n={}){return iae(e,t,{...n,onError:n.onError??Loe})}const nS=e=>Vie(e),Moe=e=>tD(e);function FD(e){return v.forwardRef(e)}const Doe=typeof window<"u"?v.useLayoutEffect:v.useEffect;function rS(e){const[t,n]=v.useState(BigInt(0)),[r]=v.useState(()=>Poe(()=>n(s=>s+BigInt(1))));return Doe(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function Poe(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const UD=v.createContext(null);function joe({children:e}){const t=Gt(),n=v.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let b=l;for(const g of o)b=typeof g=="function"?g(b):g;let w=eS({items:b,lookup:h});for(const g of m.values())w=g(w);d&&u(b),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:E,setNodes:y}=t.getState();g&&y(E)})},[]),r=rS(n),s=v.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=l;for(const m of o)p=typeof m=="function"?m(p):m;d?u(p):f&&f(eS({items:p,lookup:h}))},[]),i=rS(s),a=v.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return c.jsx(UD.Provider,{value:a,children:e})}function Boe(){const e=v.useContext(UD);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Foe=e=>!!e.panZoom;function Zx(){const e=Roe(),t=Gt(),n=Boe(),r=ft(Foe),s=v.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},o=f=>{n.edgeQueue.push(f)},l=f=>{var g,E;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=nS(f)?f:h.get(f.id),b=m.parentId?oD(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:b,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((E=m.measured)==null?void 0:E.height)??m.height};return Sl(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(b=>{if(b.id===f){const w=typeof h=="function"?h(b):h;return p.replace&&nS(w)?w:{...b,...w}}return b}))},d=(f,h,p={replace:!1})=>{o(m=>m.map(b=>{if(b.id===f){const w=typeof h=="function"?h(b):h;return p.replace&&Moe(w)?w:{...b,...w}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=i(f))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:o,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,b,w]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y:b,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:b,onEdgesDelete:w,triggerNodeChanges:g,triggerEdgeChanges:E,onDelete:y,onBeforeDelete:_}=t.getState(),{nodes:k,edges:T}=await Gie({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),C=T.length>0,N=k.length>0;if(C){const R=T.map(tS);w==null||w(T),E(R)}if(N){const R=k.map(tS);b==null||b(k),g(R)}return(N||C)&&(y==null||y({nodes:k,edges:T})),{deletedNodes:k,deletedEdges:T}},getIntersectingNodes:(f,h=!0,p)=>{const m=ON(f),b=m?f:l(f),w=p!==void 0;return b?(p||t.getState().nodes).filter(g=>{const E=t.getState().nodeLookup.get(g.id);if(E&&!m&&(g.id===f.id||!E.internals.positionAbsolute))return!1;const y=Sl(w?g:E),_=Xu(y,b);return h&&_>0||_>=y.width*y.height||_>=b.width*b.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const b=ON(f)?f:l(f);if(!b)return!1;const w=Xu(b,h);return p&&w>0||w>=h.width*h.height||w>=b.width*b.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const b=typeof h=="function"?h(m):h;return p.replace?{...m,data:b}:{...m,data:{...m.data,...b}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const b=typeof h=="function"?h(m):h;return p.replace?{...m,data:b}:{...m,data:{...m.data,...b}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Kie(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??Zie();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return v.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const sS=e=>e.selected,Uoe=typeof window<"u"?window:void 0;function $oe({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Gt(),{deleteElements:r}=Zx(),s=Zu(e,{actInsideInputWithModifier:!1}),i=Zu(t,{target:Uoe});v.useEffect(()=>{if(s){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(sS),edges:a.filter(sS)}),n.setState({nodesSelectionActive:!1})}},[s]),v.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Hoe(e){const t=Gt();v.useEffect(()=>{const n=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Yx(e.current);(r.height===0||r.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",ps.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Vm={position:"absolute",width:"100%",height:"100%",top:0,left:0},zoe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Voe({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Ma.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:b,noPanClassName:w,onViewportChange:g,isControlledViewport:E,paneClickDistance:y,selectionOnDrag:_}){const k=Gt(),T=v.useRef(null),{userSelectionActive:C,lib:N,connectionInProgress:R}=ft(zoe,qt),I=Zu(h),M=v.useRef();Hoe(T);const B=v.useCallback(Y=>{g==null||g({x:Y[0],y:Y[1],zoom:Y[2]}),E||k.setState({transform:Y})},[g,E]);return v.useEffect(()=>{if(T.current){M.current=Dae({domNode:T.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:A=>k.setState(L=>L.paneDragging===A?L:{paneDragging:A}),onPanZoomStart:(A,L)=>{const{onViewportChangeStart:O,onMoveStart:j}=k.getState();j==null||j(A,L),O==null||O(L)},onPanZoom:(A,L)=>{const{onViewportChange:O,onMove:j}=k.getState();j==null||j(A,L),O==null||O(L)},onPanZoomEnd:(A,L)=>{const{onViewportChangeEnd:O,onMoveEnd:j}=k.getState();j==null||j(A,L),O==null||O(L)}});const{x:Y,y:P,zoom:U}=M.current.getViewport();return k.setState({panZoom:M.current,transform:[Y,P,U],domNode:T.current.closest(".react-flow")}),()=>{var A;(A=M.current)==null||A.destroy()}}},[]),v.useEffect(()=>{var Y;(Y=M.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:C,noWheelClassName:b,lib:N,onTransformChange:B,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:y})},[e,t,n,r,s,i,a,o,I,p,w,C,b,N,B,R,_,y]),c.jsx("div",{className:"react-flow__renderer",ref:T,style:Vm,children:m})}const Koe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Yoe(){const{userSelectionActive:e,userSelectionRect:t}=ft(Koe,qt);return e&&t?c.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const O0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Woe=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function qoe({isSelecting:e,selectionKeyPressed:t,selectionMode:n=qu.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:b}){const w=v.useRef(0),g=Gt(),{userSelectionActive:E,elementsSelectable:y,dragging:_,connectionInProgress:k,panBy:T,autoPanSpeed:C}=ft(Woe,qt),N=y&&(e||E),R=v.useRef(null),I=v.useRef(),M=v.useRef(new Set),B=v.useRef(new Set),Y=v.useRef(!1),P=v.useRef({x:0,y:0}),U=v.useRef(!1),A=G=>{if(Y.current||k){Y.current=!1;return}u==null||u(G),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},L=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}d==null||d(G)},O=f?G=>f(G):void 0,j=G=>{Y.current&&(G.stopPropagation(),Y.current=!1)},S=G=>{var Me,ve;const{domNode:W,transform:ae}=g.getState();if(I.current=W==null?void 0:W.getBoundingClientRect(),!I.current)return;const he=G.target===R.current;if(!he&&!!G.target.closest(".nokey")||!e||!(a&&he||t)||G.button!==0||!G.isPrimary)return;(ve=(Me=G.target)==null?void 0:Me.setPointerCapture)==null||ve.call(Me,G.pointerId),Y.current=!1;const{x:Ce,y:Ee}=ls(G.nativeEvent,I.current),ge=Xl({x:Ce,y:Ee},ae);g.setState({userSelectionRect:{width:0,height:0,startX:ge.x,startY:ge.y,x:Ce,y:Ee}}),he||(G.stopPropagation(),G.preventDefault())};function H(G,W){const{userSelectionRect:ae}=g.getState();if(!ae)return;const{transform:he,nodeLookup:Z,edgeLookup:ce,connectionLookup:Ce,triggerNodeChanges:Ee,triggerEdgeChanges:ge,defaultEdgeOptions:Me}=g.getState(),ve={x:ae.startX,y:ae.startY},{x:$e,y:Re}=Al(ve,he),oe={startX:ve.x,startY:ve.y,x:G<$e?G:$e,y:Wct.id)),B.current=new Set;const Tt=(Me==null?void 0:Me.selectable)??!0;for(const ct of M.current){const K=Ce.get(ct);if(K)for(const{edgeId:X}of K.values()){const le=ce.get(X);le&&(le.selectable??Tt)&&B.current.add(X)}}if(!LN(_t,M.current)){const ct=Vo(Z,M.current,!0);Ee(ct)}if(!LN(we,B.current)){const ct=Vo(ce,B.current);ge(ct)}g.setState({userSelectionRect:oe,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!s||!I.current)return;const[G,W]=Vx(P.current,I.current,C);T({x:G,y:W}).then(ae=>{if(!Y.current||!ae){w.current=requestAnimationFrame(V);return}const{x:he,y:Z}=P.current;H(he,Z),w.current=requestAnimationFrame(V)})}const D=()=>{cancelAnimationFrame(w.current),w.current=0,U.current=!1};v.useEffect(()=>()=>D(),[]);const ne=G=>{const{userSelectionRect:W,transform:ae,resetSelectedElements:he}=g.getState();if(!I.current||!W)return;const{x:Z,y:ce}=ls(G.nativeEvent,I.current);P.current={x:Z,y:ce};const Ce=Al({x:W.startX,y:W.startY},ae);if(!Y.current){const Ee=t?0:i;if(Math.hypot(Z-Ce.x,ce-Ce.y)<=Ee)return;he(),o==null||o(G)}Y.current=!0,U.current||(V(),U.current=!0),H(Z,ce)},J=G=>{var W,ae;G.button===0&&((ae=(W=G.target)==null?void 0:W.releasePointerCapture)==null||ae.call(W,G.pointerId),!E&&G.target===R.current&&g.getState().userSelectionRect&&(A==null||A(G)),g.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(l==null||l(G),g.setState({nodesSelectionActive:M.current.size>0})),D())},re=G=>{var W,ae;(ae=(W=G.target)==null?void 0:W.releasePointerCapture)==null||ae.call(W,G.pointerId),D()},de=r===!0||Array.isArray(r)&&r.includes(0);return c.jsxs("div",{className:En(["react-flow__pane",{draggable:de,dragging:_,selection:e}]),onClick:N?void 0:O0(A,R),onContextMenu:O0(L,R),onWheel:O0(O,R),onPointerEnter:N?void 0:h,onPointerMove:N?ne:p,onPointerUp:N?J:void 0,onPointerCancel:N?re:void 0,onPointerDownCapture:N?S:void 0,onClickCapture:N?j:void 0,onPointerLeave:m,ref:R,style:Vm,children:[b,c.jsx(Yoe,{})]})}function W1({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=t.getState(),u=o.get(e);if(!u){l==null||l("012",ps.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):s([e])}function $D({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Gt(),[l,u]=v.useState(!1),d=v.useRef();return v.useEffect(()=>{d.current=wae({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{W1({id:f,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),v.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,r,t,i,e,s,a]),l}const Goe=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function HD(){const e=Gt();return v.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=Goe(a),p=s?i[0]:5,m=s?i[1]:5,b=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,g]of u){if(!h(g))continue;let E={x:g.internals.positionAbsolute.x+b,y:g.internals.positionAbsolute.y+w};s&&(E=Md(E,i));const{position:y,positionAbsolute:_}=nD({nodeId:g.id,nextPosition:E,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:o});g.position=y,g.internals.positionAbsolute=_,f.set(g.id,g)}l(f)},[])}const Jx=v.createContext(null),Xoe=Jx.Provider;Jx.Consumer;const zD=()=>v.useContext(Jx),Qoe=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Zoe=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:d,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:i===kl.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:d&&u}};function Joe({type:e="source",position:t=De.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:d,onTouchStart:f,...h},p){var U,A;const m=a||null,b=e==="target",w=Gt(),g=zD(),{connectOnClick:E,noPanClassName:y,rfId:_}=ft(Qoe,qt),{connectingFrom:k,connectingTo:T,clickConnecting:C,isPossibleEndHandle:N,connectionInProcess:R,clickConnectionInProcess:I,valid:M}=ft(Zoe(g,m,e),qt);g||(A=(U=w.getState()).onError)==null||A.call(U,"010",ps.error010());const B=L=>{const{defaultEdgeOptions:O,onConnect:j,hasDefaultEdges:S}=w.getState(),H={...O,...L};if(S){const{edges:V,setEdges:D,onError:ne}=w.getState();D(BD(H,V,{onError:ne}))}j==null||j(H),o==null||o(H)},Y=L=>{if(!g)return;const O=uD(L.nativeEvent);if(s&&(O&&L.button===0||!O)){const j=w.getState();Y1.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:b,handleId:m,nodeId:g,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...S)=>{var H,V;return(V=(H=w.getState()).onConnectEnd)==null?void 0:V.call(H,...S)},updateConnection:j.updateConnection,onConnect:B,isValidConnection:n||((...S)=>{var H,V;return((V=(H=w.getState()).isValidConnection)==null?void 0:V.call(H,...S))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}O?d==null||d(L):f==null||f(L)},P=L=>{const{onClickConnectStart:O,onClickConnectEnd:j,connectionClickStartHandle:S,connectionMode:H,isValidConnection:V,lib:D,rfId:ne,nodeLookup:J,connection:re}=w.getState();if(!g||!S&&!s)return;if(!S){O==null||O(L.nativeEvent,{nodeId:g,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const de=lD(L.target),G=n||V,{connection:W,isValid:ae}=Y1.isValid(L.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:H,fromNodeId:S.nodeId,fromHandleId:S.id||null,fromType:S.type,isValidConnection:G,flowId:ne,doc:de,lib:D,nodeLookup:J});ae&&W&&B(W);const he=structuredClone(re);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,j==null||j(L,he),w.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${_}-${g}-${m}-${e}`,className:En(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!b,target:b,connectable:r,connectablestart:s,connectableend:i,clickconnecting:C,connectingfrom:k,connectingto:T,valid:M,connectionindicator:r&&(!R||N)&&(R||I?i:s)}]),onMouseDown:Y,onTouchStart:Y,onClick:E?P:void 0,ref:p,...h,children:l})}const Rl=v.memo(FD(Joe));function ele({data:e,isConnectable:t,sourcePosition:n=De.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Rl,{type:"source",position:n,isConnectable:t})]})}function tle({data:e,isConnectable:t,targetPosition:n=De.Top,sourcePosition:r=De.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Rl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Rl,{type:"source",position:r,isConnectable:t})]})}function nle(){return null}function rle({data:e,isConnectable:t,targetPosition:n=De.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Rl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const jp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},iS={input:ele,default:tle,output:rle,group:nle};function sle(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const ile=e=>{const{width:t,height:n,x:r,y:s}=Ld(e.nodeLookup,{filter:i=>!!i.selected});return{width:os(t)?t:null,height:os(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function ale({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Gt(),{width:s,height:i,transformString:a,userSelectionActive:o}=ft(ile,qt),l=HD(),u=v.useRef(null);v.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!o&&s!==null&&i!==null;if($D({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(b=>b.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(jp,p.key)&&(p.preventDefault(),l({direction:jp[p.key],factor:p.shiftKey?4:1}))};return c.jsx("div",{className:En(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:c.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:s,height:i}})})}const aS=typeof window<"u"?window:void 0,ole=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function VD({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:b,zoomActivationKeyCode:w,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:y,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:C,panOnDrag:N,autoPanOnSelection:R,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:Y,preventScrolling:P,onSelectionContextMenu:U,noWheelClassName:A,noPanClassName:L,disableKeyboardA11y:O,onViewportChange:j,isControlledViewport:S}){const{nodesSelectionActive:H,userSelectionActive:V}=ft(ole,qt),D=Zu(u,{target:aS}),ne=Zu(b,{target:aS}),J=ne||N,re=ne||_,de=d&&J!==!0,G=D||V||de;return $oe({deleteKeyCode:l,multiSelectionKeyCode:m}),c.jsx(Voe,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:C,panOnDrag:!D&&J,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:Y,zoomActivationKeyCode:w,preventScrolling:P,noWheelClassName:A,noPanClassName:L,onViewportChange:j,isControlledViewport:S,paneClickDistance:o,selectionOnDrag:de,children:c.jsxs(qoe,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:J,autoPanOnSelection:R,isSelecting:!!G,selectionMode:f,selectionKeyPressed:D,paneClickDistance:o,selectionOnDrag:de,children:[e,H&&c.jsx(ale,{onSelectionContextMenu:U,noPanClassName:L,disableKeyboardA11y:O})]})})}VD.displayName="FlowRenderer";const lle=v.memo(VD),cle=e=>t=>e?zx(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function ule(e){return ft(v.useCallback(cle(e),[e]),qt)}const dle=e=>e.updateNodeInternals;function fle(){const e=ft(dle),[t]=v.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return v.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function hle({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Gt(),i=v.useRef(null),a=v.useRef(null),o=v.useRef(e.sourcePosition),l=v.useRef(e.targetPosition),u=v.useRef(t),d=n&&!!e.internals.handleBounds;return v.useEffect(()=>{i.current&&!e.hidden&&(!d||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[d,e.hidden]),v.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),v.useEffect(()=>{if(i.current){const f=u.current!==t,h=o.current!==e.sourcePosition,p=l.current!==e.targetPosition;(f||h||p)&&(u.current=t,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function ple({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:b,nodeTypes:w,nodeClickDistance:g,onError:E}){const{node:y,internals:_,isParent:k}=ft(G=>{const W=G.nodeLookup.get(e),ae=G.parentLookup.has(e);return{node:W,internals:W.internals,isParent:ae}},qt);let T=y.type||"default",C=(w==null?void 0:w[T])||iS[T];C===void 0&&(E==null||E("003",ps.error003(T)),T="default",C=(w==null?void 0:w.default)||iS.default);const N=!!(y.draggable||o&&typeof y.draggable>"u"),R=!!(y.selectable||l&&typeof y.selectable>"u"),I=!!(y.connectable||u&&typeof y.connectable>"u"),M=!!(y.focusable||d&&typeof y.focusable>"u"),B=Gt(),Y=aD(y),P=hle({node:y,nodeType:T,hasDimensions:Y,resizeObserver:f}),U=$D({nodeRef:P,disabled:y.hidden||!N,noDragClassName:h,handleSelector:y.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:g}),A=HD();if(y.hidden)return null;const L=fi(y),O=sle(y),j=R||N||t||n||r||s,S=n?G=>n(G,{..._.userNode}):void 0,H=r?G=>r(G,{..._.userNode}):void 0,V=s?G=>s(G,{..._.userNode}):void 0,D=i?G=>i(G,{..._.userNode}):void 0,ne=a?G=>a(G,{..._.userNode}):void 0,J=G=>{const{selectNodesOnDrag:W,nodeDragThreshold:ae}=B.getState();R&&(!W||!N||ae>0)&&W1({id:e,store:B,nodeRef:P}),t&&t(G,{..._.userNode})},re=G=>{if(!(cD(G.nativeEvent)||m)){if(Q3.includes(G.key)&&R){const W=G.key==="Escape";W1({id:e,store:B,unselect:W,nodeRef:P})}else if(N&&y.selected&&Object.prototype.hasOwnProperty.call(jp,G.key)){G.preventDefault();const{ariaLabelConfig:W}=B.getState();B.setState({ariaLiveMessage:W["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),A({direction:jp[G.key],factor:G.shiftKey?4:1})}}},de=()=>{var Ce;if(m||!((Ce=P.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:G,width:W,height:ae,autoPanOnNodeFocus:he,setCenter:Z}=B.getState();if(!he)return;zx(new Map([[e,y]]),{x:0,y:0,width:W,height:ae},G,!0).length>0||Z(y.position.x+L.width/2,y.position.y+L.height/2,{zoom:G[2]})};return c.jsx("div",{className:En(["react-flow__node",`react-flow__node-${T}`,{[p]:N},y.className,{selected:y.selected,selectable:R,parent:k,draggable:N,dragging:U}]),ref:P,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:Y?"visible":"hidden",...y.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:S,onMouseMove:H,onMouseLeave:V,onContextMenu:D,onClick:J,onDoubleClick:ne,onKeyDown:M?re:void 0,tabIndex:M?0:void 0,onFocus:M?de:void 0,role:y.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${OD}-${b}`,"aria-label":y.ariaLabel,...y.domAttributes,children:c.jsx(Xoe,{value:e,children:c.jsx(C,{id:e,data:y.data,type:T,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:y.selected??!1,selectable:R,draggable:N,deletable:y.deletable??!0,isConnectable:I,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:U,dragHandle:y.dragHandle,zIndex:_.z,parentId:y.parentId,...L})})})}var mle=v.memo(ple);const gle=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function KD(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=ft(gle,qt),a=ule(e.onlyRenderVisibleElements),o=fle();return c.jsx("div",{className:"react-flow__nodes",style:Vm,children:a.map(l=>c.jsx(mle,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}KD.displayName="NodeRenderer";const yle=v.memo(KD);function ble(e){return ft(v.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const i=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);i&&a&&nae({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),qt)}const Ele=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},xle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},oS={[Gu.Arrow]:Ele,[Gu.ArrowClosed]:xle};function wle(e){const t=Gt();return v.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(oS,e)?oS[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",ps.error009(e)),null)},[e])}const vle=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=wle(t);return l?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:c.jsx(l,{color:n,strokeWidth:a})}):null},YD=({defaultColor:e,rfId:t})=>{const n=ft(i=>i.edges),r=ft(i=>i.defaultEdgeOptions),s=v.useMemo(()=>uae(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:s.map(i=>c.jsx(vle,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};YD.displayName="MarkerDefinitions";var _le=v.memo(YD);function WD({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,...d}){const[f,h]=v.useState({x:1,y:0,width:0,height:0}),p=En(["react-flow__edge-textwrapper",u]),m=v.useRef(null);return v.useEffect(()=>{if(m.current){const b=m.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&c.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),c.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),l]}):null}WD.displayName="EdgeText";const Tle=v.memo(WD);function Km({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...d,d:e,fill:"none",className:En(["react-flow__edge-path",d.className])}),u?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&os(t)&&os(n)?c.jsx(Tle,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function lS({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===De.Left||e===De.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function qD({sourceX:e,sourceY:t,sourcePosition:n=De.Bottom,targetX:r,targetY:s,targetPosition:i=De.Top}){const[a,o]=lS({pos:n,x1:e,y1:t,x2:r,y2:s}),[l,u]=lS({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=dD({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${o} ${l},${u} ${r},${s}`,d,f,h,p]}function GD(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:b,markerStart:w,interactionWidth:g})=>{const[E,y,_]=qD({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),k=e.isInternal?void 0:t;return c.jsx(Km,{id:k,path:E,labelX:y,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:b,markerStart:w,interactionWidth:g})})}const kle=GD({isInternal:!1}),XD=GD({isInternal:!0});kle.displayName="SimpleBezierEdge";XD.displayName="SimpleBezierEdgeInternal";function QD(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=De.Bottom,targetPosition:m=De.Top,markerEnd:b,markerStart:w,pathOptions:g,interactionWidth:E})=>{const[y,_,k]=z1({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),T=e.isInternal?void 0:t;return c.jsx(Km,{id:T,path:y,labelX:_,labelY:k,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:w,interactionWidth:E})})}const ZD=QD({isInternal:!1}),JD=QD({isInternal:!0});ZD.displayName="SmoothStepEdge";JD.displayName="SmoothStepEdgeInternal";function eP(e){return v.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return c.jsx(ZD,{...n,id:r,pathOptions:v.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Nle=eP({isInternal:!1}),tP=eP({isInternal:!0});Nle.displayName="StepEdge";tP.displayName="StepEdgeInternal";function nP(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:b})=>{const[w,g,E]=pD({sourceX:n,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:t;return c.jsx(Km,{id:y,path:w,labelX:g,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:b})})}const Sle=nP({isInternal:!1}),rP=nP({isInternal:!0});Sle.displayName="StraightEdge";rP.displayName="StraightEdgeInternal";function sP(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=De.Bottom,targetPosition:o=De.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:b,markerStart:w,pathOptions:g,interactionWidth:E})=>{const[y,_,k]=fD({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:g==null?void 0:g.curvature}),T=e.isInternal?void 0:t;return c.jsx(Km,{id:T,path:y,labelX:_,labelY:k,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:b,markerStart:w,interactionWidth:E})})}const Ale=sP({isInternal:!1}),iP=sP({isInternal:!0});Ale.displayName="BezierEdge";iP.displayName="BezierEdgeInternal";const cS={default:iP,straight:rP,step:tP,smoothstep:JD,simplebezier:XD},uS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Cle=(e,t,n)=>n===De.Left?e-t:n===De.Right?e+t:e,Ile=(e,t,n)=>n===De.Top?e-t:n===De.Bottom?e+t:e,dS="react-flow__edgeupdater";function fS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return c.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:En([dS,`${dS}-${o}`]),cx:Cle(t,r,e),cy:Ile(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Rle({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Gt(),b=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:T,domNode:C,connectionMode:N,connectionRadius:R,lib:I,onConnectStart:M,cancelConnection:B,nodeLookup:Y,rfId:P,panBy:U,updateConnection:A}=m.getState(),L=k.type==="target",O=(H,V)=>{h(!1),f==null||f(H,n,k.type,V)},j=H=>u==null?void 0:u(n,H),S=(H,V)=>{h(!0),d==null||d(_,n,k.type),M==null||M(H,V)};Y1.onPointerDown(_.nativeEvent,{autoPanOnConnect:T,connectionMode:N,connectionRadius:R,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:Y,isTarget:L,edgeUpdaterType:k.type,lib:I,flowId:P,cancelConnection:B,panBy:U,isValidConnection:(...H)=>{var V,D;return((D=(V=m.getState()).isValidConnection)==null?void 0:D.call(V,...H))??!0},onConnect:j,onConnectStart:S,onConnectEnd:(...H)=>{var V,D;return(D=(V=m.getState()).onConnectEnd)==null?void 0:D.call(V,...H)},onReconnectEnd:O,updateConnection:A,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>b(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=_=>b(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>p(!0),y=()=>p(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(fS,{position:o,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:E,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&c.jsx(fS,{position:l,centerX:i,centerY:a,radius:t,onMouseDown:g,onMouseEnter:E,onMouseOut:y,type:"target"})]})}function Ole({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:b,noPanClassName:w,onError:g,disableKeyboardA11y:E}){let y=ft(Z=>Z.edgeLookup.get(e));const _=ft(Z=>Z.defaultEdgeOptions);y=_?{..._,...y}:y;let k=y.type||"default",T=(b==null?void 0:b[k])||cS[k];T===void 0&&(g==null||g("011",ps.error011(k)),k="default",T=(b==null?void 0:b.default)||cS.default);const C=!!(y.focusable||t&&typeof y.focusable>"u"),N=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),R=!!(y.selectable||r&&typeof y.selectable>"u"),I=v.useRef(null),[M,B]=v.useState(!1),[Y,P]=v.useState(!1),U=Gt(),{zIndex:A,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V}=ft(v.useCallback(Z=>{const ce=Z.nodeLookup.get(y.source),Ce=Z.nodeLookup.get(y.target);if(!ce||!Ce)return{zIndex:y.zIndex,...uS};const Ee=cae({id:e,sourceNode:ce,targetNode:Ce,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:Z.connectionMode,onError:g});return{zIndex:tae({selected:y.selected,zIndex:y.zIndex,sourceNode:ce,targetNode:Ce,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode}),...Ee||uS}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),qt),D=v.useMemo(()=>y.markerStart?`url('#${V1(y.markerStart,m)}')`:void 0,[y.markerStart,m]),ne=v.useMemo(()=>y.markerEnd?`url('#${V1(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||L===null||O===null||j===null||S===null)return null;const J=Z=>{var ge;const{addSelectedEdges:ce,unselectNodesAndEdges:Ce,multiSelectionActive:Ee}=U.getState();R&&(U.setState({nodesSelectionActive:!1}),y.selected&&Ee?(Ce({nodes:[],edges:[y]}),(ge=I.current)==null||ge.blur()):ce([e])),s&&s(Z,y)},re=i?Z=>{i(Z,{...y})}:void 0,de=a?Z=>{a(Z,{...y})}:void 0,G=o?Z=>{o(Z,{...y})}:void 0,W=l?Z=>{l(Z,{...y})}:void 0,ae=u?Z=>{u(Z,{...y})}:void 0,he=Z=>{var ce;if(!E&&Q3.includes(Z.key)&&R){const{unselectNodesAndEdges:Ce,addSelectedEdges:Ee}=U.getState();Z.key==="Escape"?((ce=I.current)==null||ce.blur(),Ce({edges:[y]})):Ee([e])}};return c.jsx("svg",{style:{zIndex:A},children:c.jsxs("g",{className:En(["react-flow__edge",`react-flow__edge-${k}`,y.className,w,{selected:y.selected,animated:y.animated,inactive:!R&&!s,updating:M,selectable:R}]),onClick:J,onDoubleClick:re,onContextMenu:de,onMouseEnter:G,onMouseMove:W,onMouseLeave:ae,onKeyDown:C?he:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${LD}-${m}`:void 0,ref:I,...y.domAttributes,children:[!Y&&c.jsx(T,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:R,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:D,markerEnd:ne,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),N&&c.jsx(Rle,{edge:y,isReconnectable:N,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V,setUpdateHover:B,setReconnecting:P})]})})}var Lle=v.memo(Ole);const Mle=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function aP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:b}){const{edgesFocusable:w,edgesReconnectable:g,elementsSelectable:E,onError:y}=ft(Mle,qt),_=ble(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(_le,{defaultColor:e,rfId:n}),_.map(k=>c.jsx(Lle,{id:k,edgesFocusable:w,edgesReconnectable:g,elementsSelectable:E,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:b},k))]})}aP.displayName="EdgeRenderer";const Dle=v.memo(aP),Ple=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jle({children:e}){const t=ft(Ple);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Ble(e){const t=Zx(),n=v.useRef(!1);v.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Fle=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Ule(e){const t=ft(Fle),n=Gt();return v.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function $le(e){return e.connection.inProgress?{...e.connection,to:Xl(e.connection.to,e.transform)}:{...e.connection}}function Hle(e){return $le}function zle(e){const t=Hle();return ft(t,qt)}const Vle=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Kle({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=ft(Vle,qt);return!(i&&s&&l)?null:c.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:En(["react-flow__connection",eD(o)]),children:c.jsx(oP,{style:t,type:n,CustomComponent:r,isValid:o})})})}const oP=({style:e,type:t=Ai.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=zle();if(!s)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:h,connectionStatus:eD(r),toNode:d,toHandle:f,pointer:p});let m="";const b={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ai.Bezier:[m]=fD(b);break;case Ai.SimpleBezier:[m]=qD(b);break;case Ai.Step:[m]=z1({...b,borderRadius:0});break;case Ai.SmoothStep:[m]=z1(b);break;default:[m]=pD(b)}return c.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};oP.displayName="ConnectionLine";const Yle={};function hS(e=Yle){v.useRef(e),Gt(),v.useEffect(()=>{},[e])}function Wle(){Gt(),v.useRef(!1),v.useEffect(()=>{},[])}function lP({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:b,connectionLineComponent:w,connectionLineContainerStyle:g,selectionKeyCode:E,selectionOnDrag:y,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:C,deleteKeyCode:N,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:M,translateExtent:B,minZoom:Y,maxZoom:P,preventScrolling:U,defaultMarkerColor:A,zoomOnScroll:L,zoomOnPinch:O,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:H,zoomOnDoubleClick:V,panOnDrag:D,autoPanOnSelection:ne,onPaneClick:J,onPaneMouseEnter:re,onPaneMouseMove:de,onPaneMouseLeave:G,onPaneScroll:W,onPaneContextMenu:ae,paneClickDistance:he,nodeClickDistance:Z,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:ge,reconnectRadius:Me,onReconnect:ve,onReconnectStart:$e,onReconnectEnd:Re,noDragClassName:oe,noWheelClassName:_t,noPanClassName:we,disableKeyboardA11y:Tt,nodeExtent:ct,rfId:K,viewport:X,onViewportChange:le}){return hS(e),hS(t),Wle(),Ble(n),Ule(X),c.jsx(lle,{onPaneClick:J,onPaneMouseEnter:re,onPaneMouseMove:de,onPaneMouseLeave:G,onPaneContextMenu:ae,onPaneScroll:W,paneClickDistance:he,deleteKeyCode:N,selectionKeyCode:E,selectionOnDrag:y,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:C,elementsSelectable:I,zoomOnScroll:L,zoomOnPinch:O,zoomOnDoubleClick:V,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:H,panOnDrag:D,autoPanOnSelection:ne,defaultViewport:M,translateExtent:B,minZoom:Y,maxZoom:P,onSelectionContextMenu:f,preventScrolling:U,noDragClassName:oe,noWheelClassName:_t,noPanClassName:we,disableKeyboardA11y:Tt,onViewportChange:le,isControlledViewport:!!X,children:c.jsxs(jle,{children:[c.jsx(Dle,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:ve,onReconnectStart:$e,onReconnectEnd:Re,onlyRenderVisibleElements:R,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:ge,reconnectRadius:Me,defaultMarkerColor:A,noPanClassName:we,disableKeyboardA11y:Tt,rfId:K}),c.jsx(Kle,{style:b,type:m,component:w,containerStyle:g}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(yle,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Z,onlyRenderVisibleElements:R,noPanClassName:we,noDragClassName:oe,disableKeyboardA11y:Tt,nodeExtent:ct,rfId:K}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}lP.displayName="GraphView";const qle=v.memo(lP),Gle=iD(),pS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,b=new Map,w=new Map,g=r??t??[],E=n??e??[],y=d??[0,0],_=f??Wu;yD(b,w,g);const{nodesInitialized:k}=K1(E,p,m,{nodeOrigin:y,nodeExtent:_,zIndexMode:h});let T=[0,0,1];if(a&&s&&i){const C=Ld(p,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:N,y:R,zoom:I}=Kx(C,s,i,l,u,(o==null?void 0:o.padding)??.1);T=[N,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:T,nodes:E,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:w,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Wu,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:kl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...J3},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Gle,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Z3,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Xle=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>foe((p,m)=>{async function b(){const{nodeLookup:w,panZoom:g,fitViewOptions:E,fitViewResolver:y,width:_,height:k,minZoom:T,maxZoom:C}=m();g&&(await qie({nodes:w,width:_,height:k,panZoom:g,minZoom:T,maxZoom:C},E),y==null||y.resolve(!0),p({fitViewResolver:null}))}return{...pS({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:g,parentLookup:E,nodeOrigin:y,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:T,nodesSelectionActive:C}=m(),{nodesInitialized:N,hasSelectedNodes:R}=K1(w,g,E,{nodeOrigin:y,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:T}),I=C&&R;k&&N?(b(),p({nodes:w,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:N,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:g,edgeLookup:E}=m();yD(g,E,w),p({edges:w})},setDefaultNodesAndEdges:(w,g)=>{if(w){const{setNodes:E}=m();E(w),p({hasDefaultNodes:!0})}if(g){const{setEdges:E}=m();E(g),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:g,nodeLookup:E,parentLookup:y,domNode:_,nodeOrigin:k,nodeExtent:T,debug:C,fitViewQueued:N,zIndexMode:R}=m(),{changes:I,updatedInternals:M}=yae(w,E,y,_,k,T,R);M&&(hae(E,y,{nodeOrigin:k,nodeExtent:T,zIndexMode:R}),N?(b(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(C&&console.log("React Flow: trigger node changes",I),g==null||g(I)))},updateNodePositions:(w,g=!1)=>{const E=[];let y=[];const{nodeLookup:_,triggerNodeChanges:k,connection:T,updateConnection:C,onNodesChangeMiddlewareMap:N}=m();for(const[R,I]of w){const M=_.get(R),B=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(I!=null&&I.position)),Y={id:R,type:"position",position:B?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:g};if(M&&T.inProgress&&T.fromNode.id===M.id){const P=Xa(M,T.fromHandle,De.Left,!0);C({...T,from:P})}B&&M.parentId&&E.push({id:R,parentId:M.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),y.push(Y)}if(E.length>0){const{parentLookup:R,nodeOrigin:I}=m(),M=Qx(E,_,R,I);y.push(...M)}for(const R of N.values())y=R(y);k(y)},triggerNodeChanges:w=>{const{onNodesChange:g,setNodes:E,nodes:y,hasDefaultNodes:_,debug:k}=m();if(w!=null&&w.length){if(_){const T=PD(w,y);E(T)}k&&console.log("React Flow: trigger node changes",w),g==null||g(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:g,setEdges:E,edges:y,hasDefaultEdges:_,debug:k}=m();if(w!=null&&w.length){if(_){const T=jD(w,y);E(T)}k&&console.log("React Flow: trigger edge changes",w),g==null||g(w)}},addSelectedNodes:w=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:y,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(g){const T=w.map(C=>ga(C,!0));_(T);return}_(Vo(y,new Set([...w]),!0)),k(Vo(E))},addSelectedEdges:w=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:y,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(g){const T=w.map(C=>ga(C,!0));k(T);return}k(Vo(E,new Set([...w]))),_(Vo(y,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:g}={})=>{const{edges:E,nodes:y,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:T}=m(),C=w||y,N=g||E,R=[];for(const M of C){if(!M.selected)continue;const B=_.get(M.id);B&&(B.selected=!1),R.push(ga(M.id,!1))}const I=[];for(const M of N)M.selected&&I.push(ga(M.id,!1));k(R),T(I)},setMinZoom:w=>{const{panZoom:g,maxZoom:E}=m();g==null||g.setScaleExtent([w,E]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:g,minZoom:E}=m();g==null||g.setScaleExtent([E,w]),p({maxZoom:w})},setTranslateExtent:w=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:g,triggerNodeChanges:E,triggerEdgeChanges:y,elementsSelectable:_}=m();if(!_)return;const k=g.reduce((C,N)=>N.selected?[...C,ga(N.id,!1)]:C,[]),T=w.reduce((C,N)=>N.selected?[...C,ga(N.id,!1)]:C,[]);E(k),y(T)},setNodeExtent:w=>{const{nodes:g,nodeLookup:E,parentLookup:y,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:T,zIndexMode:C}=m();w[0][0]===T[0][0]&&w[0][1]===T[0][1]&&w[1][0]===T[1][0]&&w[1][1]===T[1][1]||(K1(g,E,y,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:C}),p({nodeExtent:w}))},panBy:w=>{const{transform:g,width:E,height:y,panZoom:_,translateExtent:k}=m();return bae({delta:w,panZoom:_,transform:g,translateExtent:k,width:E,height:y})},setCenter:async(w,g,E)=>{const{width:y,height:_,maxZoom:k,panZoom:T}=m();if(!T)return!1;const C=typeof(E==null?void 0:E.zoom)<"u"?E.zoom:k;return await T.setViewport({x:y/2-w*C,y:_/2-g*C,zoom:C},{duration:E==null?void 0:E.duration,ease:E==null?void 0:E.ease,interpolate:E==null?void 0:E.interpolate}),!0},cancelConnection:()=>{p({connection:{...J3}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...pS()})}},Object.is);function cP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=v.useState(()=>Xle({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return c.jsx(hoe,{value:m,children:c.jsx(joe,{children:p})})}function Qle({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return v.useContext(Hm)?c.jsx(c.Fragment,{children:e}):c.jsx(cP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Zle={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Jle({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:b,onClickConnectStart:w,onClickConnectEnd:g,onNodeMouseEnter:E,onNodeMouseMove:y,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:T,onNodeDragStart:C,onNodeDrag:N,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:M,onDelete:B,onSelectionChange:Y,onSelectionDragStart:P,onSelectionDrag:U,onSelectionDragStop:A,onSelectionContextMenu:L,onSelectionStart:O,onSelectionEnd:j,onBeforeDelete:S,connectionMode:H,connectionLineType:V=Ai.Bezier,connectionLineStyle:D,connectionLineComponent:ne,connectionLineContainerStyle:J,deleteKeyCode:re="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:G=!1,selectionMode:W=qu.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:he=Qu()?"Meta":"Control",zoomActivationKeyCode:Z=Qu()?"Meta":"Control",snapToGrid:ce,snapGrid:Ce,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:ge,nodesDraggable:Me,autoPanOnNodeFocus:ve,nodesConnectable:$e,nodesFocusable:Re,nodeOrigin:oe=MD,edgesFocusable:_t,edgesReconnectable:we,elementsSelectable:Tt=!0,defaultViewport:ct=Noe,minZoom:K=.5,maxZoom:X=2,translateExtent:le=Wu,preventScrolling:ke=!0,nodeExtent:Oe,defaultMarkerColor:ut="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:ot=!0,panOnScroll:Xt=!1,panOnScrollSpeed:It=.5,panOnScrollMode:Ge=Ma.Free,zoomOnDoubleClick:bt=!0,panOnDrag:$t=!0,onPaneClick:Tn,onPaneMouseEnter:Ue,onPaneMouseMove:rt,onPaneMouseLeave:tt,onPaneScroll:gt,onPaneContextMenu:ue,paneClickDistance:Le=1,nodeClickDistance:Qe=0,children:on,onReconnect:ln,onReconnectStart:ie,onReconnectEnd:_e,onEdgeContextMenu:ye,onEdgeDoubleClick:Pe,onEdgeMouseEnter:He,onEdgeMouseMove:qe,onEdgeMouseLeave:yt,reconnectRadius:Rt=10,onNodesChange:Ot,onEdgesChange:mn,noDragClassName:gn="nodrag",noWheelClassName:Ht="nowheel",noPanClassName:kn="nopan",fitView:Jn,fitViewOptions:wr,connectOnClick:Dn,attributionPosition:Hn,proOptions:er,defaultEdgeOptions:vr,elevateNodesOnSelect:zt=!0,elevateEdgesOnSelect:Nn=!1,disableKeyboardA11y:Pn=!1,autoPanOnConnect:tr,autoPanOnNodeDrag:zn,autoPanOnSelection:Sn=!0,autoPanSpeed:st,connectionRadius:An,isValidConnection:jt,onError:Qt,style:Cn,id:jn,nodeDragThreshold:xn,connectionDragThreshold:te,viewport:Ne,onViewportChange:Ie,width:je,height:Et,colorMode:ht="light",debug:Zt,onScroll:xt,ariaLabelConfig:In,zIndexMode:kt="basic",...Ym},_r){const na=jn||"1",Ql=Ioe(ht),Zl=v.useCallback(Pd=>{Pd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),xt==null||xt(Pd)},[xt]);return c.jsx("div",{"data-testid":"rf__wrapper",...Ym,onScroll:Zl,style:{...Cn,...Zle},ref:_r,className:En(["react-flow",s,Ql]),id:jn,role:"application",children:c.jsxs(Qle,{nodes:e,edges:t,width:je,height:Et,fitView:Jn,fitViewOptions:wr,minZoom:K,maxZoom:X,nodeOrigin:oe,nodeExtent:Oe,zIndexMode:kt,children:[c.jsx(Coe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:b,onClickConnectStart:w,onClickConnectEnd:g,nodesDraggable:Me,autoPanOnNodeFocus:ve,nodesConnectable:$e,nodesFocusable:Re,edgesFocusable:_t,edgesReconnectable:we,elementsSelectable:Tt,elevateNodesOnSelect:zt,elevateEdgesOnSelect:Nn,minZoom:K,maxZoom:X,nodeExtent:Oe,onNodesChange:Ot,onEdgesChange:mn,snapToGrid:ce,snapGrid:Ce,connectionMode:H,translateExtent:le,connectOnClick:Dn,defaultEdgeOptions:vr,fitView:Jn,fitViewOptions:wr,onNodesDelete:I,onEdgesDelete:M,onDelete:B,onNodeDragStart:C,onNodeDrag:N,onNodeDragStop:R,onSelectionDrag:U,onSelectionDragStart:P,onSelectionDragStop:A,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:kn,nodeOrigin:oe,rfId:na,autoPanOnConnect:tr,autoPanOnNodeDrag:zn,autoPanSpeed:st,onError:Qt,connectionRadius:An,isValidConnection:jt,selectNodesOnDrag:ge,nodeDragThreshold:xn,connectionDragThreshold:te,onBeforeDelete:S,debug:Zt,ariaLabelConfig:In,zIndexMode:kt}),c.jsx(qle,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:E,onNodeMouseMove:y,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:a,connectionLineType:V,connectionLineStyle:D,connectionLineComponent:ne,connectionLineContainerStyle:J,selectionKeyCode:de,selectionOnDrag:G,selectionMode:W,deleteKeyCode:re,multiSelectionKeyCode:he,panActivationKeyCode:ae,zoomActivationKeyCode:Z,onlyRenderVisibleElements:Ee,defaultViewport:ct,translateExtent:le,minZoom:K,maxZoom:X,preventScrolling:ke,zoomOnScroll:We,zoomOnPinch:ot,zoomOnDoubleClick:bt,panOnScroll:Xt,panOnScrollSpeed:It,panOnScrollMode:Ge,panOnDrag:$t,autoPanOnSelection:Sn,onPaneClick:Tn,onPaneMouseEnter:Ue,onPaneMouseMove:rt,onPaneMouseLeave:tt,onPaneScroll:gt,onPaneContextMenu:ue,paneClickDistance:Le,nodeClickDistance:Qe,onSelectionContextMenu:L,onSelectionStart:O,onSelectionEnd:j,onReconnect:ln,onReconnectStart:ie,onReconnectEnd:_e,onEdgeContextMenu:ye,onEdgeDoubleClick:Pe,onEdgeMouseEnter:He,onEdgeMouseMove:qe,onEdgeMouseLeave:yt,reconnectRadius:Rt,defaultMarkerColor:ut,noDragClassName:gn,noWheelClassName:Ht,noPanClassName:kn,rfId:na,disableKeyboardA11y:Pn,nodeExtent:Oe,viewport:Ne,onViewportChange:Ie}),c.jsx(koe,{onSelectionChange:Y}),on,c.jsx(xoe,{proOptions:er,position:Hn}),c.jsx(Eoe,{rfId:na,disableKeyboardA11y:Pn})]})})}var ece=FD(Jle);function tce(e){const[t,n]=v.useState(e),r=v.useCallback(s=>n(i=>PD(s,i)),[]);return[t,n,r]}function nce(e){const[t,n]=v.useState(e),r=v.useCallback(s=>n(i=>jD(s,i)),[]);return[t,n,r]}function rce({dimensions:e,lineWidth:t,variant:n,className:r}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:En(["react-flow__background-pattern",n,r])})}function sce({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:En(["react-flow__background-pattern","dots",t])})}var Vi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Vi||(Vi={}));const ice={[Vi.Dots]:1,[Vi.Lines]:1,[Vi.Cross]:6},ace=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function uP({id:e,variant:t=Vi.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:d}){const f=v.useRef(null),{transform:h,patternId:p}=ft(ace,qt),m=r||ice[t],b=t===Vi.Dots,w=t===Vi.Cross,g=Array.isArray(n)?n:[n,n],E=[g[0]*h[2]||1,g[1]*h[2]||1],y=m*h[2],_=Array.isArray(i)?i:[i,i],k=w?[y,y]:E,T=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],C=`${p}${e||""}`;return c.jsxs("svg",{className:En(["react-flow__background",u]),style:{...l,...Vm,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[c.jsx("pattern",{id:C,x:h[0]%E[0],y:h[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:b?c.jsx(sce,{radius:y/2,className:d}):c.jsx(rce,{dimensions:k,lineWidth:s,variant:t,className:d})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}uP.displayName="Background";const oce=v.memo(uP);function lce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function cce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function uce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function dce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function fce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function zf({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:En(["react-flow__controls-button",t]),...n,children:e})}const hce=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function dP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Gt(),{isInteractive:b,minZoomReached:w,maxZoomReached:g,ariaLabelConfig:E}=ft(hce,qt),{zoomIn:y,zoomOut:_,fitView:k}=Zx(),T=()=>{y(),i==null||i()},C=()=>{_(),a==null||a()},N=()=>{k(s),o==null||o()},R=()=>{m.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),l==null||l(!b)},I=h==="horizontal"?"horizontal":"vertical";return c.jsxs(zm,{className:En(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??E["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(zf,{onClick:T,className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:g,children:c.jsx(lce,{})}),c.jsx(zf,{onClick:C,className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:w,children:c.jsx(cce,{})})]}),n&&c.jsx(zf,{className:"react-flow__controls-fitview",onClick:N,title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:c.jsx(uce,{})}),r&&c.jsx(zf,{className:"react-flow__controls-interactive",onClick:R,title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:b?c.jsx(fce,{}):c.jsx(dce,{})}),d]})}dP.displayName="Controls";const pce=v.memo(dP);function mce({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:b}=i||{},w=a||m||b;return c.jsx("rect",{className:En(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:o,strokeWidth:l},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const gce=v.memo(mce),yce=e=>e.nodes.map(t=>t.id),L0=e=>e instanceof Function?e:()=>e;function bce({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=gce,onClick:a}){const o=ft(yce,qt),l=L0(t),u=L0(e),d=L0(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:o.map(h=>c.jsx(xce,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Ece({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:d,y:f,width:h,height:p}=ft(m=>{const b=m.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const w=b.internals.userNode,{x:g,y:E}=b.internals.positionAbsolute,{width:y,height:_}=fi(w);return{node:w,x:g,y:E,width:y,height:_}},qt);return!u||u.hidden||!aD(u)?null:c.jsx(o,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:s,strokeColor:n(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const xce=v.memo(Ece);var wce=v.memo(bce);const vce=200,_ce=150,Tce=e=>!e.hidden,kce=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?sD(Ld(e.nodeLookup,{filter:Tce}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Nce="react-flow__minimap-desc";function fP({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:b=!1,zoomable:w=!1,ariaLabel:g,inversePan:E,zoomStep:y=1,offsetScale:_=5}){const k=Gt(),T=v.useRef(null),{boundingRect:C,viewBB:N,rfId:R,panZoom:I,translateExtent:M,flowWidth:B,flowHeight:Y,ariaLabelConfig:P}=ft(kce,qt),U=(e==null?void 0:e.width)??vce,A=(e==null?void 0:e.height)??_ce,L=C.width/U,O=C.height/A,j=Math.max(L,O),S=j*U,H=j*A,V=_*j,D=C.x-(S-C.width)/2-V,ne=C.y-(H-C.height)/2-V,J=S+V*2,re=H+V*2,de=`${Nce}-${R}`,G=v.useRef(0),W=v.useRef();G.current=j,v.useEffect(()=>{if(T.current&&I)return W.current=Sae({domNode:T.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>G.current}),()=>{var ce;(ce=W.current)==null||ce.destroy()}},[I]),v.useEffect(()=>{var ce;(ce=W.current)==null||ce.update({translateExtent:M,width:B,height:Y,inversePan:E,pannable:b,zoomStep:y,zoomable:w})},[b,w,E,y,M,B,Y]);const ae=p?ce=>{var ge;const[Ce,Ee]=((ge=W.current)==null?void 0:ge.pointer(ce))||[0,0];p(ce,{x:Ce,y:Ee})}:void 0,he=m?v.useCallback((ce,Ce)=>{const Ee=k.getState().nodeLookup.get(Ce).internals.userNode;m(ce,Ee)},[]):void 0,Z=g??P["minimap.ariaLabel"];return c.jsx(zm,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*j:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:En(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:U,height:A,viewBox:`${D} ${ne} ${J} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:T,onClick:ae,children:[Z&&c.jsx("title",{id:de,children:Z}),c.jsx(wce,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${D-V},${ne-V}h${J+V*2}v${re+V*2}h${-J-V*2}z - M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}fP.displayName="MiniMap";const Sce=v.memo(fP),Ace=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Cce={[Cl.Line]:"right",[Cl.Handle]:"bottom-right"};function Ice({nodeId:e,position:t,variant:n=Cl.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:b,onResize:w,onResizeEnd:g}){const E=zD(),y=typeof e=="string"?e:E,_=Gt(),k=v.useRef(null),T=n===Cl.Handle,C=ft(v.useCallback(Ace(T&&p),[T,p]),qt),N=v.useRef(null),R=t??Cce[n];v.useEffect(()=>{if(!(!k.current||!y))return N.current||(N.current=Uae({domNode:k.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:M,transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U,domNode:A}=_.getState();return{nodeLookup:M,transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U,paneDomNode:A}},onChange:(M,B)=>{const{triggerNodeChanges:Y,nodeLookup:P,parentLookup:U,nodeOrigin:A}=_.getState(),L=[],O={x:M.x,y:M.y},j=P.get(y);if(j&&j.expandParent&&j.parentId){const S=j.origin??A,H=M.width??j.measured.width??0,V=M.height??j.measured.height??0,D={id:j.id,parentId:j.parentId,rect:{width:H,height:V,...oD({x:M.x??j.position.x,y:M.y??j.position.y},{width:H,height:V},j.parentId,P,S)}},ne=Qx([D],P,U,A);L.push(...ne),O.x=M.x?Math.max(S[0]*H,M.x):void 0,O.y=M.y?Math.max(S[1]*V,M.y):void 0}if(O.x!==void 0&&O.y!==void 0){const S={id:y,type:"position",position:{...O}};L.push(S)}if(M.width!==void 0&&M.height!==void 0){const H={id:y,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};L.push(H)}for(const S of B){const H={...S,type:"position"};L.push(H)}Y(L)},onEnd:({width:M,height:B})=>{const Y={id:y,type:"dimensions",resizing:!1,dimensions:{width:M,height:B}};_.getState().triggerNodeChanges([Y])}})),N.current.update({controlPosition:R,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:w,onResizeEnd:g,shouldResize:m}),()=>{var M;(M=N.current)==null||M.destroy()}},[R,o,l,u,d,f,b,w,g,m]);const I=R.split("-");return c.jsx("div",{className:En(["react-flow__resize-control","nodrag",...I,n,r]),ref:k,style:{...s,scale:C,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:i})}v.memo(Ice);const Rce=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:_F},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:nF},{type:"loop",label:"循环",desc:"节点循环执行",Icon:AE}];let q1=0;function M0(){return q1+=1,`node_${q1}`}function D0(e,t,n){const r=Gi();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function Oce({data:e,selected:t}){const n=e.agent;return c.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[c.jsx(Rl,{type:"target",position:De.Left,className:"wfb-handle"}),c.jsx("div",{className:"wfb-node-icon",children:c.jsx($a,{className:"icon"})}),c.jsxs("div",{className:"wfb-node-body",children:[c.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),c.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),c.jsx(Rl,{type:"source",position:De.Right,className:"wfb-handle"})]})}const Lce={agentNode:Oce},mS={type:"smoothstep",markerEnd:{type:Gu.ArrowClosed,width:16,height:16}};function Mce({onBack:e,onCreate:t}){const n=v.useRef(null),[r,s]=v.useState(""),[i,a]=v.useState(""),[o,l]=v.useState("sequential"),u=v.useMemo(()=>{q1=0;const A=M0();return D0(A,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=tce([u]),[p,m,b]=nce([]),[w,g]=v.useState(u.id),E=d.find(A=>A.id===w)??null,y=r.trim()||"workflow_agent",_=v.useMemo(()=>u3({name:y,subAgents:d.map(A=>A.data.agent)}),[y,d]),k=tl(y)??(_.has(y)?"名称须与 Agent 节点名称保持唯一":null),T=E?tl(E.data.agent.name)??(_.has(E.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,C=d.length>0&&k===null&&d.every(A=>tl(A.data.agent.name)===null&&!_.has(A.data.agent.name)),N=v.useCallback(A=>m(L=>BD({...A,...mS},L)),[m]),R=v.useCallback(()=>{const A=M0(),L=d.length*28,O=D0(A,{x:80+L,y:120+L});f(j=>j.concat(O)),g(A)},[d.length,f]),I=A=>{A.dataTransfer.setData("application/wfb-node","agentNode"),A.dataTransfer.effectAllowed="move"},M=v.useCallback(A=>{A.preventDefault(),A.dataTransfer.dropEffect="move"},[]),B=v.useCallback(A=>{if(A.preventDefault(),A.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const O=n.current.screenToFlowPosition({x:A.clientX,y:A.clientY}),j=M0(),S=D0(j,O);f(H=>H.concat(S)),g(j)},[f]),Y=v.useCallback(A=>{w&&f(L=>L.map(O=>O.id===w?{...O,data:{...O.data,agent:{...O.data.agent,...A}}}:O))},[w,f]),P=v.useCallback(()=>{w&&(f(A=>A.filter(L=>L.id!==w)),m(A=>A.filter(L=>L.source!==w&&L.target!==w)),g(null))},[w,f,m]),U=v.useCallback(()=>{if(!C)return;const A=d.map(O=>O.data.agent),L={...Gi(),name:y,description:i.trim(),instruction:i.trim(),subAgents:A,workflow:{type:o,nodes:d.map(O=>({id:O.id,agent:O.data.agent})),edges:p.map(O=>({from:O.source,to:O.target}))}};t(L)},[C,d,p,y,i,o,t]);return c.jsx("div",{className:"wfb",children:c.jsxs("div",{className:"wfb-grid",children:[c.jsxs("aside",{className:"wfb-palette",children:[c.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"名称"}),c.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:A=>s(A.target.value),placeholder:"my_workflow"}),k&&c.jsx("span",{className:"wfb-field-error",children:k})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"描述"}),c.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:A=>a(A.target.value),placeholder:"这个工作流做什么…",rows:2})]}),c.jsx("div",{className:"wfb-section-label",children:"执行方式"}),c.jsx("div",{className:"wfb-types",children:Rce.map(({type:A,label:L,desc:O,Icon:j})=>c.jsxs("button",{type:"button",className:`wfb-type ${o===A?"wfb-type--active":""}`,onClick:()=>l(A),children:[c.jsx(j,{className:"icon"}),c.jsxs("span",{className:"wfb-type-text",children:[c.jsx("span",{className:"wfb-type-name",children:L}),c.jsx("span",{className:"wfb-type-desc",children:O})]})]},A))}),c.jsx("div",{className:"wfb-section-label",children:"节点"}),c.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[c.jsx(bF,{className:"icon wfb-grip"}),c.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:c.jsx($a,{className:"icon"})}),c.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),c.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[c.jsx(hs,{className:"icon"}),"添加节点"]}),c.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),c.jsxs("div",{className:"wfb-canvas",children:[c.jsxs("button",{className:"wfb-create",onClick:U,disabled:!C,type:"button",children:[c.jsx(Ha,{className:"icon"}),"创建工作流"]}),c.jsxs(ece,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:b,onConnect:N,onInit:A=>n.current=A,nodeTypes:Lce,defaultEdgeOptions:mS,onDrop:B,onDragOver:M,onNodeClick:(A,L)=>g(L.id),onPaneClick:()=>g(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[c.jsx(oce,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),c.jsx(pce,{showInteractive:!1}),c.jsx(Sce,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),c.jsx("aside",{className:"wfb-inspector",children:E?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"wfb-inspector-head",children:[c.jsx("div",{className:"wfb-section-label",children:"节点配置"}),c.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:P,title:"删除节点",children:c.jsx(jl,{className:"icon"})})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"名称"}),c.jsx("input",{className:`wfb-input ${T?"wfb-input--error":""}`,value:E.data.agent.name,onChange:A=>Y({name:A.target.value}),placeholder:"agent_name"}),T?c.jsx("span",{className:"wfb-field-error",children:T}):c.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"描述"}),c.jsx("input",{className:"wfb-input",value:E.data.agent.description,onChange:A=>Y({description:A.target.value}),placeholder:"这个 agent 做什么…"})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),c.jsx("textarea",{className:"wfb-input wfb-textarea",value:E.data.agent.instruction,onChange:A=>Y({instruction:A.target.value}),placeholder:"你是一个…",rows:6})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),c.jsx("input",{className:"wfb-input",value:E.data.agent.tools.join(", "),onChange:A=>Y({tools:A.target.value.split(",").map(L=>L.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),c.jsxs("div",{className:"wfb-inspector-meta",children:[c.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),c.jsx("code",{className:"wfb-meta-val",children:E.id})]})]}):c.jsxs("div",{className:"wfb-inspector-empty",children:[c.jsx($a,{className:"wfb-empty-icon"}),c.jsx("p",{children:"选择一个节点以编辑其配置"}),c.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function Dce(e){return c.jsx(cP,{children:c.jsx(Mce,{...e})})}const Pce="/web/skill-creator";class ew extends Error{constructor(n,r){super(n);cw(this,"status");this.name="SkillCreatorApiError",this.status=r}}function io(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function Kt(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function hP(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function Dd(e,t){return fetch(Os(`${Pce}${e}`),{...t,headers:um({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function tw(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=io(await e.json(),"错误响应");return Kt(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function nw(e,t){if(!e.ok)throw new ew(await tw(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function jce(e){if(e==="queued")return"queued";if(e==="running")return"running";if(e==="succeeded")return"succeeded";if(e==="failed")return"failed";throw new Error(`未知的 Skill 生成状态:${String(e)}`)}function Bce(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Fce(e){return Array.isArray(e)?e.map((t,n)=>{const r=io(t,`文件 ${n+1}`),s=Kt(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=hP(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function Uce(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=Array.isArray(t.errors)?t.errors.map(String):[],r=Array.isArray(t.warnings)?t.warnings.map(String):[];return{valid:typeof t.valid=="boolean"?t.valid:n.length===0,errors:n,warnings:r}}function $ce(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=io(t,`活动 ${n+1}`),s=Kt(r,"id"),i=Kt(r,"kind"),a=Kt(r,"status");if(!s||!i||!["status","thinking","tool","message"].includes(i))throw new Error(`活动 ${n+1} 格式错误`);if(a!=="running"&&a!=="done")throw new Error(`活动 ${n+1} 状态错误`);if(i==="tool"){const l=Kt(r,"name");if(!l)throw new Error(`活动 ${n+1} 缺少工具名称`);return{id:s,kind:i,name:l,args:r.input,response:r.output,status:a}}const o=Kt(r,"text");if(!o)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:o,status:a}})}function Hce(e,t){const n=io(e,`候选方案 ${t+1}`),r=Kt(n,"id","candidate_id","candidateId"),s=Kt(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:Kt(n,"modelLabel","model_label")??s,status:jce(n.status),stage:Bce(n.stage),name:Kt(n,"name","skill_name","skillName"),description:Kt(n,"description"),skillMd:Kt(n,"skillMd","skill_md"),files:Fce(n.files),activities:$ce(n.activities),validation:Uce(n.validation),durationMs:hP(n,"elapsedMs","elapsed_ms"),error:Kt(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:Kt(n,"skill_id","skillId"),version:Kt(n,"version")}}function G1(e,t=""){const n=io(e,"Skill 创建任务"),r=Kt(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(Hce):[],i=Kt(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:Kt(n,"prompt")??t,status:i,candidates:s}}async function zce(e,t){const n=await Dd("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new ew(await tw(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=G1(await n.json(),e);return t==null||t(u),u}if(!r.includes("application/x-ndjson")||!n.body)throw new Error("创建 Skill 任务失败:服务端返回了非流式响应");const s=n.body.getReader(),i=new TextDecoder;let a="",o;const l=u=>{if(!u.trim())return;const d=io(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(Kt(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");o=G1(d.job,e),t==null||t(o)};for(;;){const{done:u,value:d}=await s.read();a+=i.decode(d,{stream:!u});const f=a.split(` -`);if(a=f.pop()??"",f.forEach(l),u)break}if(l(a),!o)throw new Error("创建 Skill 任务失败:服务端未返回任务");return o}async function Vce(e){const t=await Dd(`/jobs/${encodeURIComponent(e)}`);return G1(await nw(t,"读取 Skill 任务失败"))}async function Kce(e){const t=await Dd(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await nw(t,"清理 Skill 任务失败")}async function Yce(e,t){var o;const n=await Dd(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await tw(n,"下载 Skill 失败"));const s=((o=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:o[1])??"skill.zip",i=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=i,a.download=s,a.click(),URL.revokeObjectURL(i)}async function Wce(e,t,n){const r=await Dd(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=io(await nw(r,"添加到 AgentKit 失败"),"发布结果"),i=Kt(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:Kt(s,"name"),version:Kt(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:Kt(s,"message")}}const qce=()=>{};function Gce(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error("不支持的 Skill 对话活动")}function Xce({activities:e}){const t=v.useMemo(()=>e.filter(n=>n.kind!=="status").map(Gce),[e]);return t.length===0?null:c.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:c.jsx(mx,{blocks:t,onAction:qce})})}const gS={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},yS=12e4;function Qce({status:e}){return e==="succeeded"?c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):c.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function Zce(){return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),c.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function Jce(){return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function eue({candidate:e}){var l,u;const[t,n]=v.useState("SKILL.md"),r=e.files.find(d=>d.path.endsWith("SKILL.md")),s=e.skillMd&&!r?[{path:"SKILL.md",size:new Blob([e.skillMd]).size},...e.files]:e.files,i=s.find(d=>d.path===t)??s[0],a=(l=e.skillMd)==null?void 0:l.slice(0,yS),o=(((u=e.skillMd)==null?void 0:u.length)??0)>yS;return s.length===0?null:c.jsxs("div",{className:"skill-files",children:[c.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>c.jsx("button",{type:"button",role:"tab","aria-selected":(i==null?void 0:i.path)===d.path,className:(i==null?void 0:i.path)===d.path?"is-active":"",onClick:()=>n(d.path),children:d.path},d.path))}),e.skillMd&&(i!=null&&i.path.endsWith("SKILL.md"))?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"skill-files__content",children:c.jsx("code",{children:a})}),o?c.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):c.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function tue({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:o,onPublish:l}){const[u,d]=v.useState("conversation"),[f,h]=v.useState(!1),[p,m]=v.useState(!1),[b,w]=v.useState(""),[g,E]=v.useState(""),[y,_]=v.useState(""),[k,T]=v.useState(""),C=v.useRef(null),N=v.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",M=n.validation;return c.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[c.jsxs("header",{className:"skill-candidate__header",children:[c.jsx("h2",{children:n.model}),r?c.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?c.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[c.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[c.jsx("span",{className:"skill-candidate__status-icon",children:c.jsx(Qce,{status:n.status})}),R?c.jsx(Vl,{duration:2.2,spread:16,children:gS[n.stage]}):c.jsx("span",{children:gS[n.stage]}),n.durationMs!==void 0&&I?c.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),c.jsx(Xce,{activities:n.activities}),n.error?c.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?c.jsx("div",{className:"skill-candidate__view-actions",children:c.jsxs("button",{ref:C,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var B;return(B=N.current)==null?void 0:B.focus()})},children:[c.jsx(Zce,{}),"查看 Skill"]})}):null]}):c.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[c.jsx("div",{className:"skill-candidate__preview-nav",children:c.jsxs("button",{ref:N,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var B;return(B=C.current)==null?void 0:B.focus()})},children:[c.jsx(Jce,{}),"返回对话"]})}),c.jsxs("div",{className:"skill-candidate__result",children:[c.jsxs("div",{className:"skill-candidate__summary",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Skill"}),c.jsx("strong",{children:n.name??"未命名 Skill"})]}),c.jsxs("div",{children:[c.jsx("span",{children:"文件"}),c.jsx("strong",{children:n.files.length})]}),c.jsxs("div",{children:[c.jsx("span",{children:"校验"}),c.jsx("strong",{className:(M==null?void 0:M.valid)===!1?"is-invalid":"is-valid",children:(M==null?void 0:M.valid)===!1?"未通过":"已通过"})]})]}),n.description?c.jsx("p",{className:"skill-candidate__description",children:n.description}):null,M&&(M.errors.length>0||M.warnings.length>0)?c.jsxs("details",{className:"skill-validation",children:[c.jsx("summary",{children:"查看校验详情"}),[...M.errors,...M.warnings].map((B,Y)=>c.jsx("div",{children:B},`${B}-${Y}`))]}):null,c.jsx(eue,{candidate:n}),c.jsxs("div",{className:"skill-candidate__actions",children:[c.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:o,children:r?"已采用此方案":"采用此方案"}),c.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Yce(t,n.id).catch(B=>{w(B instanceof Error?B.message:String(B))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),c.jsx("button",{type:"button",className:"skill-action",disabled:!r||s||i||n.published,title:r?void 0:"请先采用此方案",onClick:()=>h(B=>!B),children:n.published?"已添加到 AgentKit":s?"正在添加…":"添加到 AgentKit"})]}),b?c.jsx("div",{className:"skill-candidate__error",children:b}):null,f&&r&&!n.published?c.jsxs("form",{className:"skill-publish-form",onSubmit:B=>{B.preventDefault();const Y=g.split(",").map(P=>P.trim()).filter(Boolean);l({skillSpaceIds:Y,...y.trim()?{projectName:y.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[c.jsxs("label",{children:[c.jsx("span",{children:"SkillSpace ID(可选)"}),c.jsx("input",{value:g,onChange:B=>E(B.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),c.jsxs("div",{className:"skill-publish-form__optional",children:[c.jsxs("label",{children:[c.jsx("span",{children:"项目名称(可选)"}),c.jsx("input",{value:y,onChange:B=>_(B.target.value)})]}),c.jsxs("label",{children:[c.jsx("span",{children:"已有 Skill ID(可选)"}),c.jsx("input",{value:k,onChange:B=>T(B.target.value)})]})]}),c.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?c.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const bS=new Set(["completed"]),Vf=1100,nue=3e4;function rue(e,t){return{id:`pending-${t}`,model:e,modelLabel:e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}}function sue({initialJob:e}){const[t,n]=v.useState(e),[r,s]=v.useState(""),[i,a]=v.useState(!1),[o,l]=v.useState(),[u,d]=v.useState(),[f,h]=v.useState(()=>new Set),[p,m]=v.useState({});v.useEffect(()=>{n(e),s(""),a(!1)},[e]),v.useEffect(()=>{if(bS.has(e.status)||e.id.startsWith("pending-"))return;let g=!1,E;const y=Date.now()+nue,_=async()=>{try{const k=await Vce(e.id);g||(n({...k,prompt:k.prompt||e.prompt}),s(""),bS.has(k.status)||(E=window.setTimeout(_,Vf)))}catch(k){if(!g){const T=k instanceof ew?k:void 0;if((T==null?void 0:T.status)===404&&Date.now(){g=!0,E!==void 0&&window.clearTimeout(E)}},[e.id,e.status]);const b=gx.map((g,E)=>t.candidates.find(y=>y.model===g)??t.candidates[E]??rue(g,E));async function w(g,E){d(g.id),m(y=>({...y,[g.id]:""}));try{await Wce(t.id,g.id,E),h(y=>new Set(y).add(g.id))}catch(y){m(_=>({..._,[g.id]:y instanceof Error?y.message:String(y)}))}finally{d(void 0)}}return c.jsxs("section",{className:"skill-workspace",children:[c.jsx("header",{className:"skill-workspace__intro",children:c.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?c.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,c.jsx("div",{className:"skill-workspace__grid",children:b.map((g,E)=>{const _=f.has(g.id)||g.published?{...g,published:!0}:g;return c.jsx(tue,{label:`方案 ${E===0?"A":"B"}`,jobId:t.id,candidate:_,selected:o===g.id,publishing:u===g.id,publishDisabled:u!==void 0&&u!==g.id,publishError:p[g.id],onSelect:()=>l(g.id),onPublish:k=>void w(g,k)},`${g.model}-${g.id}`)})})]})}const P0="/web/sandbox/sessions",iue=33e4,aue=6e5,oue=15e3;function j0(e){const t=um(e);return t.set("Accept","application/json"),t}async function B0(e,t){let n={};try{n=await e.json()}catch{return new Error(`${t}(HTTP ${e.status})`)}const r=n.detail,s=r&&typeof r=="object"&&"message"in r?r.message:r??n.message;return new Error(typeof s=="string"&&s?s:t)}async function lue(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],o=new Map;function l(){t==null||t(a.map(h=>({...h})))}function u(h){i+=h;const p=a[a.length-1];(p==null?void 0:p.kind)==="text"?p.text+=h:a.push({kind:"text",text:h}),l()}function d(h){if(typeof h.id!="string"||h.kind!=="thinking"&&h.kind!=="tool"||h.status!=="running"&&h.status!=="done")return;const p=h.status==="done";let m;if(h.kind==="thinking"){if(typeof h.text!="string"||!h.text)return;m={kind:"thinking",text:h.text,done:p}}else{if(typeof h.name!="string"||!h.name)return;m={kind:"tool",name:h.name,args:h.args,response:h.response,done:p}}const b=o.get(h.id);b===void 0?(o.set(h.id,a.length),a.push(m)):a[b]=m,l()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let b;try{b=JSON.parse(m.join(` -`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof b.message=="string"&&b.message?b.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(b),p==="delta"&&typeof b.text=="string"&&u(b.text),p==="done"&&!i&&typeof b.text=="string"&&u(b.text)}for(;;){const{done:h,value:p}=await n.read();s+=r.decode(p,{stream:!h});const m=s.split(/\r?\n\r?\n/);if(s=m.pop()??"",m.forEach(f),h)break}if(s.trim()&&f(s),a.length===0)throw new Error("沙箱未返回有效回复,请重试。");return{text:i,blocks:a}}const F0={async startSession(e={}){const t=await fetch(Os(P0),{method:"POST",headers:j0({"Content-Type":"application/json"}),signal:ti(e.signal,iue)});if(!t.ok)throw await B0(t,"无法启动 AgentKit 沙箱,请稍后重试。");const n=await t.json();if(!n.sessionId||n.status!=="ready")throw new Error("AgentKit 沙箱返回了无效的会话信息。");return{id:n.sessionId,toolName:"codex",createdAt:new Date().toISOString()}},async sendMessage(e,t={}){if(!e.sessionId||!e.text.trim())throw new Error("临时会话缺少有效的消息内容。");const n=await fetch(Os(`${P0}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:j0({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:ti(t.signal,aue)});if(!n.ok)throw await B0(n,"沙箱对话失败,请稍后重试。");return lue(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Os(`${P0}/${encodeURIComponent(e)}`),{method:"DELETE",headers:j0(),signal:ti(t.signal,oue)});if(!n.ok&&n.status!==404)throw await B0(n,"无法清理 AgentKit 沙箱会话。")}},cue=1e4;async function pP(e){const t=await fetch(Os(e),{headers:um({Accept:"application/json"}),signal:ti(void 0,cue)});if(!t.ok)throw new Error(`读取会话模式能力失败(HTTP ${t.status})`);const n=await t.json();if(typeof n.enabled!="boolean")throw new Error("会话模式能力响应格式错误");return{enabled:n.enabled,reason:typeof n.reason=="string"?n.reason:void 0}}async function uue(){return pP("/web/sandbox/capabilities")}async function due(){return pP("/web/skill-creator/capabilities")}function fue(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M12 3.5c.35 3.05 1.62 5.32 4.9 6.1-3.28.78-4.55 3.05-4.9 6.1-.35-3.05-1.62-5.32-4.9-6.1 3.28-.78 4.55-3.05 4.9-6.1Z"}),c.jsx("path",{d:"M18.5 14.5c.18 1.55.84 2.7 2.5 3.1-1.66.4-2.32 1.55-2.5 3.1-.18-1.55-.84-2.7-2.5-3.1 1.66-.4 2.32-1.55 2.5-3.1Z"}),c.jsx("path",{d:"M5.3 14.2c.14 1.15.62 2 1.85 2.3-1.23.3-1.71 1.15-1.85 2.3-.14-1.15-.62-2-1.85-2.3 1.23-.3 1.71-1.15 1.85-2.3Z"})]})}function hue({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=v.useRef(null),a=v.useRef(null);if(v.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],b=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),b.focus()):!h.shiftKey&&document.activeElement===b&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const o=t==="loading",l=o?"正在初始化沙箱":t==="error"?"启动失败":"启用临时会话";return Ua.createPortal(c.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!o&&r()},children:c.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[c.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[c.jsx("span",{className:"sandbox-dialog-orbit"}),c.jsx("span",{className:"sandbox-dialog-icon",children:o?c.jsx("span",{className:"sandbox-spinner"}):c.jsx(fue,{})})]}),c.jsxs("div",{className:"sandbox-dialog-copy",children:[c.jsx("h2",{id:"sandbox-dialog-title",children:l}),t==="error"?c.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):o?c.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建临时 Session,通常需要一点时间。"}):c.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex Agent 开启临时会话,您的会话将不会被持久化保存。"})]}),c.jsxs("footer",{className:"sandbox-dialog-actions",children:[c.jsx("button",{ref:a,type:"button",onClick:r,children:o?"取消启动":"取消"}),!o&&c.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function pue({onExit:e}){return c.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[c.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),c.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为临时会话,退出后对话内容消失"}),c.jsx("button",{type:"button",onClick:e,children:"退出临时会话"})]})}const ES=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function U0(e){let t=0;for(let n=0;n>>0;return ES[t%ES.length]}function mue(e){const t=new Map;e.forEach(u=>t.set(u.span_id,u));const n=new Map,r=[];for(const u of e)u.parent_span_id!=null&&t.has(u.parent_span_id)?(n.get(u.parent_span_id)??n.set(u.parent_span_id,[]).get(u.parent_span_id)).push(u):r.push(u);const s=(u,d)=>u.start_time-d.start_time,i=(u,d)=>({span:u,depth:d,children:(n.get(u.span_id)??[]).sort(s).map(f=>i(f,d+1))}),a=r.sort(s).map(u=>i(u,0)),o=e.length?Math.min(...e.map(u=>u.start_time)):0,l=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:o,total:l-o||1}}function gue(e,t){const n=[],r=s=>{n.push(s),t.has(s.span.span_id)||s.children.forEach(r)};return e.forEach(r),n}function xS(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const yue=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function wS(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:yue(t),value:r,long:r.length>80||r.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function bue({appName:e,sessionId:t,onClose:n}){const[r,s]=v.useState(null),[i,a]=v.useState(""),[o,l]=v.useState(new Set),[u,d]=v.useState(null);v.useEffect(()=>{s(null),a(""),VI(e,t).then(E=>{s(E),d(E.length?E.reduce((y,_)=>y.start_time<=_.start_time?y:_).span_id:null)}).catch(E=>a(String(E)))},[e,t]);const{rootNodes:f,min:h,total:p}=v.useMemo(()=>mue(r??[]),[r]),m=v.useMemo(()=>gue(f,o),[f,o]),b=(r==null?void 0:r.find(E=>E.span_id===u))??null,w=p/1e6,g=E=>l(y=>{const _=new Set(y);return _.has(E)?_.delete(E):_.add(E),_});return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"drawer-scrim",onClick:n}),c.jsxs("aside",{className:"drawer drawer--trace",children:[c.jsxs("header",{className:"drawer-head",children:[c.jsxs("div",{children:[c.jsx("div",{className:"drawer-title",children:"调用链路观测"}),c.jsx("div",{className:"drawer-sub",children:r?`${r.length} 个调用 · ${w.toFixed(1)} ms`:"加载中"})]}),c.jsx("button",{className:"drawer-close",onClick:n,"aria-label":"关闭",children:c.jsx(Gr,{className:"icon"})})]}),r==null&&!i&&c.jsxs("div",{className:"drawer-loading",children:[c.jsx(wt,{className:"icon spin"})," 加载调用链路…"]}),i&&c.jsx("div",{className:"error",children:i}),r&&r.length===0&&c.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),m.length>0&&c.jsxs("div",{className:"trace-split",children:[c.jsx("div",{className:"trace-tree scroll",children:m.map(E=>{const y=E.span,_=(y.start_time-h)/p*100,k=Math.max((y.end_time-y.start_time)/p*100,.6),T=E.children.length>0;return c.jsxs("button",{className:`trace-row ${u===y.span_id?"active":""}`,onClick:()=>d(y.span_id),children:[c.jsxs("span",{className:"trace-label",style:{paddingLeft:E.depth*14},children:[c.jsx("span",{className:`trace-caret ${T?"":"hidden"} ${o.has(y.span_id)?"":"open"}`,onClick:C=>{C.stopPropagation(),T&&g(y.span_id)},children:c.jsx(or,{className:"chev"})}),c.jsx("span",{className:"trace-dot",style:{background:U0(y.name)}}),c.jsx("span",{className:"trace-name",title:y.name,children:y.name})]}),c.jsx("span",{className:"trace-dur",children:xS(y.end_time-y.start_time)}),c.jsx("span",{className:"trace-track",children:c.jsx("span",{className:"trace-bar",style:{left:`${_}%`,width:`${k}%`,background:U0(y.name)}})})]},y.span_id)})}),c.jsx("div",{className:"trace-detail scroll",children:b?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"td-title",children:b.name}),c.jsxs("div",{className:"td-dur",children:[c.jsx("span",{className:"td-dot",style:{background:U0(b.name)}}),xS(b.end_time-b.start_time)]}),c.jsx("div",{className:"td-section",children:"属性"}),c.jsx("div",{className:"td-props",children:wS(b).filter(E=>!E.long).map(E=>c.jsxs("div",{className:"td-prop",children:[c.jsx("span",{className:"td-key",children:E.key}),c.jsx("span",{className:"td-val",children:E.value})]},E.key))}),wS(b).filter(E=>E.long).map(E=>c.jsxs("div",{className:"td-block",children:[c.jsx("div",{className:"td-section",children:E.key}),c.jsx("pre",{className:"td-pre",children:E.value})]},E.key))]}):c.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}function Eue(e){return e.toLowerCase()==="github"?c.jsx(yF,{className:"icon"}):c.jsx(kF,{className:"icon"})}function xue({branding:e,onUsername:t}){const[n,r]=v.useState(null),[s,i]=v.useState(""),[a,o]=v.useState(0),[l,u]=v.useState("");v.useEffect(()=>{let h=!0;return r(null),i(""),WF().then(p=>{h&&r(p)}).catch(p=>{h&&i(p instanceof Error?p.message:String(p))}),()=>{h=!1}},[a]);const d=KF.test(l),f=()=>{d&&t(l)};return c.jsxs("div",{className:"login",children:[c.jsx("header",{className:"login-top",children:c.jsxs("span",{className:"login-brand",children:[c.jsx("img",{className:"login-brand-logo",src:e.logoUrl||ux,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),c.jsx("main",{className:"login-main",children:c.jsxs("div",{className:"login-card",children:[c.jsx(Vl,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?c.jsxs("div",{className:"login-provider-error",role:"alert",children:[c.jsx("p",{children:s}),c.jsx("button",{type:"button",onClick:()=>o(h=>h+1),children:"重试"})]}):n===null?null:n.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"login-sub",children:"登录以继续使用"}),c.jsx("div",{className:"login-providers",children:n.map(h=>c.jsxs("button",{className:"login-btn",onClick:()=>qF(h.loginUrl),children:[Eue(h.id),c.jsxs("span",{children:["使用 ",h.label," 登录"]})]},h.id))})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),c.jsxs("form",{className:"login-name",onSubmit:h=>{h.preventDefault(),f()},children:[c.jsx("input",{className:"login-name-input",value:l,onChange:h=>u(h.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16,autoFocus:!0}),c.jsx("button",{type:"submit",className:"login-name-go",disabled:!d,"aria-label":"进入",children:c.jsx(EI,{className:"icon"})})]}),c.jsx("p",{className:"login-hint","aria-live":"polite",children:l&&!d?"只能包含大小写字母和数字,最多 16 位。":""})]}),c.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),c.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",c.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),c.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function wue({node:e,ctx:t}){const n=e.variant??"default";return c.jsx("button",{type:"button",className:`a2ui-button a2ui-button--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,onClick:()=>t.dispatchAction(e.action,e),children:t.render(e.child)})}so("Button",wue);function vue({node:e,ctx:t}){return c.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}so("Card",vue);const _ue={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},Tue={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function mP(e){return _ue[e]??"flex-start"}function gP(e){return Tue[e]??"stretch"}function kue({node:e,ctx:t}){const n=e.children??[];return c.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:mP(e.justify),alignItems:gP(e.align)},children:n.map(r=>t.render(r))})}so("Column",kue);function Nue({node:e}){const t=e.axis==="vertical";return c.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}so("Divider",Nue);const Sue={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function Aue({node:e}){const t=e.name??"";return c.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:Sue[t]??"•"})}so("Icon",Aue);function Cue({node:e,ctx:t}){const n=e.children??[];return c.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:mP(e.justify),alignItems:gP(e.align??"center")},children:n.map(r=>t.render(r))})}so("Row",Cue);const Iue=new Set(["h1","h2","h3","h4","h5"]);function Rue({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=Iue.has(n)?n:"p";return c.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}so("Text",Rue);const Oue="创建 Agent",Lue={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流"},wo={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},Mue=new Set,Due=[];function $s(){return{skills:[]}}function Pue(e,t){var r;const n=aR(e==null?void 0:e.events);if(n!=="新会话")return n;for(const s of t){if(s.role!=="user")continue;const i=(r=s.blocks.find(a=>a.kind==="text"))==null?void 0:r.text.trim();if(i)return i}return"新会话"}function yP(e,t){if(e.name===t)return e;for(const n of e.children){const r=yP(n,t);if(r)return r}}function bP(e){const t=[];for(const n of e.children)n.mentionable&&(t.push({name:n.name,description:n.description,type:n.type,path:n.path}),t.push(...bP(n)));return t}function vS(){const e=typeof localStorage<"u"?localStorage.getItem(wo.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function jue({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),c.jsx("path",{d:"M12 8.2l1.05 2.75 2.75 1.05-2.75 1.05L12 15.8l-1.05-2.75L8.2 12l2.75-1.05z",fill:"currentColor",stroke:"none"})]})}function Bue(){return c.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[c.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),c.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),c.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function EP(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Fue(e){if(!e)return"";const t=[];return e.ts&&t.push(EP(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function Uue(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const $ue="send_a2ui_json_to_client";function Hue(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"?t.files.length>0:t.kind==="tool"?!(t.name===$ue&&t.done):t.kind==="a2ui"?nM(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function zue(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function Vue(e){return new Promise((t,n)=>{let r="";try{r=new URL(e,window.location.href).protocol}catch{}if(r!=="http:"&&r!=="https:"){n(new Error("授权链接不是 http/https 地址,已阻止打开。"));return}const s=window.open(e,"veadk_oauth","width=520,height=720");if(!s){n(new Error("弹窗被拦截,请允许弹窗后重试。"));return}let i=!1;const a=()=>{clearInterval(u),window.removeEventListener("message",l)},o=d=>{if(!i){i=!0,a();try{s.close()}catch{}t(d)}},l=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&o(f.url)};window.addEventListener("message",l);const u=setInterval(()=>{if(!i){if(s.closed){a();const d=window.prompt("授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:");d&&d.trim()?(i=!0,t(d.trim())):n(new Error("授权已取消。"));return}try{const d=s.location.href;d&&d!=="about:blank"&&new URL(d).origin===window.location.origin&&/[?&](code|state|error)=/.test(d)&&o(d)}catch{}}},500)})}function Kue(e,t){const n=JSON.parse(JSON.stringify(e??{})),r=n.exchangedAuthCredential??n.exchanged_auth_credential??{},s=r.oauth2??{};return s.authResponseUri=t,s.auth_response_uri=t,r.oauth2=s,n.exchangedAuthCredential=r,n}function _S({text:e}){const[t,n]=v.useState(!1);return c.jsx("button",{className:"icon-btn",title:t?"已复制":"复制",disabled:!e,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?c.jsx(Ds,{className:"icon"}):c.jsx(_E,{className:"icon"})})}function Yue(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function Wue({tasks:e,onCancel:t}){const[n,r]=v.useState(!1),[s,i]=v.useState(null),a=e.filter(f=>f.status==="running").length,o=e[0],l=a>0?"running":(o==null?void 0:o.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(o==null?void 0:o.status)==="success"?"最近部署已完成":(o==null?void 0:o.status)==="error"?"最近部署失败":(o==null?void 0:o.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return c.jsxs("div",{className:"global-deploy-center",children:[c.jsxs("button",{type:"button",className:`global-deploy-task is-${l}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[l==="running"?c.jsx(wt,{className:"global-deploy-task-icon spin"}):l==="success"?c.jsx(oF,{className:"global-deploy-task-icon"}):l==="error"?c.jsx(_I,{className:"global-deploy-task-icon"}):l==="cancelled"?c.jsx(lF,{className:"global-deploy-task-icon"}):c.jsx(TF,{className:"global-deploy-task-icon"}),c.jsx("span",{className:"global-deploy-task-detail",children:u}),c.jsx(ip,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),c.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[c.jsxs("header",{className:"global-deploy-popover-head",children:[c.jsx("span",{children:"部署任务"}),c.jsx("span",{children:e.length})]}),c.jsx("div",{className:"global-deploy-list",children:e.length===0?c.jsx("div",{className:"global-deploy-empty",children:"暂无部署任务"}):e.map(f=>{const h=`${f.label}${f.status==="running"&&typeof f.pct=="number"?` ${Math.round(f.pct)}%`:""}`;return c.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[c.jsxs("div",{className:"global-deploy-item-head",children:[c.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),c.jsx("span",{className:"global-deploy-status",children:h})]}),c.jsxs("dl",{className:"global-deploy-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Runtime 名称"}),c.jsx("dd",{children:f.runtimeName})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"部署地域"}),c.jsx("dd",{children:Yue(f.region)})]}),f.runtimeId&&c.jsxs("div",{children:[c.jsx("dt",{children:"Runtime ID"}),c.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?c.jsx(Ap,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?c.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:c.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),c.jsx("div",{className:"global-deploy-item-actions",children:c.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const TS=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],kS=()=>TS[Math.floor(Math.random()*TS.length)];function $0(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function que(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Gue(e){var n;if(e.type)return e.type;const t=(n=e.name.split(".").pop())==null?void 0:n.toLowerCase();return t==="md"||t==="markdown"?"text/markdown":t==="txt"?"text/plain":"application/octet-stream"}function Xue(){const[e,t]=v.useState([]),[n,r]=v.useState(""),[s,i]=v.useState([]),[a,o]=v.useState(""),l=v.useRef(null),[u,d]=v.useState(!1),[f,h]=v.useState([]),[p,m]=v.useState(null),[b,w]=v.useState([]),[g,E]=v.useState(!1),[y,_]=v.useState(!1),[k,T]=v.useState("confirm"),[C,N]=v.useState(""),R=v.useRef(null),I=v.useRef(null),[M,B]=v.useState({}),Y=a?M[a]??[]:f,P=p?b:Y,U=p?"灵光一现":Pue(s.find(q=>q.id===a),P),A=(q,ee)=>B(xe=>({...xe,[q]:typeof ee=="function"?ee(xe[q]??[]):ee})),[L,O]=v.useState(""),[j,S]=v.useState("agent"),[H,V]=v.useState({}),[D,ne]=v.useState(null),[J,re]=v.useState(!1),de=v.useRef(0),[G,W]=v.useState([]),[ae,he]=v.useState($s),[Z,ce]=v.useState(null),[Ce,Ee]=v.useState(!1),ge=v.useRef(new Set),[Me,ve]=v.useState(()=>new Set),$e=v.useRef(new Map),Re=(q,ee)=>ve(xe=>{const Be=new Set(xe);return ee?Be.add(q):Be.delete(q),Be}),oe=v.useRef(""),[_t,we]=v.useState(""),[Tt,ct]=v.useState(!1),[K,X]=v.useState(kS),[le,ke]=v.useState(null),[Oe,ut]=v.useState(null),[We,ot]=v.useState(""),[Xt,It]=v.useState(),[Ge,bt]=v.useState(null),[$t,Tn]=v.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[Ue,rt]=v.useState("cloud"),[tt,gt]=v.useState(Lu),[ue,Le]=v.useState("chat"),[Qe,on]=v.useState(!1),[ln,ie]=v.useState(!1),[_e,ye]=v.useState(!1),[Pe,He]=v.useState({}),[qe,yt]=v.useState({}),[Rt,Ot]=v.useState({}),gn=Me.has(a)||u,Ht=p?g:gn,kn=Pe[a]??"",Jn=qe[a]??Mue,wr=Rt[a]??Due,Dn=Z==null?void 0:Z.graph,Hn=ae.targetAgent&&Dn?yP(Dn,ae.targetAgent.name):Dn,er=(Hn==null?void 0:Hn.skills)??(ae.targetAgent?[]:(Z==null?void 0:Z.skills)??[]),vr=Dn?bP(Dn):[];function zt(q){$0(q);for(const ee of q)ee.status==="uploading"?ge.current.add(ee.id):ee.uri&&lh(n,ee.uri).catch(xe=>we(String(xe)))}function Nn(){de.current+=1;const q=D;ne(null),re(!1),q&&!q.id.startsWith("pending-")&&Kce(q.id).catch(ee=>{we(ee instanceof Error?ee.message:String(ee))})}async function Pn(q){try{await n1(n,We,q),await t1(n,We,q),i(ee=>ee.filter(xe=>xe.id!==q)),B(ee=>{const{[q]:xe,...Be}=ee;return Be})}catch(ee){we(String(ee))}}function tr(q){const ee=G.find(Ke=>Ke.id===q);if(!ee)return;const xe=G.filter(Ke=>Ke.id!==q);$0([ee]),ee.status==="uploading"&&ge.current.add(q),W(xe),xe.length===0&&!L.trim()&&!!a&&P.length===0?(oe.current="",o(""),Pn(a)):ee.uri&&lh(n,ee.uri).catch(Ke=>we(String(Ke)))}const zn=(q,ee)=>{var Ye,Ve,Ze,Se,mt;const xe=ee.author&&ee.author!=="user"?ee.author:void 0;xe&&(He(Nt=>({...Nt,[q]:xe})),yt(Nt=>({...Nt,[q]:new Set(Nt[q]??[]).add(xe)})),Ot(Nt=>{var Lt;return(Lt=Nt[q])!=null&&Lt.length?Nt:{...Nt,[q]:[xe]}}));const Be=((Ye=ee.actions)==null?void 0:Ye.transferToAgent)??((Ve=ee.actions)==null?void 0:Ve.transfer_to_agent);Be&&Ot(Nt=>{const Lt=Nt[q]??[];return Lt[Lt.length-1]===Be?Nt:{...Nt,[q]:[...Lt,Be]}}),(((Ze=ee.actions)==null?void 0:Ze.endOfAgent)??((Se=ee.actions)==null?void 0:Se.end_of_agent)??((mt=ee.actions)==null?void 0:mt.escalate))&&Ot(Nt=>{const Lt=Nt[q]??[];return Lt.length<=1?Nt:{...Nt,[q]:Lt.slice(0,-1)}})},[Sn,st]=v.useState(vS),[An,jt]=v.useState([]),Qt=v.useCallback(q=>{jt(ee=>{const xe=ee.findIndex(Ke=>Ke.id===q.id);if(xe===-1)return[q,...ee];const Be=[...ee];return Be[xe]={...Be[xe],...q},Be})},[]),Cn=v.useCallback(async q=>{try{await GI(q.id),jt(ee=>ee.map(xe=>xe.id===q.id?{...xe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:xe))}catch(ee){const xe=ee instanceof Error?ee.message:String(ee);jt(Be=>Be.map(Ke=>Ke.id===q.id?{...Ke,message:`取消失败:${xe}`}:Ke))}},[]),[jn,xn]=v.useState(!0),[te,Ne]=v.useState(!1),[Ie,je]=v.useState(!1),[Et,ht]=v.useState(!1),[Zt,xt]=v.useState(null),[In,kt]=v.useState(!1),[Ym,_r]=v.useState(!1),na=v.useRef(null),[Ql,Zl]=v.useState(()=>{const q=Gs();return zl(q),q}),[Pd,jd]=v.useState(!1),Wm=v.useRef(!1),Bd=v.useRef(!1);function Fd(q){console.log("create agent draft:",q),st(null),ao()}function rw(q,ee){console.log("Agent added, navigating to:",q,ee),Zl(Gs()),st(null),r(q)}const{ref:xP,onScroll:wP}=rM(P),qm=v.useCallback(()=>{ut(null),XF().then(q=>{ot(q.userId),It(q.info),ie(!!q.local),ke(q.status)}).catch(q=>{ut(q instanceof Error?q.message:String(q))})},[]);v.useEffect(()=>{qm()},[qm]),v.useEffect(()=>{ln&&We&&H_(We)},[ln,We]),v.useEffect(()=>{if(le!=="authenticated"||!We){V({});return}let q=!1;return Promise.allSettled([uue(),due()]).then(([ee,xe])=>{q||V({temporaryEnabled:ee.status==="fulfilled"&&ee.value.enabled,skillCreateEnabled:xe.status==="fulfilled"&&xe.value.enabled})}),()=>{q=!0}},[le,We]),v.useEffect(()=>{if(le!=="authenticated"||!We){bt(null);return}let q=!1;return bt(null),JI().then(ee=>{q||bt(ee)}).catch(ee=>{console.warn("[app] /web/access failed; using ordinary-user access:",ee),q||bt(ZI)}),()=>{q=!0}},[le,We]),v.useEffect(()=>{QI().then(q=>{Tn(q.features),rt(q.agentsSource),gt(q.branding),Le(q.defaultView),on(!0)})},[]),v.useEffect(()=>{!Ge||!Qe||Bd.current||(Bd.current=!0,ue==="addAgent"&&Ge.capabilities.createAgents&&(st(null),Ne(!1),kt(!1),_r(!1),je(!1),ht(!0)))},[Ge,ue,Qe]),v.useEffect(()=>{Ge&&(Ge.capabilities.createAgents||(st(null),xt(null),je(!1),ht(!1),jt([])),Ge.capabilities.manageAgents||_r(!1))},[Ge]),v.useEffect(()=>{document.title=tt.title;let q=document.querySelector('link[rel~="icon"]');q||(q=document.createElement("link"),q.rel="icon",document.head.appendChild(q)),q.removeAttribute("type"),q.href=tt.logoUrl||ux},[tt]),v.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(q=>q.ok?q.json():null).then(q=>{q&&xn(!!q.credentials)}).catch(q=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",q)})},[]);function vP(q){H_(q),Wm.current=!0,Bd.current=!1,bt(null),st(null),xt(null),Ne(!1),je(!1),ht(!1),kt(!1),_r(!1),ao(),ot(q),It({name:q}),ie(!0),ke("authenticated")}function _P(){Bd.current=!1,bt(null),ln?(YF(),ot(""),It(void 0),ke("unauthenticated")):GF()}v.useEffect(()=>{le!=="unauthenticated"&&UI().then(q=>{if(t(q),Ue==="cloud"){r("");return}const ee=localStorage.getItem(wo.app),xe=Ql.flatMap(Ye=>Ye.apps.map(Ve=>Va(Ye.id,Ve))),Be=ee&&(q.includes(ee)||xe.includes(ee)),Ke=["web_search_agent","web_demo"].find(Ye=>q.includes(Ye))??q.find(Ye=>!/^\d/.test(Ye))??q[0];r(Be?ee:Ke||"")}).catch(q=>we(String(q)))},[le,Ue]),v.useEffect(()=>{n&&localStorage.setItem(wo.app,n)},[n]),v.useEffect(()=>{let q=!1;if(ce(null),he($s()),!n){Ee(!1);return}return Ee(!0),dd(n).then(ee=>{q||ce(ee)}).catch(()=>{q||ce(null)}).finally(()=>{q||Ee(!1)}),()=>{q=!0}},[n]),v.useEffect(()=>{Ge&&localStorage.setItem(wo.view,Ge.capabilities.createAgents?Sn??"chat":"chat")},[Ge,Sn]),v.useEffect(()=>{localStorage.setItem(wo.session,a),oe.current=a},[a]),v.useEffect(()=>()=>$e.current.forEach(q=>q.abort()),[]),v.useEffect(()=>()=>{var q,ee;(q=R.current)==null||q.abort(),(ee=I.current)==null||ee.abort()},[]),v.useEffect(()=>{!n||!We||(async()=>{const q=await Ud(n);if(!Wm.current){Wm.current=!0;const ee=localStorage.getItem(wo.session)||"";if(vS()===null&&ee&&q.some(xe=>xe.id===ee)){$d(ee);return}}ao()})()},[n,We]),v.useEffect(()=>{const q=na.current;q&&q.app===n&&(na.current=null,$d(q.sid))},[n]);function TP(q,ee){kt(!1),q===n?$d(ee):(na.current={app:q,sid:ee},r(q))}async function Ud(q){try{const ee=await OE(q,We),xe=await Promise.all(ee.map(Be=>{var Ke;return(Ke=Be.events)!=null&&Ke.length?Promise.resolve(Be):cp(q,We,Be.id)}));return i(xe),xe}catch(ee){return we(String(ee)),[]}}function kP(){p||(we(""),N(""),T("confirm"),_(!0))}function NP(){var q;(q=R.current)==null||q.abort(),R.current=null,_(!1),T("confirm"),N(""),!p&&j==="temporary"&&S("agent")}async function SP(){var ee;(ee=R.current)==null||ee.abort();const q=new AbortController;R.current=q,T("loading"),N("");try{const xe=await F0.startSession({signal:q.signal});if(R.current!==q)return;oe.current="",o(""),h([]),O(""),he($s()),S("temporary"),Nn(),re(!1),zt(G),W([]),w([]),m(xe),st(null),Ne(!1),je(!1),ht(!1),kt(!1),_r(!1),_(!1),T("confirm")}catch(xe){if((xe==null?void 0:xe.name)==="AbortError"||R.current!==q)return;N(xe instanceof Error?xe.message:String(xe)),T("error")}finally{R.current===q&&(R.current=null)}}function ra(){var ee;(ee=I.current)==null||ee.abort(),I.current=null,E(!1),w([]),O(""),we(""),S("agent");const q=p;m(null),q&&F0.closeSession(q.id).catch(xe=>we(String(xe)))}async function AP(q){var Ke;const ee=p;if(!ee||g||!q.trim())return;we("");const xe=new AbortController;(Ke=I.current)==null||Ke.abort(),I.current=xe;const Be=[{role:"user",blocks:[{kind:"text",text:q}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Ye=>[...Ye,...Be]),E(!0);try{const Ye=await F0.sendMessage({sessionId:ee.id,text:q},{signal:xe.signal,onBlocks:Ve=>{I.current===xe&&w(Ze=>{const Se=Ze.slice(),mt=Se[Se.length-1];return(mt==null?void 0:mt.role)==="assistant"&&(Se[Se.length-1]={...mt,blocks:Ve}),Se})}});if(I.current!==xe)return;w(Ve=>{const Ze=Ve.slice(),Se=Ze[Ze.length-1];return(Se==null?void 0:Se.role)==="assistant"&&(Ze[Ze.length-1]={...Se,blocks:Ye.blocks,meta:{ts:Date.now()/1e3}}),Ze})}catch(Ye){if((Ye==null?void 0:Ye.name)==="AbortError"||I.current!==xe)return;w(Ve=>Ve.slice(0,-2)),O(q),we(`临时会话发送失败:${Ye instanceof Error?Ye.message:String(Ye)}`)}finally{I.current===xe&&(I.current=null,E(!1))}}function ao(){ra(),we(""),X(kS()),S("agent"),Nn(),re(!1);const q=a&&Y.length===0&&G.length>0?a:"";oe.current="",o(""),d(!1),h([]),he($s()),zt(G),W([]),q&&Pn(q)}async function CP(q){var ee;try{(ee=$e.current.get(q))==null||ee.abort(),await n1(n,We,q),await t1(n,We,q),B(xe=>{const{[q]:Be,...Ke}=xe;return Ke}),q===a&&ao(),await Ud(n)}catch(xe){we(String(xe))}}async function $d(q){if(p&&ra(),q!==a&&(oe.current=q,we(""),d(!1),h([]),S("agent"),Nn(),he($s()),o(q),M[q]===void 0)){ye(!0);try{const ee=await cp(n,We,q);A(q,uU(ee.events??[]))}catch(ee){we(String(ee))}finally{ye(!1)}}}async function sw(q=!0){if(a)return a;l.current||(l.current=lp(n,We));const ee=l.current;try{const xe=await ee;q&&o(xe);const Be=Date.now()/1e3,Ke={id:xe,lastUpdateTime:Be,events:[]};return i(Ye=>[Ke,...Ye.filter(Ve=>Ve.id!==xe)]),xe}finally{l.current===ee&&(l.current=null)}}async function IP(q){we("");let ee;try{ee=await sw()}catch(Be){we(String(Be));return}const xe=Array.from(q).map(Be=>({file:Be,attachment:{id:que(),mimeType:Gue(Be),name:Be.name,sizeBytes:Be.size,status:"uploading"}}));W(Be=>[...Be,...xe.map(Ke=>Ke.attachment)]),await Promise.all(xe.map(async({file:Be,attachment:Ke})=>{try{const Ye=await $I(n,We,ee,Be);if(ge.current.delete(Ke.id)){Ye.uri&&await lh(n,Ye.uri);return}W(Ve=>Ve.map(Ze=>Ze.id===Ke.id?Ye:Ze))}catch(Ye){if(ge.current.delete(Ke.id))return;const Ve=Ye instanceof Error?Ye.message:String(Ye);W(Ze=>Ze.map(Se=>Se.id===Ke.id?{...Se,status:"error",error:Ve}:Se)),we(Ve)}}))}async function iw(q,ee=[],xe=$s()){if(!q.trim()&&ee.length===0||gn||!n||!We)return;we("");const Be=[];(xe.skills.length>0||xe.targetAgent)&&Be.push({kind:"invocation",value:xe}),ee.length&&Be.push({kind:"attachment",files:ee.map(Se=>({id:Se.id,mimeType:Se.mimeType,data:Se.data,uri:Se.uri,name:Se.name,sizeBytes:Se.sizeBytes}))}),q.trim()&&Be.push({kind:"text",text:q});const Ke=[{role:"user",blocks:Be,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Ye=!a;Ye&&(h(Ke),d(!0));let Ve;try{Ve=await sw(!Ye)}catch(Se){Ye&&(h([]),d(!1),O(q),he(xe)),we(String(Se));return}A(Ve,Se=>Ye?Ke:[...Se,...Ke]),Ye&&(oe.current=Ve,o(Ve),h([]),d(!1));const Ze=new AbortController;$e.current.set(Ve,Ze),Re(Ve,!0),oe.current=Ve,He(Se=>({...Se,[Ve]:""})),yt(Se=>({...Se,[Ve]:new Set})),Ot(Se=>({...Se,[Ve]:[]}));try{let Se=qs(),mt=0,Nt=Date.now()/1e3;for await(const Lt of Ou({appName:n,userId:We,sessionId:Ve,text:q,attachments:ee,invocation:xe,signal:Ze.signal})){if(Ze.signal.aborted)break;const hi=Lt.error??Lt.errorMessage??Lt.error_message;if(typeof hi=="string"&&hi){oe.current===Ve&&we(hi);break}zn(Ve,Lt),Se=pl(Se,Lt);const oo=Lt.usageMetadata??Lt.usage_metadata;oo!=null&&oo.totalTokenCount&&(mt=oo.totalTokenCount),Lt.timestamp&&(Nt=Lt.timestamp);const Zm=Se.blocks,ia={tokens:mt||void 0,ts:Nt};A(Ve,aa=>{const pi=aa.slice(),Vd=pi[pi.length-1];return(Vd==null?void 0:Vd.role)==="assistant"&&(pi[pi.length-1]={...Vd,blocks:Zm,meta:ia}),pi})}Ud(n)}catch(Se){(Se==null?void 0:Se.name)!=="AbortError"&&!Ze.signal.aborted&&oe.current===Ve&&we(String(Se))}finally{$e.current.get(Ve)===Ze&&$e.current.delete(Ve),Re(Ve,!1),He(Se=>({...Se,[Ve]:""})),Ot(Se=>({...Se,[Ve]:[]}))}}function RP(q,ee){var Ke,Ye;const xe=((Ke=q==null?void 0:q.event)==null?void 0:Ke.name)??ee.id,Be=((Ye=q==null?void 0:q.event)==null?void 0:Ye.context)??{};iw(`[ui-action] ${xe}: ${JSON.stringify(Be)}`)}async function OP(q){if(!q.authUri)throw new Error("事件中没有授权地址。");if(!n||!We||!a)throw new Error("会话尚未就绪。");const ee=a,xe=await Vue(q.authUri),Be=Kue(q.authConfig,xe),Ke=Se=>Se.map(mt=>mt.kind==="auth"&&!mt.done?{...mt,done:!0}:mt);A(ee,Se=>{const mt=Se.slice(),Nt=mt[mt.length-1];return(Nt==null?void 0:Nt.role)==="assistant"&&(mt[mt.length-1]={...Nt,blocks:Ke(Nt.blocks)}),mt});const Ye=P[P.length-1],Ve=Ke(Ye&&Ye.role==="assistant"?Ye.blocks:[]),Ze=new AbortController;$e.current.set(ee,Ze),Re(ee,!0);try{let Se=qs(),mt=0,Nt=Date.now()/1e3;for await(const Lt of Ou({appName:n,userId:We,sessionId:a,text:"",functionResponses:[{id:q.callId,name:"adk_request_credential",response:Be}],signal:Ze.signal})){if(Ze.signal.aborted)break;zn(ee,Lt),Se=pl(Se,Lt);const hi=Lt.usageMetadata??Lt.usage_metadata;hi!=null&&hi.totalTokenCount&&(mt=hi.totalTokenCount),Lt.timestamp&&(Nt=Lt.timestamp);const oo=[...Ve,...Se.blocks];A(ee,Zm=>{var pi;const ia=Zm.slice(),aa=ia[ia.length-1];return(aa==null?void 0:aa.role)==="assistant"&&(ia[ia.length-1]={...aa,blocks:oo,meta:{tokens:mt||((pi=aa.meta)==null?void 0:pi.tokens),ts:Nt}}),ia})}Ud(n)}catch(Se){(Se==null?void 0:Se.name)!=="AbortError"&&!Ze.signal.aborted&&oe.current===ee&&we(String(Se))}finally{$e.current.get(ee)===Ze&&$e.current.delete(ee),Re(ee,!1),He(Se=>({...Se,[ee]:""})),Ot(Se=>({...Se,[ee]:[]}))}}if(Oe)return c.jsxs("div",{className:"boot boot-error",children:[c.jsx("p",{children:Oe}),c.jsx("button",{type:"button",onClick:qm,children:"重试"})]});if(le===null)return c.jsx("div",{className:"boot"});if(le==="unauthenticated")return c.jsx(xue,{branding:tt,onUsername:vP});if(!Ge)return c.jsx("div",{className:"boot"});const sa=Ge.capabilities.createAgents,aw=Ge.capabilities.manageAgents,Es=sa?Sn:null,Gm=sa&&Et,Xm=sa&&Ie,ow=aw&&Ym,lw=KL(e,Ql),Hd=q=>{var ee;return((ee=lw.find(xe=>xe.id===q))==null?void 0:ee.label)??q},Jl=Ql.find(q=>q.runtimeId&&q.apps.some(ee=>Va(q.id,ee)===n)),zd=Jl&&Jl.runtimeId?{runtimeId:Jl.runtimeId,name:Jl.name,region:Jl.region??"cn-beijing"}:void 0,Qm=q=>{Zl(Gs()),oe.current="",o(""),r(q)},LP=async q=>{const ee=await cx(q.runtimeId,q.name,q.region);Qm(ee)};return c.jsxs("div",{className:"layout",children:[c.jsx(DZ,{branding:tt,access:Ge,agentsSource:Ue,localApps:e,currentAgentId:n,currentAgentLabel:n?Hd(n):"",currentRuntime:zd,onSelectAgent:Qm,features:$t,sessions:s,currentSessionId:a,streamingSids:Me,onNewChat:()=>{st(null),Ne(!1),je(!1),ht(!1),kt(!1),_r(!1),ao()},onSearch:()=>{p&&ra(),st(null),Ne(!1),je(!1),ht(!1),_r(!1),kt(!0),we("")},onQuickCreate:()=>{if(!sa){we("当前账号没有添加 Agent 的权限。");return}p&&ra(),oe.current="",o(""),Ne(!1),je(!1),kt(!1),_r(!1),st(null),xt(null),ht(!0),we("")},onSkillCenter:()=>{p&&ra(),st(null),je(!1),ht(!1),kt(!1),_r(!1),Ne(!0),we("")},onAddAgent:()=>{if(!sa){we("当前账号没有添加 Agent 的权限。");return}p&&ra(),oe.current="",st(null),Ne(!1),kt(!1),_r(!1),o(""),ht(!1),je(!0),we("")},onManageAgents:()=>{if(!aw){we("当前账号没有管理 Agent 的权限。");return}p&&ra(),oe.current="",o(""),st(null),Ne(!1),je(!1),ht(!1),kt(!1),_r(!0),we("")},onPickSession:q=>{st(null),Ne(!1),je(!1),ht(!1),kt(!1),_r(!1),we(""),$d(q)},onDeleteSession:CP,userInfo:Xt,onLogout:_P}),(()=>{const q=c.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&c.jsx(pue,{onExit:ao}),c.jsx(bJ,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Hd(n):"Agent",value:L,onChange:O,onSubmit:()=>{if(!p&&j==="skill-create"){const Ke=L.trim();if(!Ke||J)return;const Ye={id:`pending-${Date.now()}`,prompt:Ke,status:"provisioning",candidates:gx.map((Ze,Se)=>({id:`pending-${Se}`,model:Ze,modelLabel:Ze,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};re(!0);const Ve=++de.current;we(""),ne(Ye),O(""),zce(Ke,Ze=>{de.current===Ve&&ne(Ze)}).then(Ze=>{de.current===Ve&&ne(Ze)}).catch(Ze=>{de.current===Ve&&(ne(null),O(Ke),we(Ze instanceof Error?Ze.message:String(Ze)))}).finally(()=>{de.current===Ve&&re(!1)});return}const ee=L;if(O(""),p){AP(ee);return}const xe=G,Be=ae;W([]),he($s()),iw(ee,xe,Be),$0(xe)},disabled:p?!1:!We||j==="temporary"||j==="agent"&&!n,busy:p?g:j==="skill-create"?J:gn,showMeta:P.length>0&&!p,attachments:p?[]:G,skills:p?[]:er,agents:p?[]:vr,invocation:p?$s():ae,capabilitiesLoading:!p&&Ce,allowAttachments:!p,onInvocationChange:he,onAddFiles:IP,onRemoveAttachment:tr,newChatMode:p?"agent":j,newChatLayout:!p&&P.length===0&&D===null,showModeSelector:!p&&P.length===0&&D===null&&sa,temporaryEnabled:H.temporaryEnabled,skillCreateEnabled:H.skillCreateEnabled,onModeChange:ee=>{if(!(ee==="temporary"&&!H.temporaryEnabled||ee==="skill-create"&&!H.skillCreateEnabled)){if(ee==="temporary"){S(ee),kP();return}if(S(ee),we(""),ee==="skill-create"){he($s());const xe=a&&Y.length===0&&G.length>0?a:"";zt(G),W([]),xe&&(oe.current="",o(""),Pn(xe))}}}})]});return c.jsxs("section",{className:"main-shell",children:[c.jsx(PZ,{apps:lw.map(ee=>ee.id),appName:n,onAppChange:Qm,agentLabel:Hd,title:Gm?"添加 Agent":Xm?"添加 AgentKit 智能体":te?void 0:In?"搜索":ow?"管理 Agent":Es?void 0:U,crumbs:te?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:In||Xm||Gm||!Es?void 0:Es==="menu"?[{label:Oue,onClick:()=>{st(null),xt(null),ht(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>jd(!0)},{label:Lue[Es]}],rightContent:c.jsx(Wue,{tasks:sa?An:[],onCancel:Cn})}),c.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[_t&&c.jsx("div",{className:"error",children:_t}),_e&&c.jsxs("div",{className:"session-loading",children:[c.jsx(wt,{className:"icon spin"})," 加载会话…"]}),ow?c.jsx($Z,{currentRuntimeId:zd==null?void 0:zd.runtimeId,onConnect:LP}):Gm?c.jsx(dM,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:jue,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{ht(!1),xt(null),st("menu")}}]}):In?c.jsx(fZ,{userId:We,appId:n,agentInfo:Z,capabilitiesLoading:Ce,agentLabel:Hd,onOpenSession:TP}):Xm?c.jsx(UZ,{onAdded:ee=>{Zl(Gs()),je(!1),r(ee)},onCancel:()=>je(!1)}):te?c.jsx(eZ,{}):Es!==null&&!jn?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,height:"100%",padding:24,textAlign:"center",color:"var(--text-secondary, #6b7280)"},children:[c.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),c.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",c.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",c.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Es==="menu"?c.jsx(qee,{onSelect:ee=>{xt(null),st(ee)},onImport:ee=>{xt(ee),st("custom")}}):Es==="intelligent"?c.jsx(wte,{userId:We,onBack:()=>st("menu"),onCreate:Fd,onAgentAdded:rw,onDeploymentTaskChange:Qt}):Es==="custom"?c.jsx(sne,{initialDraft:Zt??void 0,onBack:()=>st("menu"),onCreate:Fd,onAgentAdded:rw,features:$t,onDeploymentTaskChange:Qt}):Es==="template"?c.jsx(one,{onBack:()=>st("menu"),onCreate:Fd}):Es==="workflow"?c.jsx(Dce,{onBack:()=>st("menu"),onCreate:Fd}):P.length===0&&D?c.jsx(sue,{initialJob:D}):P.length===0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"welcome",children:[c.jsx(Vl,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":j==="skill-create"?"想创建一个什么 Skill?":K}),q]}),!p&&j==="agent"?c.jsx(Fk,{appName:n,activeAgent:kn,seenAgents:Jn,execPath:wr}):null]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"transcript",ref:xP,onScroll:wP,children:P.map((ee,xe)=>{var Ye;const Be=xe===P.length-1;if(ee.role==="user"){const Ve=ee.blocks.map(mt=>mt.kind==="text"?mt.text:"").join(""),Ze=ee.blocks.flatMap(mt=>mt.kind==="attachment"?mt.files:[]),Se=ee.blocks.find(mt=>mt.kind==="invocation");return c.jsxs(Wt.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Se==null?void 0:Se.kind)==="invocation"&&c.jsx(fx,{value:Se.value}),Ze.length>0&&c.jsx(px,{appName:n,items:Ze}),Ve&&c.jsx("div",{className:"bubble",children:c.jsx(wd,{text:Ve})}),c.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ye=ee.meta)==null?void 0:Ye.ts)&&c.jsx("span",{className:"meta-text",children:EP(ee.meta.ts)}),c.jsx(_S,{text:Ve})]})]},xe)}const Ke=ee.blocks.length===0;return c.jsx(Wt.div,{className:"turn turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:Ke?Be&&Ht?c.jsx(uM,{}):null:c.jsxs(c.Fragment,{children:[c.jsx(mx,{appName:n,blocks:ee.blocks,onAction:RP,onAuth:OP}),!(Be&&Ht)&&!Hue(ee)&&c.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(Be&&Ht)&&!zue(ee)&&c.jsxs("div",{className:"turn-meta",children:[c.jsxs("div",{className:"turn-actions",children:[!p&&c.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>ct(!0),children:c.jsx(Bue,{})}),c.jsx(_S,{text:Uue(ee)})]}),ee.meta&&c.jsx("span",{className:"meta-text",children:Fue(ee.meta)})]})]})},xe)})}),!p&&c.jsx(Fk,{appName:n,activeAgent:kn,seenAgents:Jn,execPath:wr}),q]})]})]})})(),Tt&&a&&c.jsx(bue,{appName:n,sessionId:a,onClose:()=>ct(!1)}),c.jsx(hue,{open:y,state:k,error:C,onCancel:NP,onConfirm:()=>void SP()}),Pd&&c.jsx("div",{className:"confirm-scrim",onClick:()=>jd(!1),children:c.jsxs("div",{className:"confirm-box",onClick:q=>q.stopPropagation(),children:[c.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),c.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),c.jsxs("div",{className:"confirm-actions",children:[c.jsx("button",{className:"confirm-btn",onClick:()=>jd(!1),children:"取消"}),c.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{xt(null),st("menu"),jd(!1)},children:"确定返回"})]})]})})]})}(()=>{if(!(window.opener&&window.opener!==window&&/[?&](code|state|error)=/.test(window.location.search)))return!1;try{window.opener.postMessage({veadkOAuth:!0,url:window.location.href},window.location.origin)}catch{}return window.close(),!0})()||H0.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(b5,{reducedMotion:"user",children:c.jsx(Q9,{maskOpacity:.9,children:c.jsx(Xue,{})})})}));export{v as A,gm as B,Rr as C,tde as D,Gc as E,za as F,GR as G,Zue as R,Qn as V,et as a,ml as b,DT as c,nde as d,$E as e,TH as f,Pu as g,dt as h,$V as i,qV as j,NH as k,Ju as l,qK as m,CV as n,IV as o,nY as p,vK as q,_K as r,aO as s,c as t,Fe as u,Ct as v,it as w,ede as x,FV as y,Ua as z}; +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return v.useEffect(()=>{const l=(t==null?void 0:t.target)??Zk,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,g;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&dD(p))return!1;const y=eS(p.code,o);if(i.current.add(p[y]),Jk(a,i.current,!1)){const E=((g=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:g[0])||p.target,b=(E==null?void 0:E.nodeName)==="BUTTON"||(E==null?void 0:E.nodeName)==="A";t.preventDefault!==!1&&(s.current||!b)&&p.preventDefault(),r(!0)}},f=p=>{const m=eS(p.code,o);Jk(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[m]),p.key==="Meta"&&i.current.clear(),s.current=!1},h=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function Jk(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function eS(e,t){return t.includes(e)?"code":"key"}const joe=()=>{const e=Qt();return v.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Kx(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:o,y:l}=a.getBoundingClientRect(),u={x:t.x-o,y:t.y-l},d=n.snapGrid??s,f=n.snapToGrid??i;return Zl(u,r,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:i}=r.getBoundingClientRect(),a=Cl(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function jD(e,t){const n=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of t){const a=r.get(i.id);if(!a){n.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const o={...i};for(const l of a)Boe(l,o);n.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Boe(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function BD(e,t){return jD(e,t)}function FD(e,t){return jD(e,t)}function ya(e,t){return{id:e,type:"select",selected:t}}function Ko(e,t=new Set,n=!1){const r=[];for(const[s,i]of e){const a=t.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(n&&(i.selected=a),r.push(ya(i.id,a)))}return r}function tS({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=t.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&n.push({id:a.id,item:a,type:"replace"}),l===void 0&&n.push({item:a,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function nS(e){return{id:e.id,type:"remove"}}const Foe=oD();function UD(e,t,n={}){return dae(e,t,{...n,onError:n.onError??Foe})}const rS=e=>Xie(e),Uoe=e=>rD(e);function $D(e){return v.forwardRef(e)}const $oe=typeof window<"u"?v.useLayoutEffect:v.useEffect;function sS(e){const[t,n]=v.useState(BigInt(0)),[r]=v.useState(()=>Hoe(()=>n(s=>s+BigInt(1))));return $oe(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function Hoe(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const HD=v.createContext(null);function zoe({children:e}){const t=Qt(),n=v.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let y=l;for(const g of o)y=typeof g=="function"?g(y):g;let w=tS({items:y,lookup:h});for(const g of m.values())w=g(w);d&&u(y),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:E,setNodes:b}=t.getState();g&&b(E)})},[]),r=sS(n),s=v.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=l;for(const m of o)p=typeof m=="function"?m(p):m;d?u(p):f&&f(tS({items:p,lookup:h}))},[]),i=sS(s),a=v.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return c.jsx(HD.Provider,{value:a,children:e})}function Voe(){const e=v.useContext(HD);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Koe=e=>!!e.panZoom;function Zx(){const e=joe(),t=Qt(),n=Voe(),r=ft(Koe),s=v.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},o=f=>{n.edgeQueue.push(f)},l=f=>{var g,E;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=rS(f)?f:h.get(f.id),y=m.parentId?cD(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:y,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((E=m.measured)==null?void 0:E.height)??m.height};return Al(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(y=>{if(y.id===f){const w=typeof h=="function"?h(y):h;return p.replace&&rS(w)?w:{...y,...w}}return y}))},d=(f,h,p={replace:!1})=>{o(m=>m.map(y=>{if(y.id===f){const w=typeof h=="function"?h(y):h;return p.replace&&Uoe(w)?w:{...y,...w}}return y}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=i(f))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:o,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,y,w]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:y,onEdgesDelete:w,triggerNodeChanges:g,triggerEdgeChanges:E,onDelete:b,onBeforeDelete:_}=t.getState(),{nodes:N,edges:T}=await tae({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),A=T.length>0,k=N.length>0;if(A){const R=T.map(nS);w==null||w(T),E(R)}if(k){const R=N.map(nS);y==null||y(N),g(R)}return(k||A)&&(b==null||b({nodes:N,edges:T})),{deletedNodes:N,deletedEdges:T}},getIntersectingNodes:(f,h=!0,p)=>{const m=Lk(f),y=m?f:l(f),w=p!==void 0;return y?(p||t.getState().nodes).filter(g=>{const E=t.getState().nodeLookup.get(g.id);if(E&&!m&&(g.id===f.id||!E.internals.positionAbsolute))return!1;const b=Al(w?g:E),_=Zu(b,y);return h&&_>0||_>=b.width*b.height||_>=y.width*y.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const y=Lk(f)?f:l(f);if(!y)return!1;const w=Zu(y,h);return p&&w>0||w>=h.width*h.height||w>=y.width*y.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Qie(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??sae();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return v.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const iS=e=>e.selected,Yoe=typeof window<"u"?window:void 0;function Woe({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Qt(),{deleteElements:r}=Zx(),s=ed(e,{actInsideInputWithModifier:!1}),i=ed(t,{target:Yoe});v.useEffect(()=>{if(s){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(iS),edges:a.filter(iS)}),n.setState({nodesSelectionActive:!1})}},[s]),v.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function qoe(e){const t=Qt();v.useEffect(()=>{const n=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Yx(e.current);(r.height===0||r.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",gs.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Ym={position:"absolute",width:"100%",height:"100%",top:0,left:0},Goe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Xoe({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Da.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:y,noPanClassName:w,onViewportChange:g,isControlledViewport:E,paneClickDistance:b,selectionOnDrag:_}){const N=Qt(),T=v.useRef(null),{userSelectionActive:A,lib:k,connectionInProgress:R}=ft(Goe,Xt),I=ed(h),M=v.useRef();qoe(T);const B=v.useCallback(Y=>{g==null||g({x:Y[0],y:Y[1],zoom:Y[2]}),E||N.setState({transform:Y})},[g,E]);return v.useEffect(()=>{if(T.current){M.current=$ae({domNode:T.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:C=>N.setState(L=>L.paneDragging===C?L:{paneDragging:C}),onPanZoomStart:(C,L)=>{const{onViewportChangeStart:O,onMoveStart:j}=N.getState();j==null||j(C,L),O==null||O(L)},onPanZoom:(C,L)=>{const{onViewportChange:O,onMove:j}=N.getState();j==null||j(C,L),O==null||O(L)},onPanZoomEnd:(C,L)=>{const{onViewportChangeEnd:O,onMoveEnd:j}=N.getState();j==null||j(C,L),O==null||O(L)}});const{x:Y,y:P,zoom:U}=M.current.getViewport();return N.setState({panZoom:M.current,transform:[Y,P,U],domNode:T.current.closest(".react-flow")}),()=>{var C;(C=M.current)==null||C.destroy()}}},[]),v.useEffect(()=>{var Y;(Y=M.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:A,noWheelClassName:y,lib:k,onTransformChange:B,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:b})},[e,t,n,r,s,i,a,o,I,p,w,A,y,k,B,R,_,b]),c.jsx("div",{className:"react-flow__renderer",ref:T,style:Ym,children:m})}const Qoe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Zoe(){const{userSelectionActive:e,userSelectionRect:t}=ft(Qoe,Xt);return e&&t?c.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const L0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Joe=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ele({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xu.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:y}){const w=v.useRef(0),g=Qt(),{userSelectionActive:E,elementsSelectable:b,dragging:_,connectionInProgress:N,panBy:T,autoPanSpeed:A}=ft(Joe,Xt),k=b&&(e||E),R=v.useRef(null),I=v.useRef(),M=v.useRef(new Set),B=v.useRef(new Set),Y=v.useRef(!1),P=v.useRef({x:0,y:0}),U=v.useRef(!1),C=G=>{if(Y.current||N){Y.current=!1;return}u==null||u(G),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},L=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}d==null||d(G)},O=f?G=>f(G):void 0,j=G=>{Y.current&&(G.stopPropagation(),Y.current=!1)},S=G=>{var Le,ve;const{domNode:W,transform:oe}=g.getState();if(I.current=W==null?void 0:W.getBoundingClientRect(),!I.current)return;const he=G.target===R.current;if(!he&&!!G.target.closest(".nokey")||!e||!(a&&he||t)||G.button!==0||!G.isPrimary)return;(ve=(Le=G.target)==null?void 0:Le.setPointerCapture)==null||ve.call(Le,G.pointerId),Y.current=!1;const{x:Ce,y:Ee}=cs(G.nativeEvent,I.current),ge=Zl({x:Ce,y:Ee},oe);g.setState({userSelectionRect:{width:0,height:0,startX:ge.x,startY:ge.y,x:Ce,y:Ee}}),he||(G.stopPropagation(),G.preventDefault())};function H(G,W){const{userSelectionRect:oe}=g.getState();if(!oe)return;const{transform:he,nodeLookup:J,edgeLookup:ce,connectionLookup:Ce,triggerNodeChanges:Ee,triggerEdgeChanges:ge,defaultEdgeOptions:Le}=g.getState(),ve={x:oe.startX,y:oe.startY},{x:Ue,y:Ie}=Cl(ve,he),ae={startX:ve.x,startY:ve.y,x:Gct.id)),B.current=new Set;const vt=(Le==null?void 0:Le.selectable)??!0;for(const ct of M.current){const K=Ce.get(ct);if(K)for(const{edgeId:X}of K.values()){const le=ce.get(X);le&&(le.selectable??vt)&&B.current.add(X)}}if(!Mk(wt,M.current)){const ct=Ko(J,M.current,!0);Ee(ct)}if(!Mk(we,B.current)){const ct=Ko(ce,B.current);ge(ct)}g.setState({userSelectionRect:ae,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!s||!I.current)return;const[G,W]=Vx(P.current,I.current,A);T({x:G,y:W}).then(oe=>{if(!Y.current||!oe){w.current=requestAnimationFrame(V);return}const{x:he,y:J}=P.current;H(he,J),w.current=requestAnimationFrame(V)})}const D=()=>{cancelAnimationFrame(w.current),w.current=0,U.current=!1};v.useEffect(()=>()=>D(),[]);const ne=G=>{const{userSelectionRect:W,transform:oe,resetSelectedElements:he}=g.getState();if(!I.current||!W)return;const{x:J,y:ce}=cs(G.nativeEvent,I.current);P.current={x:J,y:ce};const Ce=Cl({x:W.startX,y:W.startY},oe);if(!Y.current){const Ee=t?0:i;if(Math.hypot(J-Ce.x,ce-Ce.y)<=Ee)return;he(),o==null||o(G)}Y.current=!0,U.current||(V(),U.current=!0),H(J,ce)},ee=G=>{var W,oe;G.button===0&&((oe=(W=G.target)==null?void 0:W.releasePointerCapture)==null||oe.call(W,G.pointerId),!E&&G.target===R.current&&g.getState().userSelectionRect&&(C==null||C(G)),g.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(l==null||l(G),g.setState({nodesSelectionActive:M.current.size>0})),D())},re=G=>{var W,oe;(oe=(W=G.target)==null?void 0:W.releasePointerCapture)==null||oe.call(W,G.pointerId),D()},de=r===!0||Array.isArray(r)&&r.includes(0);return c.jsxs("div",{className:xn(["react-flow__pane",{draggable:de,dragging:_,selection:e}]),onClick:k?void 0:L0(C,R),onContextMenu:L0(L,R),onWheel:L0(O,R),onPointerEnter:k?void 0:h,onPointerMove:k?ne:p,onPointerUp:k?ee:void 0,onPointerCancel:k?re:void 0,onPointerDownCapture:k?S:void 0,onClickCapture:k?j:void 0,onPointerLeave:m,ref:R,style:Ym,children:[y,c.jsx(Zoe,{})]})}function q1({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=t.getState(),u=o.get(e);if(!u){l==null||l("012",gs.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):s([e])}function zD({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Qt(),[l,u]=v.useState(!1),d=v.useRef();return v.useEffect(()=>{d.current=Sae({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{q1({id:f,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),v.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,r,t,i,e,s,a]),l}const tle=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function VD(){const e=Qt();return v.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=tle(a),p=s?i[0]:5,m=s?i[1]:5,y=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,g]of u){if(!h(g))continue;let E={x:g.internals.positionAbsolute.x+y,y:g.internals.positionAbsolute.y+w};s&&(E=Pd(E,i));const{position:b,positionAbsolute:_}=sD({nodeId:g.id,nextPosition:E,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:o});g.position=b,g.internals.positionAbsolute=_,f.set(g.id,g)}l(f)},[])}const Jx=v.createContext(null),nle=Jx.Provider;Jx.Consumer;const KD=()=>v.useContext(Jx),rle=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),sle=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:d,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:i===kl.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:d&&u}};function ile({type:e="source",position:t=De.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:d,onTouchStart:f,...h},p){var U,C;const m=a||null,y=e==="target",w=Qt(),g=KD(),{connectOnClick:E,noPanClassName:b,rfId:_}=ft(rle,Xt),{connectingFrom:N,connectingTo:T,clickConnecting:A,isPossibleEndHandle:k,connectionInProcess:R,clickConnectionInProcess:I,valid:M}=ft(sle(g,m,e),Xt);g||(C=(U=w.getState()).onError)==null||C.call(U,"010",gs.error010());const B=L=>{const{defaultEdgeOptions:O,onConnect:j,hasDefaultEdges:S}=w.getState(),H={...O,...L};if(S){const{edges:V,setEdges:D,onError:ne}=w.getState();D(UD(H,V,{onError:ne}))}j==null||j(H),o==null||o(H)},Y=L=>{if(!g)return;const O=fD(L.nativeEvent);if(s&&(O&&L.button===0||!O)){const j=w.getState();W1.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:y,handleId:m,nodeId:g,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...S)=>{var H,V;return(V=(H=w.getState()).onConnectEnd)==null?void 0:V.call(H,...S)},updateConnection:j.updateConnection,onConnect:B,isValidConnection:n||((...S)=>{var H,V;return((V=(H=w.getState()).isValidConnection)==null?void 0:V.call(H,...S))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}O?d==null||d(L):f==null||f(L)},P=L=>{const{onClickConnectStart:O,onClickConnectEnd:j,connectionClickStartHandle:S,connectionMode:H,isValidConnection:V,lib:D,rfId:ne,nodeLookup:ee,connection:re}=w.getState();if(!g||!S&&!s)return;if(!S){O==null||O(L.nativeEvent,{nodeId:g,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const de=uD(L.target),G=n||V,{connection:W,isValid:oe}=W1.isValid(L.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:H,fromNodeId:S.nodeId,fromHandleId:S.id||null,fromType:S.type,isValidConnection:G,flowId:ne,doc:de,lib:D,nodeLookup:ee});oe&&W&&B(W);const he=structuredClone(re);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,j==null||j(L,he),w.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${_}-${g}-${m}-${e}`,className:xn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!y,target:y,connectable:r,connectablestart:s,connectableend:i,clickconnecting:A,connectingfrom:N,connectingto:T,valid:M,connectionindicator:r&&(!R||k)&&(R||I?i:s)}]),onMouseDown:Y,onTouchStart:Y,onClick:E?P:void 0,ref:p,...h,children:l})}const Ol=v.memo($D(ile));function ale({data:e,isConnectable:t,sourcePosition:n=De.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Ol,{type:"source",position:n,isConnectable:t})]})}function ole({data:e,isConnectable:t,targetPosition:n=De.Top,sourcePosition:r=De.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Ol,{type:"source",position:r,isConnectable:t})]})}function lle(){return null}function cle({data:e,isConnectable:t,targetPosition:n=De.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Fp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},aS={input:ale,default:ole,output:cle,group:lle};function ule(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const dle=e=>{const{width:t,height:n,x:r,y:s}=Dd(e.nodeLookup,{filter:i=>!!i.selected});return{width:ls(t)?t:null,height:ls(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function fle({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Qt(),{width:s,height:i,transformString:a,userSelectionActive:o}=ft(dle,Xt),l=VD(),u=v.useRef(null);v.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!o&&s!==null&&i!==null;if(zD({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(y=>y.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Fp,p.key)&&(p.preventDefault(),l({direction:Fp[p.key],factor:p.shiftKey?4:1}))};return c.jsx("div",{className:xn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:c.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:s,height:i}})})}const oS=typeof window<"u"?window:void 0,hle=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function YD({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:y,zoomActivationKeyCode:w,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:_,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:k,autoPanOnSelection:R,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:Y,preventScrolling:P,onSelectionContextMenu:U,noWheelClassName:C,noPanClassName:L,disableKeyboardA11y:O,onViewportChange:j,isControlledViewport:S}){const{nodesSelectionActive:H,userSelectionActive:V}=ft(hle,Xt),D=ed(u,{target:oS}),ne=ed(y,{target:oS}),ee=ne||k,re=ne||_,de=d&&ee!==!0,G=D||V||de;return Woe({deleteKeyCode:l,multiSelectionKeyCode:m}),c.jsx(Xoe,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:re,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!D&&ee,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:Y,zoomActivationKeyCode:w,preventScrolling:P,noWheelClassName:C,noPanClassName:L,onViewportChange:j,isControlledViewport:S,paneClickDistance:o,selectionOnDrag:de,children:c.jsxs(ele,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ee,autoPanOnSelection:R,isSelecting:!!G,selectionMode:f,selectionKeyPressed:D,paneClickDistance:o,selectionOnDrag:de,children:[e,H&&c.jsx(fle,{onSelectionContextMenu:U,noPanClassName:L,disableKeyboardA11y:O})]})})}YD.displayName="FlowRenderer";const ple=v.memo(YD),mle=e=>t=>e?zx(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function gle(e){return ft(v.useCallback(mle(e),[e]),Xt)}const yle=e=>e.updateNodeInternals;function ble(){const e=ft(yle),[t]=v.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return v.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Ele({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Qt(),i=v.useRef(null),a=v.useRef(null),o=v.useRef(e.sourcePosition),l=v.useRef(e.targetPosition),u=v.useRef(t),d=n&&!!e.internals.handleBounds;return v.useEffect(()=>{i.current&&!e.hidden&&(!d||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[d,e.hidden]),v.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),v.useEffect(()=>{if(i.current){const f=u.current!==t,h=o.current!==e.sourcePosition,p=l.current!==e.targetPosition;(f||h||p)&&(u.current=t,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function xle({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:y,nodeTypes:w,nodeClickDistance:g,onError:E}){const{node:b,internals:_,isParent:N}=ft(G=>{const W=G.nodeLookup.get(e),oe=G.parentLookup.has(e);return{node:W,internals:W.internals,isParent:oe}},Xt);let T=b.type||"default",A=(w==null?void 0:w[T])||aS[T];A===void 0&&(E==null||E("003",gs.error003(T)),T="default",A=(w==null?void 0:w.default)||aS.default);const k=!!(b.draggable||o&&typeof b.draggable>"u"),R=!!(b.selectable||l&&typeof b.selectable>"u"),I=!!(b.connectable||u&&typeof b.connectable>"u"),M=!!(b.focusable||d&&typeof b.focusable>"u"),B=Qt(),Y=lD(b),P=Ele({node:b,nodeType:T,hasDimensions:Y,resizeObserver:f}),U=zD({nodeRef:P,disabled:b.hidden||!k,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:g}),C=VD();if(b.hidden)return null;const L=hi(b),O=ule(b),j=R||k||t||n||r||s,S=n?G=>n(G,{..._.userNode}):void 0,H=r?G=>r(G,{..._.userNode}):void 0,V=s?G=>s(G,{..._.userNode}):void 0,D=i?G=>i(G,{..._.userNode}):void 0,ne=a?G=>a(G,{..._.userNode}):void 0,ee=G=>{const{selectNodesOnDrag:W,nodeDragThreshold:oe}=B.getState();R&&(!W||!k||oe>0)&&q1({id:e,store:B,nodeRef:P}),t&&t(G,{..._.userNode})},re=G=>{if(!(dD(G.nativeEvent)||m)){if(J3.includes(G.key)&&R){const W=G.key==="Escape";q1({id:e,store:B,unselect:W,nodeRef:P})}else if(k&&b.selected&&Object.prototype.hasOwnProperty.call(Fp,G.key)){G.preventDefault();const{ariaLabelConfig:W}=B.getState();B.setState({ariaLiveMessage:W["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:Fp[G.key],factor:G.shiftKey?4:1})}}},de=()=>{var Ce;if(m||!((Ce=P.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:G,width:W,height:oe,autoPanOnNodeFocus:he,setCenter:J}=B.getState();if(!he)return;zx(new Map([[e,b]]),{x:0,y:0,width:W,height:oe},G,!0).length>0||J(b.position.x+L.width/2,b.position.y+L.height/2,{zoom:G[2]})};return c.jsx("div",{className:xn(["react-flow__node",`react-flow__node-${T}`,{[p]:k},b.className,{selected:b.selected,selectable:R,parent:N,draggable:k,dragging:U}]),ref:P,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:Y?"visible":"hidden",...b.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:S,onMouseMove:H,onMouseLeave:V,onContextMenu:D,onClick:ee,onDoubleClick:ne,onKeyDown:M?re:void 0,tabIndex:M?0:void 0,onFocus:M?de:void 0,role:b.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${MD}-${y}`,"aria-label":b.ariaLabel,...b.domAttributes,children:c.jsx(nle,{value:e,children:c.jsx(A,{id:e,data:b.data,type:T,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:b.selected??!1,selectable:R,draggable:k,deletable:b.deletable??!0,isConnectable:I,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:U,dragHandle:b.dragHandle,zIndex:_.z,parentId:b.parentId,...L})})})}var wle=v.memo(xle);const vle=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function WD(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=ft(vle,Xt),a=gle(e.onlyRenderVisibleElements),o=ble();return c.jsx("div",{className:"react-flow__nodes",style:Ym,children:a.map(l=>c.jsx(wle,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}WD.displayName="NodeRenderer";const _le=v.memo(WD);function Tle(e){return ft(v.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const i=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);i&&a&&lae({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Xt)}const Nle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},kle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},lS={[Qu.Arrow]:Nle,[Qu.ArrowClosed]:kle};function Sle(e){const t=Qt();return v.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(lS,e)?lS[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",gs.error009(e)),null)},[e])}const Ale=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=Sle(t);return l?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:c.jsx(l,{color:n,strokeWidth:a})}):null},qD=({defaultColor:e,rfId:t})=>{const n=ft(i=>i.edges),r=ft(i=>i.defaultEdgeOptions),s=v.useMemo(()=>gae(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:s.map(i=>c.jsx(Ale,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};qD.displayName="MarkerDefinitions";var Cle=v.memo(qD);function GD({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,...d}){const[f,h]=v.useState({x:1,y:0,width:0,height:0}),p=xn(["react-flow__edge-textwrapper",u]),m=v.useRef(null);return v.useEffect(()=>{if(m.current){const y=m.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&c.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),c.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),l]}):null}GD.displayName="EdgeText";const Ile=v.memo(GD);function Wm({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...d,d:e,fill:"none",className:xn(["react-flow__edge-path",d.className])}),u?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ls(t)&&ls(n)?c.jsx(Ile,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function cS({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===De.Left||e===De.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function XD({sourceX:e,sourceY:t,sourcePosition:n=De.Bottom,targetX:r,targetY:s,targetPosition:i=De.Top}){const[a,o]=cS({pos:n,x1:e,y1:t,x2:r,y2:s}),[l,u]=cS({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=hD({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${o} ${l},${u} ${r},${s}`,d,f,h,p]}function QD(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:g})=>{const[E,b,_]=XD({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),N=e.isInternal?void 0:t;return c.jsx(Wm,{id:N,path:E,labelX:b,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:g})})}const Rle=QD({isInternal:!1}),ZD=QD({isInternal:!0});Rle.displayName="SimpleBezierEdge";ZD.displayName="SimpleBezierEdgeInternal";function JD(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=De.Bottom,targetPosition:m=De.Top,markerEnd:y,markerStart:w,pathOptions:g,interactionWidth:E})=>{const[b,_,N]=V1({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),T=e.isInternal?void 0:t;return c.jsx(Wm,{id:T,path:b,labelX:_,labelY:N,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:w,interactionWidth:E})})}const eP=JD({isInternal:!1}),tP=JD({isInternal:!0});eP.displayName="SmoothStepEdge";tP.displayName="SmoothStepEdgeInternal";function nP(e){return v.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return c.jsx(eP,{...n,id:r,pathOptions:v.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Ole=nP({isInternal:!1}),rP=nP({isInternal:!0});Ole.displayName="StepEdge";rP.displayName="StepEdgeInternal";function sP(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})=>{const[w,g,E]=gD({sourceX:n,sourceY:r,targetX:s,targetY:i}),b=e.isInternal?void 0:t;return c.jsx(Wm,{id:b,path:w,labelX:g,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})})}const Lle=sP({isInternal:!1}),iP=sP({isInternal:!0});Lle.displayName="StraightEdge";iP.displayName="StraightEdgeInternal";function aP(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=De.Bottom,targetPosition:o=De.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,pathOptions:g,interactionWidth:E})=>{const[b,_,N]=pD({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:g==null?void 0:g.curvature}),T=e.isInternal?void 0:t;return c.jsx(Wm,{id:T,path:b,labelX:_,labelY:N,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:E})})}const Mle=aP({isInternal:!1}),oP=aP({isInternal:!0});Mle.displayName="BezierEdge";oP.displayName="BezierEdgeInternal";const uS={default:oP,straight:iP,step:rP,smoothstep:tP,simplebezier:ZD},dS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Dle=(e,t,n)=>n===De.Left?e-t:n===De.Right?e+t:e,Ple=(e,t,n)=>n===De.Top?e-t:n===De.Bottom?e+t:e,fS="react-flow__edgeupdater";function hS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return c.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:xn([fS,`${fS}-${o}`]),cx:Dle(t,r,e),cy:Ple(n,r,e),r,stroke:"transparent",fill:"transparent"})}function jle({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Qt(),y=(_,N)=>{if(_.button!==0)return;const{autoPanOnConnect:T,domNode:A,connectionMode:k,connectionRadius:R,lib:I,onConnectStart:M,cancelConnection:B,nodeLookup:Y,rfId:P,panBy:U,updateConnection:C}=m.getState(),L=N.type==="target",O=(H,V)=>{h(!1),f==null||f(H,n,N.type,V)},j=H=>u==null?void 0:u(n,H),S=(H,V)=>{h(!0),d==null||d(_,n,N.type),M==null||M(H,V)};W1.onPointerDown(_.nativeEvent,{autoPanOnConnect:T,connectionMode:k,connectionRadius:R,domNode:A,handleId:N.id,nodeId:N.nodeId,nodeLookup:Y,isTarget:L,edgeUpdaterType:N.type,lib:I,flowId:P,cancelConnection:B,panBy:U,isValidConnection:(...H)=>{var V,D;return((D=(V=m.getState()).isValidConnection)==null?void 0:D.call(V,...H))??!0},onConnect:j,onConnectStart:S,onConnectEnd:(...H)=>{var V,D;return(D=(V=m.getState()).onConnectEnd)==null?void 0:D.call(V,...H)},onReconnectEnd:O,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>y(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=_=>y(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>p(!0),b=()=>p(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(hS,{position:o,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:E,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&c.jsx(hS,{position:l,centerX:i,centerY:a,radius:t,onMouseDown:g,onMouseEnter:E,onMouseOut:b,type:"target"})]})}function Ble({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:y,noPanClassName:w,onError:g,disableKeyboardA11y:E}){let b=ft(J=>J.edgeLookup.get(e));const _=ft(J=>J.defaultEdgeOptions);b=_?{..._,...b}:b;let N=b.type||"default",T=(y==null?void 0:y[N])||uS[N];T===void 0&&(g==null||g("011",gs.error011(N)),N="default",T=(y==null?void 0:y.default)||uS.default);const A=!!(b.focusable||t&&typeof b.focusable>"u"),k=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),R=!!(b.selectable||r&&typeof b.selectable>"u"),I=v.useRef(null),[M,B]=v.useState(!1),[Y,P]=v.useState(!1),U=Qt(),{zIndex:C,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V}=ft(v.useCallback(J=>{const ce=J.nodeLookup.get(b.source),Ce=J.nodeLookup.get(b.target);if(!ce||!Ce)return{zIndex:b.zIndex,...dS};const Ee=mae({id:e,sourceNode:ce,targetNode:Ce,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:J.connectionMode,onError:g});return{zIndex:oae({selected:b.selected,zIndex:b.zIndex,sourceNode:ce,targetNode:Ce,elevateOnSelect:J.elevateEdgesOnSelect,zIndexMode:J.zIndexMode}),...Ee||dS}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Xt),D=v.useMemo(()=>b.markerStart?`url('#${K1(b.markerStart,m)}')`:void 0,[b.markerStart,m]),ne=v.useMemo(()=>b.markerEnd?`url('#${K1(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||L===null||O===null||j===null||S===null)return null;const ee=J=>{var ge;const{addSelectedEdges:ce,unselectNodesAndEdges:Ce,multiSelectionActive:Ee}=U.getState();R&&(U.setState({nodesSelectionActive:!1}),b.selected&&Ee?(Ce({nodes:[],edges:[b]}),(ge=I.current)==null||ge.blur()):ce([e])),s&&s(J,b)},re=i?J=>{i(J,{...b})}:void 0,de=a?J=>{a(J,{...b})}:void 0,G=o?J=>{o(J,{...b})}:void 0,W=l?J=>{l(J,{...b})}:void 0,oe=u?J=>{u(J,{...b})}:void 0,he=J=>{var ce;if(!E&&J3.includes(J.key)&&R){const{unselectNodesAndEdges:Ce,addSelectedEdges:Ee}=U.getState();J.key==="Escape"?((ce=I.current)==null||ce.blur(),Ce({edges:[b]})):Ee([e])}};return c.jsx("svg",{style:{zIndex:C},children:c.jsxs("g",{className:xn(["react-flow__edge",`react-flow__edge-${N}`,b.className,w,{selected:b.selected,animated:b.animated,inactive:!R&&!s,updating:M,selectable:R}]),onClick:ee,onDoubleClick:re,onContextMenu:de,onMouseEnter:G,onMouseMove:W,onMouseLeave:oe,onKeyDown:A?he:void 0,tabIndex:A?0:void 0,role:b.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":A?`${DD}-${m}`:void 0,ref:I,...b.domAttributes,children:[!Y&&c.jsx(T,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:R,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:D,markerEnd:ne,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),k&&c.jsx(jle,{edge:b,isReconnectable:k,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V,setUpdateHover:B,setReconnecting:P})]})})}var Fle=v.memo(Ble);const Ule=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function lP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:y}){const{edgesFocusable:w,edgesReconnectable:g,elementsSelectable:E,onError:b}=ft(Ule,Xt),_=Tle(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(Cle,{defaultColor:e,rfId:n}),_.map(N=>c.jsx(Fle,{id:N,edgesFocusable:w,edgesReconnectable:g,elementsSelectable:E,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:y},N))]})}lP.displayName="EdgeRenderer";const $le=v.memo(lP),Hle=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function zle({children:e}){const t=ft(Hle);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Vle(e){const t=Zx(),n=v.useRef(!1);v.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Kle=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Yle(e){const t=ft(Kle),n=Qt();return v.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Wle(e){return e.connection.inProgress?{...e.connection,to:Zl(e.connection.to,e.transform)}:{...e.connection}}function qle(e){return Wle}function Gle(e){const t=qle();return ft(t,Xt)}const Xle=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Qle({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=ft(Xle,Xt);return!(i&&s&&l)?null:c.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:xn(["react-flow__connection",nD(o)]),children:c.jsx(cP,{style:t,type:n,CustomComponent:r,isValid:o})})})}const cP=({style:e,type:t=Ci.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Gle();if(!s)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:h,connectionStatus:nD(r),toNode:d,toHandle:f,pointer:p});let m="";const y={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ci.Bezier:[m]=pD(y);break;case Ci.SimpleBezier:[m]=XD(y);break;case Ci.Step:[m]=V1({...y,borderRadius:0});break;case Ci.SmoothStep:[m]=V1(y);break;default:[m]=gD(y)}return c.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};cP.displayName="ConnectionLine";const Zle={};function pS(e=Zle){v.useRef(e),Qt(),v.useEffect(()=>{},[e])}function Jle(){Qt(),v.useRef(!1),v.useEffect(()=>{},[])}function uP({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:y,connectionLineComponent:w,connectionLineContainerStyle:g,selectionKeyCode:E,selectionOnDrag:b,selectionMode:_,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:k,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:M,translateExtent:B,minZoom:Y,maxZoom:P,preventScrolling:U,defaultMarkerColor:C,zoomOnScroll:L,zoomOnPinch:O,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:H,zoomOnDoubleClick:V,panOnDrag:D,autoPanOnSelection:ne,onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:de,onPaneMouseLeave:G,onPaneScroll:W,onPaneContextMenu:oe,paneClickDistance:he,nodeClickDistance:J,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:ge,reconnectRadius:Le,onReconnect:ve,onReconnectStart:Ue,onReconnectEnd:Ie,noDragClassName:ae,noWheelClassName:wt,noPanClassName:we,disableKeyboardA11y:vt,nodeExtent:ct,rfId:K,viewport:X,onViewportChange:le}){return pS(e),pS(t),Jle(),Vle(n),Yle(X),c.jsx(ple,{onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:de,onPaneMouseLeave:G,onPaneContextMenu:oe,onPaneScroll:W,paneClickDistance:he,deleteKeyCode:k,selectionKeyCode:E,selectionOnDrag:b,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:I,zoomOnScroll:L,zoomOnPinch:O,zoomOnDoubleClick:V,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:H,panOnDrag:D,autoPanOnSelection:ne,defaultViewport:M,translateExtent:B,minZoom:Y,maxZoom:P,onSelectionContextMenu:f,preventScrolling:U,noDragClassName:ae,noWheelClassName:wt,noPanClassName:we,disableKeyboardA11y:vt,onViewportChange:le,isControlledViewport:!!X,children:c.jsxs(zle,{children:[c.jsx($le,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:ve,onReconnectStart:Ue,onReconnectEnd:Ie,onlyRenderVisibleElements:R,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:ge,reconnectRadius:Le,defaultMarkerColor:C,noPanClassName:we,disableKeyboardA11y:vt,rfId:K}),c.jsx(Qle,{style:y,type:m,component:w,containerStyle:g}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(_le,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:J,onlyRenderVisibleElements:R,noPanClassName:we,noDragClassName:ae,disableKeyboardA11y:vt,nodeExtent:ct,rfId:K}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}uP.displayName="GraphView";const ece=v.memo(uP),tce=oD(),mS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,y=new Map,w=new Map,g=r??t??[],E=n??e??[],b=d??[0,0],_=f??Gu;ED(y,w,g);const{nodesInitialized:N}=Y1(E,p,m,{nodeOrigin:b,nodeExtent:_,zIndexMode:h});let T=[0,0,1];if(a&&s&&i){const A=Dd(p,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:k,y:R,zoom:I}=Kx(A,s,i,l,u,(o==null?void 0:o.padding)??.1);T=[k,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:T,nodes:E,nodesInitialized:N,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:w,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Gu,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:kl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...tD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:tce,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:eD,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nce=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>boe((p,m)=>{async function y(){const{nodeLookup:w,panZoom:g,fitViewOptions:E,fitViewResolver:b,width:_,height:N,minZoom:T,maxZoom:A}=m();g&&(await eae({nodes:w,width:_,height:N,panZoom:g,minZoom:T,maxZoom:A},E),b==null||b.resolve(!0),p({fitViewResolver:null}))}return{...mS({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:g,parentLookup:E,nodeOrigin:b,elevateNodesOnSelect:_,fitViewQueued:N,zIndexMode:T,nodesSelectionActive:A}=m(),{nodesInitialized:k,hasSelectedNodes:R}=Y1(w,g,E,{nodeOrigin:b,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:T}),I=A&&R;N&&k?(y(),p({nodes:w,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:k,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:g,edgeLookup:E}=m();ED(g,E,w),p({edges:w})},setDefaultNodesAndEdges:(w,g)=>{if(w){const{setNodes:E}=m();E(w),p({hasDefaultNodes:!0})}if(g){const{setEdges:E}=m();E(g),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:g,nodeLookup:E,parentLookup:b,domNode:_,nodeOrigin:N,nodeExtent:T,debug:A,fitViewQueued:k,zIndexMode:R}=m(),{changes:I,updatedInternals:M}=_ae(w,E,b,_,N,T,R);M&&(Eae(E,b,{nodeOrigin:N,nodeExtent:T,zIndexMode:R}),k?(y(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(A&&console.log("React Flow: trigger node changes",I),g==null||g(I)))},updateNodePositions:(w,g=!1)=>{const E=[];let b=[];const{nodeLookup:_,triggerNodeChanges:N,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:k}=m();for(const[R,I]of w){const M=_.get(R),B=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(I!=null&&I.position)),Y={id:R,type:"position",position:B?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:g};if(M&&T.inProgress&&T.fromNode.id===M.id){const P=Qa(M,T.fromHandle,De.Left,!0);A({...T,from:P})}B&&M.parentId&&E.push({id:R,parentId:M.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),b.push(Y)}if(E.length>0){const{parentLookup:R,nodeOrigin:I}=m(),M=Qx(E,_,R,I);b.push(...M)}for(const R of k.values())b=R(b);N(b)},triggerNodeChanges:w=>{const{onNodesChange:g,setNodes:E,nodes:b,hasDefaultNodes:_,debug:N}=m();if(w!=null&&w.length){if(_){const T=BD(w,b);E(T)}N&&console.log("React Flow: trigger node changes",w),g==null||g(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:g,setEdges:E,edges:b,hasDefaultEdges:_,debug:N}=m();if(w!=null&&w.length){if(_){const T=FD(w,b);E(T)}N&&console.log("React Flow: trigger edge changes",w),g==null||g(w)}},addSelectedNodes:w=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:N}=m();if(g){const T=w.map(A=>ya(A,!0));_(T);return}_(Ko(b,new Set([...w]),!0)),N(Ko(E))},addSelectedEdges:w=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:N}=m();if(g){const T=w.map(A=>ya(A,!0));N(T);return}N(Ko(E,new Set([...w]))),_(Ko(b,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:g}={})=>{const{edges:E,nodes:b,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:T}=m(),A=w||b,k=g||E,R=[];for(const M of A){if(!M.selected)continue;const B=_.get(M.id);B&&(B.selected=!1),R.push(ya(M.id,!1))}const I=[];for(const M of k)M.selected&&I.push(ya(M.id,!1));N(R),T(I)},setMinZoom:w=>{const{panZoom:g,maxZoom:E}=m();g==null||g.setScaleExtent([w,E]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:g,minZoom:E}=m();g==null||g.setScaleExtent([E,w]),p({maxZoom:w})},setTranslateExtent:w=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:g,triggerNodeChanges:E,triggerEdgeChanges:b,elementsSelectable:_}=m();if(!_)return;const N=g.reduce((A,k)=>k.selected?[...A,ya(k.id,!1)]:A,[]),T=w.reduce((A,k)=>k.selected?[...A,ya(k.id,!1)]:A,[]);E(N),b(T)},setNodeExtent:w=>{const{nodes:g,nodeLookup:E,parentLookup:b,nodeOrigin:_,elevateNodesOnSelect:N,nodeExtent:T,zIndexMode:A}=m();w[0][0]===T[0][0]&&w[0][1]===T[0][1]&&w[1][0]===T[1][0]&&w[1][1]===T[1][1]||(Y1(g,E,b,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:A}),p({nodeExtent:w}))},panBy:w=>{const{transform:g,width:E,height:b,panZoom:_,translateExtent:N}=m();return Tae({delta:w,panZoom:_,transform:g,translateExtent:N,width:E,height:b})},setCenter:async(w,g,E)=>{const{width:b,height:_,maxZoom:N,panZoom:T}=m();if(!T)return!1;const A=typeof(E==null?void 0:E.zoom)<"u"?E.zoom:N;return await T.setViewport({x:b/2-w*A,y:_/2-g*A,zoom:A},{duration:E==null?void 0:E.duration,ease:E==null?void 0:E.ease,interpolate:E==null?void 0:E.interpolate}),!0},cancelConnection:()=>{p({connection:{...tD}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...mS()})}},Object.is);function dP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=v.useState(()=>nce({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return c.jsx(Eoe,{value:m,children:c.jsx(zoe,{children:p})})}function rce({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return v.useContext(Vm)?c.jsx(c.Fragment,{children:e}):c.jsx(dP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const sce={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ice({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:g,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:N,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:k,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:M,onDelete:B,onSelectionChange:Y,onSelectionDragStart:P,onSelectionDrag:U,onSelectionDragStop:C,onSelectionContextMenu:L,onSelectionStart:O,onSelectionEnd:j,onBeforeDelete:S,connectionMode:H,connectionLineType:V=Ci.Bezier,connectionLineStyle:D,connectionLineComponent:ne,connectionLineContainerStyle:ee,deleteKeyCode:re="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:G=!1,selectionMode:W=Xu.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:he=Ju()?"Meta":"Control",zoomActivationKeyCode:J=Ju()?"Meta":"Control",snapToGrid:ce,snapGrid:Ce,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:ge,nodesDraggable:Le,autoPanOnNodeFocus:ve,nodesConnectable:Ue,nodesFocusable:Ie,nodeOrigin:ae=PD,edgesFocusable:wt,edgesReconnectable:we,elementsSelectable:vt=!0,defaultViewport:ct=Ooe,minZoom:K=.5,maxZoom:X=2,translateExtent:le=Gu,preventScrolling:Ne=!0,nodeExtent:Re,defaultMarkerColor:ut="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:ot=!0,panOnScroll:Zt=!1,panOnScrollSpeed:Ct=.5,panOnScrollMode:Ge=Da.Free,zoomOnDoubleClick:Et=!0,panOnDrag:Ht=!0,onPaneClick:Nn,onPaneMouseEnter:Fe,onPaneMouseMove:rt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:ue,paneClickDistance:Oe=1,nodeClickDistance:Qe=0,children:cn,onReconnect:an,onReconnectStart:ie,onReconnectEnd:_e,onEdgeContextMenu:ye,onEdgeDoubleClick:Pe,onEdgeMouseEnter:$e,onEdgeMouseMove:qe,onEdgeMouseLeave:gt,reconnectRadius:It=10,onNodesChange:Rt,onEdgesChange:gn,noDragClassName:yn="nodrag",noWheelClassName:zt="nowheel",noPanClassName:kn="nopan",fitView:er,fitViewOptions:_r,connectOnClick:Dn,attributionPosition:Hn,proOptions:tr,defaultEdgeOptions:Tr,elevateNodesOnSelect:Vt=!0,elevateEdgesOnSelect:Sn=!1,disableKeyboardA11y:Pn=!1,autoPanOnConnect:nr,autoPanOnNodeDrag:zn,autoPanOnSelection:An=!0,autoPanSpeed:st,connectionRadius:Cn,isValidConnection:Bt,onError:Jt,style:In,id:jn,nodeDragThreshold:wn,connectionDragThreshold:rr,viewport:Ot,onViewportChange:Z,width:ke,height:Me,colorMode:He="light",debug:Lt,onScroll:yt,ariaLabelConfig:Kt,zIndexMode:kt="basic",...fr},St){const ra=jn||"1",Jl=Poe(He),ec=v.useCallback(Bd=>{Bd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),yt==null||yt(Bd)},[yt]);return c.jsx("div",{"data-testid":"rf__wrapper",...fr,onScroll:ec,style:{...In,...sce},ref:St,className:xn(["react-flow",s,Jl]),id:jn,role:"application",children:c.jsxs(rce,{nodes:e,edges:t,width:ke,height:Me,fitView:er,fitViewOptions:_r,minZoom:K,maxZoom:X,nodeOrigin:ae,nodeExtent:Re,zIndexMode:kt,children:[c.jsx(Doe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:g,nodesDraggable:Le,autoPanOnNodeFocus:ve,nodesConnectable:Ue,nodesFocusable:Ie,edgesFocusable:wt,edgesReconnectable:we,elementsSelectable:vt,elevateNodesOnSelect:Vt,elevateEdgesOnSelect:Sn,minZoom:K,maxZoom:X,nodeExtent:Re,onNodesChange:Rt,onEdgesChange:gn,snapToGrid:ce,snapGrid:Ce,connectionMode:H,translateExtent:le,connectOnClick:Dn,defaultEdgeOptions:Tr,fitView:er,fitViewOptions:_r,onNodesDelete:I,onEdgesDelete:M,onDelete:B,onNodeDragStart:A,onNodeDrag:k,onNodeDragStop:R,onSelectionDrag:U,onSelectionDragStart:P,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:kn,nodeOrigin:ae,rfId:ra,autoPanOnConnect:nr,autoPanOnNodeDrag:zn,autoPanSpeed:st,onError:Jt,connectionRadius:Cn,isValidConnection:Bt,selectNodesOnDrag:ge,nodeDragThreshold:wn,connectionDragThreshold:rr,onBeforeDelete:S,debug:Lt,ariaLabelConfig:Kt,zIndexMode:kt}),c.jsx(ece,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:N,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:a,connectionLineType:V,connectionLineStyle:D,connectionLineComponent:ne,connectionLineContainerStyle:ee,selectionKeyCode:de,selectionOnDrag:G,selectionMode:W,deleteKeyCode:re,multiSelectionKeyCode:he,panActivationKeyCode:oe,zoomActivationKeyCode:J,onlyRenderVisibleElements:Ee,defaultViewport:ct,translateExtent:le,minZoom:K,maxZoom:X,preventScrolling:Ne,zoomOnScroll:We,zoomOnPinch:ot,zoomOnDoubleClick:Et,panOnScroll:Zt,panOnScrollSpeed:Ct,panOnScrollMode:Ge,panOnDrag:Ht,autoPanOnSelection:An,onPaneClick:Nn,onPaneMouseEnter:Fe,onPaneMouseMove:rt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:ue,paneClickDistance:Oe,nodeClickDistance:Qe,onSelectionContextMenu:L,onSelectionStart:O,onSelectionEnd:j,onReconnect:an,onReconnectStart:ie,onReconnectEnd:_e,onEdgeContextMenu:ye,onEdgeDoubleClick:Pe,onEdgeMouseEnter:$e,onEdgeMouseMove:qe,onEdgeMouseLeave:gt,reconnectRadius:It,defaultMarkerColor:ut,noDragClassName:yn,noWheelClassName:zt,noPanClassName:kn,rfId:ra,disableKeyboardA11y:Pn,nodeExtent:Re,viewport:Ot,onViewportChange:Z}),c.jsx(Roe,{onSelectionChange:Y}),cn,c.jsx(koe,{proOptions:tr,position:Hn}),c.jsx(Noe,{rfId:ra,disableKeyboardA11y:Pn})]})})}var ace=$D(ice);function oce(e){const[t,n]=v.useState(e),r=v.useCallback(s=>n(i=>BD(s,i)),[]);return[t,n,r]}function lce(e){const[t,n]=v.useState(e),r=v.useCallback(s=>n(i=>FD(s,i)),[]);return[t,n,r]}function cce({dimensions:e,lineWidth:t,variant:n,className:r}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xn(["react-flow__background-pattern",n,r])})}function uce({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:xn(["react-flow__background-pattern","dots",t])})}var Ki;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ki||(Ki={}));const dce={[Ki.Dots]:1,[Ki.Lines]:1,[Ki.Cross]:6},fce=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function fP({id:e,variant:t=Ki.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:d}){const f=v.useRef(null),{transform:h,patternId:p}=ft(fce,Xt),m=r||dce[t],y=t===Ki.Dots,w=t===Ki.Cross,g=Array.isArray(n)?n:[n,n],E=[g[0]*h[2]||1,g[1]*h[2]||1],b=m*h[2],_=Array.isArray(i)?i:[i,i],N=w?[b,b]:E,T=[_[0]*h[2]||1+N[0]/2,_[1]*h[2]||1+N[1]/2],A=`${p}${e||""}`;return c.jsxs("svg",{className:xn(["react-flow__background",u]),style:{...l,...Ym,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[c.jsx("pattern",{id:A,x:h[0]%E[0],y:h[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:y?c.jsx(uce,{radius:b/2,className:d}):c.jsx(cce,{dimensions:N,lineWidth:s,variant:t,className:d})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}fP.displayName="Background";const hce=v.memo(fP);function pce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function mce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function gce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function yce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function bce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Kf({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:xn(["react-flow__controls-button",t]),...n,children:e})}const Ece=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function hP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Qt(),{isInteractive:y,minZoomReached:w,maxZoomReached:g,ariaLabelConfig:E}=ft(Ece,Xt),{zoomIn:b,zoomOut:_,fitView:N}=Zx(),T=()=>{b(),i==null||i()},A=()=>{_(),a==null||a()},k=()=>{N(s),o==null||o()},R=()=>{m.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),l==null||l(!y)},I=h==="horizontal"?"horizontal":"vertical";return c.jsxs(Km,{className:xn(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??E["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(Kf,{onClick:T,className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:g,children:c.jsx(pce,{})}),c.jsx(Kf,{onClick:A,className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:w,children:c.jsx(mce,{})})]}),n&&c.jsx(Kf,{className:"react-flow__controls-fitview",onClick:k,title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:c.jsx(gce,{})}),r&&c.jsx(Kf,{className:"react-flow__controls-interactive",onClick:R,title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:y?c.jsx(bce,{}):c.jsx(yce,{})}),d]})}hP.displayName="Controls";const xce=v.memo(hP);function wce({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:y}=i||{},w=a||m||y;return c.jsx("rect",{className:xn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:o,strokeWidth:l},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const vce=v.memo(wce),_ce=e=>e.nodes.map(t=>t.id),M0=e=>e instanceof Function?e:()=>e;function Tce({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=vce,onClick:a}){const o=ft(_ce,Xt),l=M0(t),u=M0(e),d=M0(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:o.map(h=>c.jsx(kce,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Nce({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:d,y:f,width:h,height:p}=ft(m=>{const y=m.nodeLookup.get(e);if(!y)return{node:void 0,x:0,y:0,width:0,height:0};const w=y.internals.userNode,{x:g,y:E}=y.internals.positionAbsolute,{width:b,height:_}=hi(w);return{node:w,x:g,y:E,width:b,height:_}},Xt);return!u||u.hidden||!lD(u)?null:c.jsx(o,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:s,strokeColor:n(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const kce=v.memo(Nce);var Sce=v.memo(Tce);const Ace=200,Cce=150,Ice=e=>!e.hidden,Rce=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?aD(Dd(e.nodeLookup,{filter:Ice}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Oce="react-flow__minimap-desc";function pP({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:y=!1,zoomable:w=!1,ariaLabel:g,inversePan:E,zoomStep:b=1,offsetScale:_=5}){const N=Qt(),T=v.useRef(null),{boundingRect:A,viewBB:k,rfId:R,panZoom:I,translateExtent:M,flowWidth:B,flowHeight:Y,ariaLabelConfig:P}=ft(Rce,Xt),U=(e==null?void 0:e.width)??Ace,C=(e==null?void 0:e.height)??Cce,L=A.width/U,O=A.height/C,j=Math.max(L,O),S=j*U,H=j*C,V=_*j,D=A.x-(S-A.width)/2-V,ne=A.y-(H-A.height)/2-V,ee=S+V*2,re=H+V*2,de=`${Oce}-${R}`,G=v.useRef(0),W=v.useRef();G.current=j,v.useEffect(()=>{if(T.current&&I)return W.current=Lae({domNode:T.current,panZoom:I,getTransform:()=>N.getState().transform,getViewScale:()=>G.current}),()=>{var ce;(ce=W.current)==null||ce.destroy()}},[I]),v.useEffect(()=>{var ce;(ce=W.current)==null||ce.update({translateExtent:M,width:B,height:Y,inversePan:E,pannable:y,zoomStep:b,zoomable:w})},[y,w,E,b,M,B,Y]);const oe=p?ce=>{var ge;const[Ce,Ee]=((ge=W.current)==null?void 0:ge.pointer(ce))||[0,0];p(ce,{x:Ce,y:Ee})}:void 0,he=m?v.useCallback((ce,Ce)=>{const Ee=N.getState().nodeLookup.get(Ce).internals.userNode;m(ce,Ee)},[]):void 0,J=g??P["minimap.ariaLabel"];return c.jsx(Km,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*j:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:xn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:U,height:C,viewBox:`${D} ${ne} ${ee} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:T,onClick:oe,children:[J&&c.jsx("title",{id:de,children:J}),c.jsx(Sce,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${D-V},${ne-V}h${ee+V*2}v${re+V*2}h${-ee-V*2}z + M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}pP.displayName="MiniMap";const Lce=v.memo(pP),Mce=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Dce={[Il.Line]:"right",[Il.Handle]:"bottom-right"};function Pce({nodeId:e,position:t,variant:n=Il.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:y,onResize:w,onResizeEnd:g}){const E=KD(),b=typeof e=="string"?e:E,_=Qt(),N=v.useRef(null),T=n===Il.Handle,A=ft(v.useCallback(Mce(T&&p),[T,p]),Xt),k=v.useRef(null),R=t??Dce[n];v.useEffect(()=>{if(!(!N.current||!b))return k.current||(k.current=Yae({domNode:N.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:M,transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U,domNode:C}=_.getState();return{nodeLookup:M,transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U,paneDomNode:C}},onChange:(M,B)=>{const{triggerNodeChanges:Y,nodeLookup:P,parentLookup:U,nodeOrigin:C}=_.getState(),L=[],O={x:M.x,y:M.y},j=P.get(b);if(j&&j.expandParent&&j.parentId){const S=j.origin??C,H=M.width??j.measured.width??0,V=M.height??j.measured.height??0,D={id:j.id,parentId:j.parentId,rect:{width:H,height:V,...cD({x:M.x??j.position.x,y:M.y??j.position.y},{width:H,height:V},j.parentId,P,S)}},ne=Qx([D],P,U,C);L.push(...ne),O.x=M.x?Math.max(S[0]*H,M.x):void 0,O.y=M.y?Math.max(S[1]*V,M.y):void 0}if(O.x!==void 0&&O.y!==void 0){const S={id:b,type:"position",position:{...O}};L.push(S)}if(M.width!==void 0&&M.height!==void 0){const H={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};L.push(H)}for(const S of B){const H={...S,type:"position"};L.push(H)}Y(L)},onEnd:({width:M,height:B})=>{const Y={id:b,type:"dimensions",resizing:!1,dimensions:{width:M,height:B}};_.getState().triggerNodeChanges([Y])}})),k.current.update({controlPosition:R,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:y,onResize:w,onResizeEnd:g,shouldResize:m}),()=>{var M;(M=k.current)==null||M.destroy()}},[R,o,l,u,d,f,y,w,g,m]);const I=R.split("-");return c.jsx("div",{className:xn(["react-flow__resize-control","nodrag",...I,n,r]),ref:N,style:{...s,scale:A,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:i})}v.memo(Pce);const jce=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:NF},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:sF},{type:"loop",label:"循环",desc:"节点循环执行",Icon:AE}];let G1=0;function D0(){return G1+=1,`node_${G1}`}function P0(e,t,n){const r=Xi();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function Bce({data:e,selected:t}){const n=e.agent;return c.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[c.jsx(Ol,{type:"target",position:De.Left,className:"wfb-handle"}),c.jsx("div",{className:"wfb-node-icon",children:c.jsx(Ha,{className:"icon"})}),c.jsxs("div",{className:"wfb-node-body",children:[c.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),c.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),c.jsx(Ol,{type:"source",position:De.Right,className:"wfb-handle"})]})}const Fce={agentNode:Bce},gS={type:"smoothstep",markerEnd:{type:Qu.ArrowClosed,width:16,height:16}};function Uce({onBack:e,onCreate:t}){const n=v.useRef(null),[r,s]=v.useState(""),[i,a]=v.useState(""),[o,l]=v.useState("sequential"),u=v.useMemo(()=>{G1=0;const C=D0();return P0(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=oce([u]),[p,m,y]=lce([]),[w,g]=v.useState(u.id),E=d.find(C=>C.id===w)??null,b=r.trim()||"workflow_agent",_=v.useMemo(()=>d3({name:b,subAgents:d.map(C=>C.data.agent)}),[b,d]),N=nl(b)??(_.has(b)?"名称须与 Agent 节点名称保持唯一":null),T=E?nl(E.data.agent.name)??(_.has(E.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,A=d.length>0&&N===null&&d.every(C=>nl(C.data.agent.name)===null&&!_.has(C.data.agent.name)),k=v.useCallback(C=>m(L=>UD({...C,...gS},L)),[m]),R=v.useCallback(()=>{const C=D0(),L=d.length*28,O=P0(C,{x:80+L,y:120+L});f(j=>j.concat(O)),g(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},M=v.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),B=v.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const O=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),j=D0(),S=P0(j,O);f(H=>H.concat(S)),g(j)},[f]),Y=v.useCallback(C=>{w&&f(L=>L.map(O=>O.id===w?{...O,data:{...O.data,agent:{...O.data.agent,...C}}}:O))},[w,f]),P=v.useCallback(()=>{w&&(f(C=>C.filter(L=>L.id!==w)),m(C=>C.filter(L=>L.source!==w&&L.target!==w)),g(null))},[w,f,m]),U=v.useCallback(()=>{if(!A)return;const C=d.map(O=>O.data.agent),L={...Xi(),name:b,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:o,nodes:d.map(O=>({id:O.id,agent:O.data.agent})),edges:p.map(O=>({from:O.source,to:O.target}))}};t(L)},[A,d,p,b,i,o,t]);return c.jsx("div",{className:"wfb",children:c.jsxs("div",{className:"wfb-grid",children:[c.jsxs("aside",{className:"wfb-palette",children:[c.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"名称"}),c.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),N&&c.jsx("span",{className:"wfb-field-error",children:N})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"描述"}),c.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),c.jsx("div",{className:"wfb-section-label",children:"执行方式"}),c.jsx("div",{className:"wfb-types",children:jce.map(({type:C,label:L,desc:O,Icon:j})=>c.jsxs("button",{type:"button",className:`wfb-type ${o===C?"wfb-type--active":""}`,onClick:()=>l(C),children:[c.jsx(j,{className:"icon"}),c.jsxs("span",{className:"wfb-type-text",children:[c.jsx("span",{className:"wfb-type-name",children:L}),c.jsx("span",{className:"wfb-type-desc",children:O})]})]},C))}),c.jsx("div",{className:"wfb-section-label",children:"节点"}),c.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[c.jsx(xF,{className:"icon wfb-grip"}),c.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:c.jsx(Ha,{className:"icon"})}),c.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),c.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[c.jsx(ms,{className:"icon"}),"添加节点"]}),c.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),c.jsxs("div",{className:"wfb-canvas",children:[c.jsxs("button",{className:"wfb-create",onClick:U,disabled:!A,type:"button",children:[c.jsx(za,{className:"icon"}),"创建工作流"]}),c.jsxs(ace,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:y,onConnect:k,onInit:C=>n.current=C,nodeTypes:Fce,defaultEdgeOptions:gS,onDrop:B,onDragOver:M,onNodeClick:(C,L)=>g(L.id),onPaneClick:()=>g(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[c.jsx(hce,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),c.jsx(xce,{showInteractive:!1}),c.jsx(Lce,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),c.jsx("aside",{className:"wfb-inspector",children:E?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"wfb-inspector-head",children:[c.jsx("div",{className:"wfb-section-label",children:"节点配置"}),c.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:P,title:"删除节点",children:c.jsx(Fl,{className:"icon"})})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"名称"}),c.jsx("input",{className:`wfb-input ${T?"wfb-input--error":""}`,value:E.data.agent.name,onChange:C=>Y({name:C.target.value}),placeholder:"agent_name"}),T?c.jsx("span",{className:"wfb-field-error",children:T}):c.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"描述"}),c.jsx("input",{className:"wfb-input",value:E.data.agent.description,onChange:C=>Y({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),c.jsx("textarea",{className:"wfb-input wfb-textarea",value:E.data.agent.instruction,onChange:C=>Y({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),c.jsx("input",{className:"wfb-input",value:E.data.agent.tools.join(", "),onChange:C=>Y({tools:C.target.value.split(",").map(L=>L.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),c.jsxs("div",{className:"wfb-inspector-meta",children:[c.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),c.jsx("code",{className:"wfb-meta-val",children:E.id})]})]}):c.jsxs("div",{className:"wfb-inspector-empty",children:[c.jsx(Ha,{className:"wfb-empty-icon"}),c.jsx("p",{children:"选择一个节点以编辑其配置"}),c.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function $ce(e){return c.jsx(dP,{children:c.jsx(Uce,{...e})})}const Hce="/web/skill-creator";class ew extends Error{constructor(n,r){super(n);cw(this,"status");this.name="SkillCreatorApiError",this.status=r}}function ao(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function Wt(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function mP(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function jd(e,t){return fetch(Ms(`${Hce}${e}`),{...t,headers:fm({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function tw(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=ao(await e.json(),"错误响应");return Wt(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function nw(e,t){if(!e.ok)throw new ew(await tw(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function zce(e){if(e==="queued")return"queued";if(e==="running")return"running";if(e==="succeeded")return"succeeded";if(e==="failed")return"failed";throw new Error(`未知的 Skill 生成状态:${String(e)}`)}function Vce(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Kce(e){return Array.isArray(e)?e.map((t,n)=>{const r=ao(t,`文件 ${n+1}`),s=Wt(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=mP(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function Yce(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=Array.isArray(t.errors)?t.errors.map(String):[],r=Array.isArray(t.warnings)?t.warnings.map(String):[];return{valid:typeof t.valid=="boolean"?t.valid:n.length===0,errors:n,warnings:r}}function Wce(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=ao(t,`活动 ${n+1}`),s=Wt(r,"id"),i=Wt(r,"kind"),a=Wt(r,"status");if(!s||!i||!["status","thinking","tool","message"].includes(i))throw new Error(`活动 ${n+1} 格式错误`);if(a!=="running"&&a!=="done")throw new Error(`活动 ${n+1} 状态错误`);if(i==="tool"){const l=Wt(r,"name");if(!l)throw new Error(`活动 ${n+1} 缺少工具名称`);return{id:s,kind:i,name:l,args:r.input,response:r.output,status:a}}const o=Wt(r,"text");if(!o)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:o,status:a}})}function qce(e,t){const n=ao(e,`候选方案 ${t+1}`),r=Wt(n,"id","candidate_id","candidateId"),s=Wt(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:Wt(n,"modelLabel","model_label")??s,status:zce(n.status),stage:Vce(n.stage),name:Wt(n,"name","skill_name","skillName"),description:Wt(n,"description"),skillMd:Wt(n,"skillMd","skill_md"),files:Kce(n.files),activities:Wce(n.activities),validation:Yce(n.validation),durationMs:mP(n,"elapsedMs","elapsed_ms"),error:Wt(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:Wt(n,"skill_id","skillId"),version:Wt(n,"version")}}function X1(e,t=""){const n=ao(e,"Skill 创建任务"),r=Wt(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(qce):[],i=Wt(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:Wt(n,"prompt")??t,status:i,candidates:s}}async function Gce(e,t){const n=await jd("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new ew(await tw(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=X1(await n.json(),e);return t==null||t(u),u}if(!r.includes("application/x-ndjson")||!n.body)throw new Error("创建 Skill 任务失败:服务端返回了非流式响应");const s=n.body.getReader(),i=new TextDecoder;let a="",o;const l=u=>{if(!u.trim())return;const d=ao(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(Wt(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");o=X1(d.job,e),t==null||t(o)};for(;;){const{done:u,value:d}=await s.read();a+=i.decode(d,{stream:!u});const f=a.split(` +`);if(a=f.pop()??"",f.forEach(l),u)break}if(l(a),!o)throw new Error("创建 Skill 任务失败:服务端未返回任务");return o}async function Xce(e){const t=await jd(`/jobs/${encodeURIComponent(e)}`);return X1(await nw(t,"读取 Skill 任务失败"))}async function Qce(e){const t=await jd(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await nw(t,"清理 Skill 任务失败")}async function Zce(e,t){var o;const n=await jd(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await tw(n,"下载 Skill 失败"));const s=((o=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:o[1])??"skill.zip",i=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=i,a.download=s,a.click(),URL.revokeObjectURL(i)}async function Jce(e,t,n){const r=await jd(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=ao(await nw(r,"添加到 AgentKit 失败"),"发布结果"),i=Wt(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:Wt(s,"name"),version:Wt(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:Wt(s,"message")}}const eue=()=>{};function tue(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error("不支持的 Skill 对话活动")}function nue({activities:e}){const t=v.useMemo(()=>e.filter(n=>n.kind!=="status").map(tue),[e]);return t.length===0?null:c.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:c.jsx(mx,{blocks:t,onAction:eue})})}const yS={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},bS=12e4;function rue({status:e}){return e==="succeeded"?c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):c.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function sue(){return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),c.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function iue(){return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function aue({candidate:e}){var l,u;const[t,n]=v.useState("SKILL.md"),r=e.files.find(d=>d.path.endsWith("SKILL.md")),s=e.skillMd&&!r?[{path:"SKILL.md",size:new Blob([e.skillMd]).size},...e.files]:e.files,i=s.find(d=>d.path===t)??s[0],a=(l=e.skillMd)==null?void 0:l.slice(0,bS),o=(((u=e.skillMd)==null?void 0:u.length)??0)>bS;return s.length===0?null:c.jsxs("div",{className:"skill-files",children:[c.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>c.jsx("button",{type:"button",role:"tab","aria-selected":(i==null?void 0:i.path)===d.path,className:(i==null?void 0:i.path)===d.path?"is-active":"",onClick:()=>n(d.path),children:d.path},d.path))}),e.skillMd&&(i!=null&&i.path.endsWith("SKILL.md"))?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"skill-files__content",children:c.jsx("code",{children:a})}),o?c.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):c.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function oue({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:o,onPublish:l}){const[u,d]=v.useState("conversation"),[f,h]=v.useState(!1),[p,m]=v.useState(!1),[y,w]=v.useState(""),[g,E]=v.useState(""),[b,_]=v.useState(""),[N,T]=v.useState(""),A=v.useRef(null),k=v.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",M=n.validation;return c.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[c.jsxs("header",{className:"skill-candidate__header",children:[c.jsx("h2",{children:n.model}),r?c.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?c.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[c.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[c.jsx("span",{className:"skill-candidate__status-icon",children:c.jsx(rue,{status:n.status})}),R?c.jsx(Yl,{duration:2.2,spread:16,children:yS[n.stage]}):c.jsx("span",{children:yS[n.stage]}),n.durationMs!==void 0&&I?c.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),c.jsx(nue,{activities:n.activities}),n.error?c.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?c.jsx("div",{className:"skill-candidate__view-actions",children:c.jsxs("button",{ref:A,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var B;return(B=k.current)==null?void 0:B.focus()})},children:[c.jsx(sue,{}),"查看 Skill"]})}):null]}):c.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[c.jsx("div",{className:"skill-candidate__preview-nav",children:c.jsxs("button",{ref:k,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var B;return(B=A.current)==null?void 0:B.focus()})},children:[c.jsx(iue,{}),"返回对话"]})}),c.jsxs("div",{className:"skill-candidate__result",children:[c.jsxs("div",{className:"skill-candidate__summary",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Skill"}),c.jsx("strong",{children:n.name??"未命名 Skill"})]}),c.jsxs("div",{children:[c.jsx("span",{children:"文件"}),c.jsx("strong",{children:n.files.length})]}),c.jsxs("div",{children:[c.jsx("span",{children:"校验"}),c.jsx("strong",{className:(M==null?void 0:M.valid)===!1?"is-invalid":"is-valid",children:(M==null?void 0:M.valid)===!1?"未通过":"已通过"})]})]}),n.description?c.jsx("p",{className:"skill-candidate__description",children:n.description}):null,M&&(M.errors.length>0||M.warnings.length>0)?c.jsxs("details",{className:"skill-validation",children:[c.jsx("summary",{children:"查看校验详情"}),[...M.errors,...M.warnings].map((B,Y)=>c.jsx("div",{children:B},`${B}-${Y}`))]}):null,c.jsx(aue,{candidate:n}),c.jsxs("div",{className:"skill-candidate__actions",children:[c.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:o,children:r?"已采用此方案":"采用此方案"}),c.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Zce(t,n.id).catch(B=>{w(B instanceof Error?B.message:String(B))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),c.jsx("button",{type:"button",className:"skill-action",disabled:!r||s||i||n.published,title:r?void 0:"请先采用此方案",onClick:()=>h(B=>!B),children:n.published?"已添加到 AgentKit":s?"正在添加…":"添加到 AgentKit"})]}),y?c.jsx("div",{className:"skill-candidate__error",children:y}):null,f&&r&&!n.published?c.jsxs("form",{className:"skill-publish-form",onSubmit:B=>{B.preventDefault();const Y=g.split(",").map(P=>P.trim()).filter(Boolean);l({skillSpaceIds:Y,...b.trim()?{projectName:b.trim()}:{},...N.trim()?{skillId:N.trim()}:{}})},children:[c.jsxs("label",{children:[c.jsx("span",{children:"SkillSpace ID(可选)"}),c.jsx("input",{value:g,onChange:B=>E(B.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),c.jsxs("div",{className:"skill-publish-form__optional",children:[c.jsxs("label",{children:[c.jsx("span",{children:"项目名称(可选)"}),c.jsx("input",{value:b,onChange:B=>_(B.target.value)})]}),c.jsxs("label",{children:[c.jsx("span",{children:"已有 Skill ID(可选)"}),c.jsx("input",{value:N,onChange:B=>T(B.target.value)})]})]}),c.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?c.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const ES=new Set(["completed"]),Yf=1100,lue=3e4;function cue(e,t){return{id:`pending-${t}`,model:e,modelLabel:e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}}function uue({initialJob:e}){const[t,n]=v.useState(e),[r,s]=v.useState(""),[i,a]=v.useState(!1),[o,l]=v.useState(),[u,d]=v.useState(),[f,h]=v.useState(()=>new Set),[p,m]=v.useState({});v.useEffect(()=>{n(e),s(""),a(!1)},[e]),v.useEffect(()=>{if(ES.has(e.status)||e.id.startsWith("pending-"))return;let g=!1,E;const b=Date.now()+lue,_=async()=>{try{const N=await Xce(e.id);g||(n({...N,prompt:N.prompt||e.prompt}),s(""),ES.has(N.status)||(E=window.setTimeout(_,Yf)))}catch(N){if(!g){const T=N instanceof ew?N:void 0;if((T==null?void 0:T.status)===404&&Date.now(){g=!0,E!==void 0&&window.clearTimeout(E)}},[e.id,e.status]);const y=gx.map((g,E)=>t.candidates.find(b=>b.model===g)??t.candidates[E]??cue(g,E));async function w(g,E){d(g.id),m(b=>({...b,[g.id]:""}));try{await Jce(t.id,g.id,E),h(b=>new Set(b).add(g.id))}catch(b){m(_=>({..._,[g.id]:b instanceof Error?b.message:String(b)}))}finally{d(void 0)}}return c.jsxs("section",{className:"skill-workspace",children:[c.jsx("header",{className:"skill-workspace__intro",children:c.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?c.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,c.jsx("div",{className:"skill-workspace__grid",children:y.map((g,E)=>{const _=f.has(g.id)||g.published?{...g,published:!0}:g;return c.jsx(oue,{label:`方案 ${E===0?"A":"B"}`,jobId:t.id,candidate:_,selected:o===g.id,publishing:u===g.id,publishDisabled:u!==void 0&&u!==g.id,publishError:p[g.id],onSelect:()=>l(g.id),onPublish:N=>void w(g,N)},`${g.model}-${g.id}`)})})]})}const j0="/web/sandbox/sessions",due=33e4,fue=6e5,hue=15e3;function B0(e){const t=fm(e);return t.set("Accept","application/json"),t}async function F0(e,t){let n={};try{n=await e.json()}catch{return new Error(`${t}(HTTP ${e.status})`)}const r=n.detail,s=r&&typeof r=="object"&&"message"in r?r.message:r??n.message;return new Error(typeof s=="string"&&s?s:t)}async function pue(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],o=new Map;function l(){t==null||t(a.map(h=>({...h})))}function u(h){i+=h;const p=a[a.length-1];(p==null?void 0:p.kind)==="text"?p.text+=h:a.push({kind:"text",text:h}),l()}function d(h){if(typeof h.id!="string"||h.kind!=="thinking"&&h.kind!=="tool"||h.status!=="running"&&h.status!=="done")return;const p=h.status==="done";let m;if(h.kind==="thinking"){if(typeof h.text!="string"||!h.text)return;m={kind:"thinking",text:h.text,done:p}}else{if(typeof h.name!="string"||!h.name)return;m={kind:"tool",name:h.name,args:h.args,response:h.response,done:p}}const y=o.get(h.id);y===void 0?(o.set(h.id,a.length),a.push(m)):a[y]=m,l()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let y;try{y=JSON.parse(m.join(` +`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof y.message=="string"&&y.message?y.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(y),p==="delta"&&typeof y.text=="string"&&u(y.text),p==="done"&&!i&&typeof y.text=="string"&&u(y.text)}for(;;){const{done:h,value:p}=await n.read();s+=r.decode(p,{stream:!h});const m=s.split(/\r?\n\r?\n/);if(s=m.pop()??"",m.forEach(f),h)break}if(s.trim()&&f(s),a.length===0)throw new Error("沙箱未返回有效回复,请重试。");return{text:i,blocks:a}}const U0={async startSession(e={}){const t=await fetch(Ms(j0),{method:"POST",headers:B0({"Content-Type":"application/json"}),signal:Ds(e.signal,due)});if(!t.ok)throw await F0(t,"无法启动 AgentKit 沙箱,请稍后重试。");const n=await t.json();if(!n.sessionId||n.status!=="ready")throw new Error("AgentKit 沙箱返回了无效的会话信息。");return{id:n.sessionId,toolName:"codex",createdAt:new Date().toISOString()}},async sendMessage(e,t={}){if(!e.sessionId||!e.text.trim())throw new Error("临时会话缺少有效的消息内容。");const n=await fetch(Ms(`${j0}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:B0({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:Ds(t.signal,fue)});if(!n.ok)throw await F0(n,"沙箱对话失败,请稍后重试。");return pue(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Ms(`${j0}/${encodeURIComponent(e)}`),{method:"DELETE",headers:B0(),signal:Ds(t.signal,hue)});if(!n.ok&&n.status!==404)throw await F0(n,"无法清理 AgentKit 沙箱会话。")}},mue=1e4;async function gP(e){const t=await fetch(Ms(e),{headers:fm({Accept:"application/json"}),signal:Ds(void 0,mue)});if(!t.ok)throw new Error(`读取会话模式能力失败(HTTP ${t.status})`);const n=await t.json();if(typeof n.enabled!="boolean")throw new Error("会话模式能力响应格式错误");return{enabled:n.enabled,reason:typeof n.reason=="string"?n.reason:void 0}}async function gue(){return gP("/web/sandbox/capabilities")}async function yue(){return gP("/web/skill-creator/capabilities")}function bue(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M12 3.5c.35 3.05 1.62 5.32 4.9 6.1-3.28.78-4.55 3.05-4.9 6.1-.35-3.05-1.62-5.32-4.9-6.1 3.28-.78 4.55-3.05 4.9-6.1Z"}),c.jsx("path",{d:"M18.5 14.5c.18 1.55.84 2.7 2.5 3.1-1.66.4-2.32 1.55-2.5 3.1-.18-1.55-.84-2.7-2.5-3.1 1.66-.4 2.32-1.55 2.5-3.1Z"}),c.jsx("path",{d:"M5.3 14.2c.14 1.15.62 2 1.85 2.3-1.23.3-1.71 1.15-1.85 2.3-.14-1.15-.62-2-1.85-2.3 1.23-.3 1.71-1.15 1.85-2.3Z"})]})}function Eue({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=v.useRef(null),a=v.useRef(null);if(v.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],y=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),y.focus()):!h.shiftKey&&document.activeElement===y&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const o=t==="loading",l=o?"正在初始化沙箱":t==="error"?"启动失败":"启用临时会话";return $a.createPortal(c.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!o&&r()},children:c.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[c.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[c.jsx("span",{className:"sandbox-dialog-orbit"}),c.jsx("span",{className:"sandbox-dialog-icon",children:o?c.jsx("span",{className:"sandbox-spinner"}):c.jsx(bue,{})})]}),c.jsxs("div",{className:"sandbox-dialog-copy",children:[c.jsx("h2",{id:"sandbox-dialog-title",children:l}),t==="error"?c.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):o?c.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建临时 Session,通常需要一点时间。"}):c.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex Agent 开启临时会话,您的会话将不会被持久化保存。"})]}),c.jsxs("footer",{className:"sandbox-dialog-actions",children:[c.jsx("button",{ref:a,type:"button",onClick:r,children:o?"取消启动":"取消"}),!o&&c.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function xue({onExit:e}){return c.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[c.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),c.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为临时会话,退出后对话内容消失"}),c.jsx("button",{type:"button",onClick:e,children:"退出临时会话"})]})}const xS=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function $0(e){let t=0;for(let n=0;n>>0;return xS[t%xS.length]}function wue(e){const t=new Map;e.forEach(u=>t.set(u.span_id,u));const n=new Map,r=[];for(const u of e)u.parent_span_id!=null&&t.has(u.parent_span_id)?(n.get(u.parent_span_id)??n.set(u.parent_span_id,[]).get(u.parent_span_id)).push(u):r.push(u);const s=(u,d)=>u.start_time-d.start_time,i=(u,d)=>({span:u,depth:d,children:(n.get(u.span_id)??[]).sort(s).map(f=>i(f,d+1))}),a=r.sort(s).map(u=>i(u,0)),o=e.length?Math.min(...e.map(u=>u.start_time)):0,l=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:o,total:l-o||1}}function vue(e,t){const n=[],r=s=>{n.push(s),t.has(s.span.span_id)||s.children.forEach(r)};return e.forEach(r),n}function wS(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const _ue=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function vS(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:_ue(t),value:r,long:r.length>80||r.includes(` +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function Tue({appName:e,sessionId:t,onClose:n}){const[r,s]=v.useState(null),[i,a]=v.useState(""),[o,l]=v.useState(new Set),[u,d]=v.useState(null);v.useEffect(()=>{s(null),a(""),KI(e,t).then(E=>{s(E),d(E.length?E.reduce((b,_)=>b.start_time<=_.start_time?b:_).span_id:null)}).catch(E=>a(String(E)))},[e,t]);const{rootNodes:f,min:h,total:p}=v.useMemo(()=>wue(r??[]),[r]),m=v.useMemo(()=>vue(f,o),[f,o]),y=(r==null?void 0:r.find(E=>E.span_id===u))??null,w=p/1e6,g=E=>l(b=>{const _=new Set(b);return _.has(E)?_.delete(E):_.add(E),_});return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"drawer-scrim",onClick:n}),c.jsxs("aside",{className:"drawer drawer--trace",children:[c.jsxs("header",{className:"drawer-head",children:[c.jsxs("div",{children:[c.jsx("div",{className:"drawer-title",children:"调用链路观测"}),c.jsx("div",{className:"drawer-sub",children:r?`${r.length} 个调用 · ${w.toFixed(1)} ms`:"加载中"})]}),c.jsx("button",{className:"drawer-close",onClick:n,"aria-label":"关闭",children:c.jsx(Xr,{className:"icon"})})]}),r==null&&!i&&c.jsxs("div",{className:"drawer-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载调用链路…"]}),i&&c.jsx("div",{className:"error",children:i}),r&&r.length===0&&c.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),m.length>0&&c.jsxs("div",{className:"trace-split",children:[c.jsx("div",{className:"trace-tree scroll",children:m.map(E=>{const b=E.span,_=(b.start_time-h)/p*100,N=Math.max((b.end_time-b.start_time)/p*100,.6),T=E.children.length>0;return c.jsxs("button",{className:`trace-row ${u===b.span_id?"active":""}`,onClick:()=>d(b.span_id),children:[c.jsxs("span",{className:"trace-label",style:{paddingLeft:E.depth*14},children:[c.jsx("span",{className:`trace-caret ${T?"":"hidden"} ${o.has(b.span_id)?"":"open"}`,onClick:A=>{A.stopPropagation(),T&&g(b.span_id)},children:c.jsx(Xn,{className:"chev"})}),c.jsx("span",{className:"trace-dot",style:{background:$0(b.name)}}),c.jsx("span",{className:"trace-name",title:b.name,children:b.name})]}),c.jsx("span",{className:"trace-dur",children:wS(b.end_time-b.start_time)}),c.jsx("span",{className:"trace-track",children:c.jsx("span",{className:"trace-bar",style:{left:`${_}%`,width:`${N}%`,background:$0(b.name)}})})]},b.span_id)})}),c.jsx("div",{className:"trace-detail scroll",children:y?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"td-title",children:y.name}),c.jsxs("div",{className:"td-dur",children:[c.jsx("span",{className:"td-dot",style:{background:$0(y.name)}}),wS(y.end_time-y.start_time)]}),c.jsx("div",{className:"td-section",children:"属性"}),c.jsx("div",{className:"td-props",children:vS(y).filter(E=>!E.long).map(E=>c.jsxs("div",{className:"td-prop",children:[c.jsx("span",{className:"td-key",children:E.key}),c.jsx("span",{className:"td-val",children:E.value})]},E.key))}),vS(y).filter(E=>E.long).map(E=>c.jsxs("div",{className:"td-block",children:[c.jsx("div",{className:"td-section",children:E.key}),c.jsx("pre",{className:"td-pre",children:E.value})]},E.key))]}):c.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}function Nue(e){return e.toLowerCase()==="github"?c.jsx(EF,{className:"icon"}):c.jsx(SF,{className:"icon"})}function kue({branding:e,onUsername:t}){const[n,r]=v.useState(null),[s,i]=v.useState(""),[a,o]=v.useState(0),[l,u]=v.useState("");v.useEffect(()=>{let h=!0;return r(null),i(""),GF().then(p=>{h&&r(p)}).catch(p=>{h&&i(p instanceof Error?p.message:String(p))}),()=>{h=!1}},[a]);const d=WF.test(l),f=()=>{d&&t(l)};return c.jsxs("div",{className:"login",children:[c.jsx("header",{className:"login-top",children:c.jsxs("span",{className:"login-brand",children:[c.jsx("img",{className:"login-brand-logo",src:e.logoUrl||ux,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),c.jsx("main",{className:"login-main",children:c.jsxs("div",{className:"login-card",children:[c.jsx(Yl,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?c.jsxs("div",{className:"login-provider-error",role:"alert",children:[c.jsx("p",{children:s}),c.jsx("button",{type:"button",onClick:()=>o(h=>h+1),children:"重试"})]}):n===null?null:n.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"login-sub",children:"登录以继续使用"}),c.jsx("div",{className:"login-providers",children:n.map(h=>c.jsxs("button",{className:"login-btn",onClick:()=>XF(h.loginUrl),children:[Nue(h.id),c.jsxs("span",{children:["使用 ",h.label," 登录"]})]},h.id))})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),c.jsxs("form",{className:"login-name",onSubmit:h=>{h.preventDefault(),f()},children:[c.jsx("input",{className:"login-name-input",value:l,onChange:h=>u(h.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16,autoFocus:!0}),c.jsx("button",{type:"submit",className:"login-name-go",disabled:!d,"aria-label":"进入",children:c.jsx(xI,{className:"icon"})})]}),c.jsx("p",{className:"login-hint","aria-live":"polite",children:l&&!d?"只能包含大小写字母和数字,最多 16 位。":""})]}),c.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),c.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",c.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),c.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function Sue({node:e,ctx:t}){const n=e.variant??"default";return c.jsx("button",{type:"button",className:`a2ui-button a2ui-button--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,onClick:()=>t.dispatchAction(e.action,e),children:t.render(e.child)})}io("Button",Sue);function Aue({node:e,ctx:t}){return c.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}io("Card",Aue);const Cue={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},Iue={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function yP(e){return Cue[e]??"flex-start"}function bP(e){return Iue[e]??"stretch"}function Rue({node:e,ctx:t}){const n=e.children??[];return c.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:yP(e.justify),alignItems:bP(e.align)},children:n.map(r=>t.render(r))})}io("Column",Rue);function Oue({node:e}){const t=e.axis==="vertical";return c.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}io("Divider",Oue);const Lue={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function Mue({node:e}){const t=e.name??"";return c.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:Lue[t]??"•"})}io("Icon",Mue);function Due({node:e,ctx:t}){const n=e.children??[];return c.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:yP(e.justify),alignItems:bP(e.align??"center")},children:n.map(r=>t.render(r))})}io("Row",Due);const Pue=new Set(["h1","h2","h3","h4","h5"]);function jue({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=Pue.has(n)?n:"p";return c.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}io("Text",jue);const Bue="创建 Agent",Fue={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流"},vo={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},Uue=new Set,$ue=[];function Vs(){return{skills:[]}}function Hue(e,t){var r;const n=oR(e==null?void 0:e.events);if(n!=="新会话")return n;for(const s of t){if(s.role!=="user")continue;const i=(r=s.blocks.find(a=>a.kind==="text"))==null?void 0:r.text.trim();if(i)return i}return"新会话"}function EP(e,t){if(e.name===t)return e;for(const n of e.children){const r=EP(n,t);if(r)return r}}function xP(e){const t=[];for(const n of e.children)n.mentionable&&(t.push({name:n.name,description:n.description,type:n.type,path:n.path}),t.push(...xP(n)));return t}function _S(){const e=typeof localStorage<"u"?localStorage.getItem(vo.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function zue({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),c.jsx("path",{d:"M12 8.2l1.05 2.75 2.75 1.05-2.75 1.05L12 15.8l-1.05-2.75L8.2 12l2.75-1.05z",fill:"currentColor",stroke:"none"})]})}function Vue(){return c.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[c.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),c.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),c.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function wP(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Kue(e){if(!e)return"";const t=[];return e.ts&&t.push(wP(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function Yue(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const Wue="send_a2ui_json_to_client";function que(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"?t.files.length>0:t.kind==="tool"?!(t.name===Wue&&t.done):t.kind==="a2ui"?rM(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function Gue(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function Xue(e){return new Promise((t,n)=>{let r="";try{r=new URL(e,window.location.href).protocol}catch{}if(r!=="http:"&&r!=="https:"){n(new Error("授权链接不是 http/https 地址,已阻止打开。"));return}const s=window.open(e,"veadk_oauth","width=520,height=720");if(!s){n(new Error("弹窗被拦截,请允许弹窗后重试。"));return}let i=!1;const a=()=>{clearInterval(u),window.removeEventListener("message",l)},o=d=>{if(!i){i=!0,a();try{s.close()}catch{}t(d)}},l=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&o(f.url)};window.addEventListener("message",l);const u=setInterval(()=>{if(!i){if(s.closed){a();const d=window.prompt("授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:");d&&d.trim()?(i=!0,t(d.trim())):n(new Error("授权已取消。"));return}try{const d=s.location.href;d&&d!=="about:blank"&&new URL(d).origin===window.location.origin&&/[?&](code|state|error)=/.test(d)&&o(d)}catch{}}},500)})}function Que(e,t){const n=JSON.parse(JSON.stringify(e??{})),r=n.exchangedAuthCredential??n.exchanged_auth_credential??{},s=r.oauth2??{};return s.authResponseUri=t,s.auth_response_uri=t,r.oauth2=s,n.exchangedAuthCredential=r,n}function TS({text:e}){const[t,n]=v.useState(!1);return c.jsx("button",{className:"icon-btn",title:t?"已复制":"复制",disabled:!e,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?c.jsx(Bs,{className:"icon"}):c.jsx(TE,{className:"icon"})})}function Zue(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function Jue({tasks:e,onCancel:t}){const[n,r]=v.useState(!1),[s,i]=v.useState(null),a=e.filter(f=>f.status==="running").length,o=e[0],l=a>0?"running":(o==null?void 0:o.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(o==null?void 0:o.status)==="success"?"最近部署已完成":(o==null?void 0:o.status)==="error"?"最近部署失败":(o==null?void 0:o.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return c.jsxs("div",{className:"global-deploy-center",children:[c.jsxs("button",{type:"button",className:`global-deploy-task is-${l}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[l==="running"?c.jsx(bt,{className:"global-deploy-task-icon spin"}):l==="success"?c.jsx(cF,{className:"global-deploy-task-icon"}):l==="error"?c.jsx(TI,{className:"global-deploy-task-icon"}):l==="cancelled"?c.jsx(uF,{className:"global-deploy-task-icon"}):c.jsx(kF,{className:"global-deploy-task-icon"}),c.jsx("span",{className:"global-deploy-task-detail",children:u}),c.jsx(op,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),c.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[c.jsxs("header",{className:"global-deploy-popover-head",children:[c.jsx("span",{children:"部署任务"}),c.jsx("span",{children:e.length})]}),c.jsx("div",{className:"global-deploy-list",children:e.length===0?c.jsx("div",{className:"global-deploy-empty",children:"暂无部署任务"}):e.map(f=>{const h=`${f.label}${f.status==="running"&&typeof f.pct=="number"?` ${Math.round(f.pct)}%`:""}`;return c.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[c.jsxs("div",{className:"global-deploy-item-head",children:[c.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),c.jsx("span",{className:"global-deploy-status",children:h})]}),c.jsxs("dl",{className:"global-deploy-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Runtime 名称"}),c.jsx("dd",{children:f.runtimeName})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"部署地域"}),c.jsx("dd",{children:Zue(f.region)})]}),f.runtimeId&&c.jsxs("div",{children:[c.jsx("dt",{children:"Runtime ID"}),c.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?c.jsx(Ip,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?c.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:c.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),c.jsx("div",{className:"global-deploy-item-actions",children:c.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const NS=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],kS=()=>NS[Math.floor(Math.random()*NS.length)];function H0(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function ede(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function tde(e){var n;if(e.type)return e.type;const t=(n=e.name.split(".").pop())==null?void 0:n.toLowerCase();return t==="md"||t==="markdown"?"text/markdown":t==="txt"?"text/plain":"application/octet-stream"}function nde(){const[e,t]=v.useState([]),[n,r]=v.useState(""),[s,i]=v.useState([]),[a,o]=v.useState(""),l=v.useRef(null),[u,d]=v.useState(!1),[f,h]=v.useState([]),[p,m]=v.useState(null),[y,w]=v.useState([]),[g,E]=v.useState(!1),[b,_]=v.useState(!1),[N,T]=v.useState("confirm"),[A,k]=v.useState(""),R=v.useRef(null),I=v.useRef(null),[M,B]=v.useState({}),Y=a?M[a]??[]:f,P=p?y:Y,U=p?"灵光一现":Hue(s.find(q=>q.id===a),P),C=(q,te)=>B(xe=>({...xe,[q]:typeof te=="function"?te(xe[q]??[]):te})),[L,O]=v.useState(""),[j,S]=v.useState("agent"),[H,V]=v.useState({}),[D,ne]=v.useState(null),[ee,re]=v.useState(!1),de=v.useRef(0),[G,W]=v.useState([]),[oe,he]=v.useState(Vs),[J,ce]=v.useState(null),[Ce,Ee]=v.useState(!1),ge=v.useRef(new Set),[Le,ve]=v.useState(()=>new Set),Ue=v.useRef(new Map),Ie=(q,te)=>ve(xe=>{const je=new Set(xe);return te?je.add(q):je.delete(q),je}),ae=v.useRef(""),[wt,we]=v.useState(""),[vt,ct]=v.useState(!1),[K,X]=v.useState(kS),[le,Ne]=v.useState(null),[Re,ut]=v.useState(null),[We,ot]=v.useState(""),[Zt,Ct]=v.useState(),[Ge,Et]=v.useState(null),[Ht,Nn]=v.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[Fe,rt]=v.useState("cloud"),[tt,mt]=v.useState(Du),[ue,Oe]=v.useState("chat"),[Qe,cn]=v.useState(!1),[an,ie]=v.useState(!1),[_e,ye]=v.useState(!1),[Pe,$e]=v.useState({}),[qe,gt]=v.useState({}),[It,Rt]=v.useState({}),yn=Le.has(a)||u,zt=p?g:yn,kn=Pe[a]??"",er=qe[a]??Uue,_r=It[a]??$ue,Dn=J==null?void 0:J.graph,Hn=oe.targetAgent&&Dn?EP(Dn,oe.targetAgent.name):Dn,tr=(Hn==null?void 0:Hn.skills)??(oe.targetAgent?[]:(J==null?void 0:J.skills)??[]),Tr=Dn?xP(Dn):[];function Vt(q){H0(q);for(const te of q)te.status==="uploading"?ge.current.add(te.id):te.uri&&uh(n,te.uri).catch(xe=>we(String(xe)))}function Sn(){de.current+=1;const q=D;ne(null),re(!1),q&&!q.id.startsWith("pending-")&&Qce(q.id).catch(te=>{we(te instanceof Error?te.message:String(te))})}async function Pn(q){try{await r1(n,We,q),await n1(n,We,q),i(te=>te.filter(xe=>xe.id!==q)),B(te=>{const{[q]:xe,...je}=te;return je})}catch(te){we(String(te))}}function nr(q){const te=G.find(Ke=>Ke.id===q);if(!te)return;const xe=G.filter(Ke=>Ke.id!==q);H0([te]),te.status==="uploading"&&ge.current.add(q),W(xe),xe.length===0&&!L.trim()&&!!a&&P.length===0?(ae.current="",o(""),Pn(a)):te.uri&&uh(n,te.uri).catch(Ke=>we(String(Ke)))}const zn=(q,te)=>{var Ye,Ve,Ze,Se,pt;const xe=te.author&&te.author!=="user"?te.author:void 0;xe&&($e(_t=>({..._t,[q]:xe})),gt(_t=>({..._t,[q]:new Set(_t[q]??[]).add(xe)})),Rt(_t=>{var Mt;return(Mt=_t[q])!=null&&Mt.length?_t:{..._t,[q]:[xe]}}));const je=((Ye=te.actions)==null?void 0:Ye.transferToAgent)??((Ve=te.actions)==null?void 0:Ve.transfer_to_agent);je&&Rt(_t=>{const Mt=_t[q]??[];return Mt[Mt.length-1]===je?_t:{..._t,[q]:[...Mt,je]}}),(((Ze=te.actions)==null?void 0:Ze.endOfAgent)??((Se=te.actions)==null?void 0:Se.end_of_agent)??((pt=te.actions)==null?void 0:pt.escalate))&&Rt(_t=>{const Mt=_t[q]??[];return Mt.length<=1?_t:{..._t,[q]:Mt.slice(0,-1)}})},[An,st]=v.useState(_S),[Cn,Bt]=v.useState([]),Jt=v.useCallback(q=>{Bt(te=>{const xe=te.findIndex(Ke=>Ke.id===q.id);if(xe===-1)return[q,...te];const je=[...te];return je[xe]={...je[xe],...q},je})},[]),In=v.useCallback(async q=>{try{await XI(q.id),Bt(te=>te.map(xe=>xe.id===q.id?{...xe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:xe))}catch(te){const xe=te instanceof Error?te.message:String(te);Bt(je=>je.map(Ke=>Ke.id===q.id?{...Ke,message:`取消失败:${xe}`}:Ke))}},[]),[jn,wn]=v.useState(!0),[rr,Ot]=v.useState(!1),[Z,ke]=v.useState(!1),[Me,He]=v.useState(!1),[Lt,yt]=v.useState(null),[Kt,kt]=v.useState(!1),[fr,St]=v.useState(!1),ra=v.useRef(null),[Jl,ec]=v.useState(()=>{const q=Zs();return Kl(q),q}),[Bd,Fd]=v.useState(!1),qm=v.useRef(!1),Ud=v.useRef(!1);function $d(q){console.log("create agent draft:",q),st(null),oo()}function rw(q,te){console.log("Agent added, navigating to:",q,te),ec(Zs()),st(null),r(q)}const{ref:vP,onScroll:_P}=sM(P),Gm=v.useCallback(()=>{ut(null),ZF().then(q=>{ot(q.userId),Ct(q.info),ie(!!q.local),Ne(q.status)}).catch(q=>{ut(q instanceof Error?q.message:String(q))})},[]);v.useEffect(()=>{Gm()},[Gm]),v.useEffect(()=>{an&&We&&H_(We)},[an,We]),v.useEffect(()=>{if(le!=="authenticated"||!We){V({});return}let q=!1;return Promise.allSettled([gue(),yue()]).then(([te,xe])=>{q||V({temporaryEnabled:te.status==="fulfilled"&&te.value.enabled,skillCreateEnabled:xe.status==="fulfilled"&&xe.value.enabled})}),()=>{q=!0}},[le,We]),v.useEffect(()=>{if(le!=="authenticated"||!We){Et(null);return}let q=!1;return Et(null),eR().then(te=>{q||Et(te)}).catch(te=>{console.warn("[app] /web/access failed; using ordinary-user access:",te),q||Et(JI)}),()=>{q=!0}},[le,We]),v.useEffect(()=>{ZI().then(q=>{Nn(q.features),rt(q.agentsSource),mt(q.branding),Oe(q.defaultView),cn(!0)})},[]),v.useEffect(()=>{!Ge||!Qe||Ud.current||(Ud.current=!0,ue==="addAgent"&&Ge.capabilities.createAgents&&(st(null),Ot(!1),kt(!1),St(!1),ke(!1),He(!0)))},[Ge,ue,Qe]),v.useEffect(()=>{Ge&&(Ge.capabilities.createAgents||(st(null),yt(null),ke(!1),He(!1),Bt([])),Ge.capabilities.manageAgents||St(!1))},[Ge]),v.useEffect(()=>{document.title=tt.title;let q=document.querySelector('link[rel~="icon"]');q||(q=document.createElement("link"),q.rel="icon",document.head.appendChild(q)),q.removeAttribute("type"),q.href=tt.logoUrl||ux},[tt]),v.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(q=>q.ok?q.json():null).then(q=>{q&&wn(!!q.credentials)}).catch(q=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",q)})},[]);function TP(q){H_(q),qm.current=!0,Ud.current=!1,Et(null),st(null),yt(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!1),oo(),ot(q),Ct({name:q}),ie(!0),Ne("authenticated")}function NP(){Ud.current=!1,Et(null),an?(qF(),ot(""),Ct(void 0),Ne("unauthenticated")):QF()}v.useEffect(()=>{le!=="unauthenticated"&&$I().then(q=>{if(t(q),Fe==="cloud"){r("");return}const te=localStorage.getItem(vo.app),xe=Jl.flatMap(Ye=>Ye.apps.map(Ve=>Ka(Ye.id,Ve))),je=te&&(q.includes(te)||xe.includes(te)),Ke=["web_search_agent","web_demo"].find(Ye=>q.includes(Ye))??q.find(Ye=>!/^\d/.test(Ye))??q[0];r(je?te:Ke||"")}).catch(q=>we(String(q)))},[le,Fe]),v.useEffect(()=>{n&&localStorage.setItem(vo.app,n)},[n]),v.useEffect(()=>{let q=!1;if(ce(null),he(Vs()),!n){Ee(!1);return}return Ee(!0),hd(n).then(te=>{q||ce(te)}).catch(()=>{q||ce(null)}).finally(()=>{q||Ee(!1)}),()=>{q=!0}},[n]),v.useEffect(()=>{Ge&&localStorage.setItem(vo.view,Ge.capabilities.createAgents?An??"chat":"chat")},[Ge,An]),v.useEffect(()=>{localStorage.setItem(vo.session,a),ae.current=a},[a]),v.useEffect(()=>()=>Ue.current.forEach(q=>q.abort()),[]),v.useEffect(()=>()=>{var q,te;(q=R.current)==null||q.abort(),(te=I.current)==null||te.abort()},[]),v.useEffect(()=>{!n||!We||(async()=>{const q=await Hd(n);if(!qm.current){qm.current=!0;const te=localStorage.getItem(vo.session)||"";if(_S()===null&&te&&q.some(xe=>xe.id===te)){zd(te);return}}oo()})()},[n,We]),v.useEffect(()=>{const q=ra.current;q&&q.app===n&&(ra.current=null,zd(q.sid))},[n]);function kP(q,te){kt(!1),q===n?zd(te):(ra.current={app:q,sid:te},r(q))}async function Hd(q){try{const te=await OE(q,We),xe=await Promise.all(te.map(je=>{var Ke;return(Ke=je.events)!=null&&Ke.length?Promise.resolve(je):dp(q,We,je.id)}));return i(xe),xe}catch(te){return we(String(te)),[]}}function SP(){p||(we(""),k(""),T("confirm"),_(!0))}function AP(){var q;(q=R.current)==null||q.abort(),R.current=null,_(!1),T("confirm"),k(""),!p&&j==="temporary"&&S("agent")}async function CP(){var te;(te=R.current)==null||te.abort();const q=new AbortController;R.current=q,T("loading"),k("");try{const xe=await U0.startSession({signal:q.signal});if(R.current!==q)return;ae.current="",o(""),h([]),O(""),he(Vs()),S("temporary"),Sn(),re(!1),Vt(G),W([]),w([]),m(xe),st(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!1),_(!1),T("confirm")}catch(xe){if((xe==null?void 0:xe.name)==="AbortError"||R.current!==q)return;k(xe instanceof Error?xe.message:String(xe)),T("error")}finally{R.current===q&&(R.current=null)}}function sa(){var te;(te=I.current)==null||te.abort(),I.current=null,E(!1),w([]),O(""),we(""),S("agent");const q=p;m(null),q&&U0.closeSession(q.id).catch(xe=>we(String(xe)))}async function IP(q){var Ke;const te=p;if(!te||g||!q.trim())return;we("");const xe=new AbortController;(Ke=I.current)==null||Ke.abort(),I.current=xe;const je=[{role:"user",blocks:[{kind:"text",text:q}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Ye=>[...Ye,...je]),E(!0);try{const Ye=await U0.sendMessage({sessionId:te.id,text:q},{signal:xe.signal,onBlocks:Ve=>{I.current===xe&&w(Ze=>{const Se=Ze.slice(),pt=Se[Se.length-1];return(pt==null?void 0:pt.role)==="assistant"&&(Se[Se.length-1]={...pt,blocks:Ve}),Se})}});if(I.current!==xe)return;w(Ve=>{const Ze=Ve.slice(),Se=Ze[Ze.length-1];return(Se==null?void 0:Se.role)==="assistant"&&(Ze[Ze.length-1]={...Se,blocks:Ye.blocks,meta:{ts:Date.now()/1e3}}),Ze})}catch(Ye){if((Ye==null?void 0:Ye.name)==="AbortError"||I.current!==xe)return;w(Ve=>Ve.slice(0,-2)),O(q),we(`临时会话发送失败:${Ye instanceof Error?Ye.message:String(Ye)}`)}finally{I.current===xe&&(I.current=null,E(!1))}}function oo(){sa(),we(""),X(kS()),S("agent"),Sn(),re(!1);const q=a&&Y.length===0&&G.length>0?a:"";ae.current="",o(""),d(!1),h([]),he(Vs()),Vt(G),W([]),q&&Pn(q)}async function RP(q){var te;try{(te=Ue.current.get(q))==null||te.abort(),await r1(n,We,q),await n1(n,We,q),B(xe=>{const{[q]:je,...Ke}=xe;return Ke}),q===a&&oo(),await Hd(n)}catch(xe){we(String(xe))}}async function zd(q){if(p&&sa(),q!==a&&(ae.current=q,we(""),d(!1),h([]),S("agent"),Sn(),he(Vs()),o(q),M[q]===void 0)){ye(!0);try{const te=await dp(n,We,q);C(q,fU(te.events??[]))}catch(te){we(String(te))}finally{ye(!1)}}}async function sw(q=!0){if(a)return a;l.current||(l.current=up(n,We));const te=l.current;try{const xe=await te;q&&o(xe);const je=Date.now()/1e3,Ke={id:xe,lastUpdateTime:je,events:[]};return i(Ye=>[Ke,...Ye.filter(Ve=>Ve.id!==xe)]),xe}finally{l.current===te&&(l.current=null)}}async function OP(q){we("");let te;try{te=await sw()}catch(je){we(String(je));return}const xe=Array.from(q).map(je=>({file:je,attachment:{id:ede(),mimeType:tde(je),name:je.name,sizeBytes:je.size,status:"uploading"}}));W(je=>[...je,...xe.map(Ke=>Ke.attachment)]),await Promise.all(xe.map(async({file:je,attachment:Ke})=>{try{const Ye=await HI(n,We,te,je);if(ge.current.delete(Ke.id)){Ye.uri&&await uh(n,Ye.uri);return}W(Ve=>Ve.map(Ze=>Ze.id===Ke.id?Ye:Ze))}catch(Ye){if(ge.current.delete(Ke.id))return;const Ve=Ye instanceof Error?Ye.message:String(Ye);W(Ze=>Ze.map(Se=>Se.id===Ke.id?{...Se,status:"error",error:Ve}:Se)),we(Ve)}}))}async function iw(q,te=[],xe=Vs()){if(!q.trim()&&te.length===0||yn||!n||!We)return;we("");const je=[];(xe.skills.length>0||xe.targetAgent)&&je.push({kind:"invocation",value:xe}),te.length&&je.push({kind:"attachment",files:te.map(Se=>({id:Se.id,mimeType:Se.mimeType,data:Se.data,uri:Se.uri,name:Se.name,sizeBytes:Se.sizeBytes}))}),q.trim()&&je.push({kind:"text",text:q});const Ke=[{role:"user",blocks:je,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Ye=!a;Ye&&(h(Ke),d(!0));let Ve;try{Ve=await sw(!Ye)}catch(Se){Ye&&(h([]),d(!1),O(q),he(xe)),we(String(Se));return}C(Ve,Se=>Ye?Ke:[...Se,...Ke]),Ye&&(ae.current=Ve,o(Ve),h([]),d(!1));const Ze=new AbortController;Ue.current.set(Ve,Ze),Ie(Ve,!0),ae.current=Ve,$e(Se=>({...Se,[Ve]:""})),gt(Se=>({...Se,[Ve]:new Set})),Rt(Se=>({...Se,[Ve]:[]}));try{let Se=Qs(),pt=0,_t=Date.now()/1e3;for await(const Mt of Mu({appName:n,userId:We,sessionId:Ve,text:q,attachments:te,invocation:xe,signal:Ze.signal})){if(Ze.signal.aborted)break;const pi=Mt.error??Mt.errorMessage??Mt.error_message;if(typeof pi=="string"&&pi){ae.current===Ve&&we(pi);break}zn(Ve,Mt),Se=ml(Se,Mt);const lo=Mt.usageMetadata??Mt.usage_metadata;lo!=null&&lo.totalTokenCount&&(pt=lo.totalTokenCount),Mt.timestamp&&(_t=Mt.timestamp);const Jm=Se.blocks,aa={tokens:pt||void 0,ts:_t};C(Ve,oa=>{const mi=oa.slice(),Yd=mi[mi.length-1];return(Yd==null?void 0:Yd.role)==="assistant"&&(mi[mi.length-1]={...Yd,blocks:Jm,meta:aa}),mi})}Hd(n)}catch(Se){(Se==null?void 0:Se.name)!=="AbortError"&&!Ze.signal.aborted&&ae.current===Ve&&we(String(Se))}finally{Ue.current.get(Ve)===Ze&&Ue.current.delete(Ve),Ie(Ve,!1),$e(Se=>({...Se,[Ve]:""})),Rt(Se=>({...Se,[Ve]:[]}))}}function LP(q,te){var Ke,Ye;const xe=((Ke=q==null?void 0:q.event)==null?void 0:Ke.name)??te.id,je=((Ye=q==null?void 0:q.event)==null?void 0:Ye.context)??{};iw(`[ui-action] ${xe}: ${JSON.stringify(je)}`)}async function MP(q){if(!q.authUri)throw new Error("事件中没有授权地址。");if(!n||!We||!a)throw new Error("会话尚未就绪。");const te=a,xe=await Xue(q.authUri),je=Que(q.authConfig,xe),Ke=Se=>Se.map(pt=>pt.kind==="auth"&&!pt.done?{...pt,done:!0}:pt);C(te,Se=>{const pt=Se.slice(),_t=pt[pt.length-1];return(_t==null?void 0:_t.role)==="assistant"&&(pt[pt.length-1]={..._t,blocks:Ke(_t.blocks)}),pt});const Ye=P[P.length-1],Ve=Ke(Ye&&Ye.role==="assistant"?Ye.blocks:[]),Ze=new AbortController;Ue.current.set(te,Ze),Ie(te,!0);try{let Se=Qs(),pt=0,_t=Date.now()/1e3;for await(const Mt of Mu({appName:n,userId:We,sessionId:a,text:"",functionResponses:[{id:q.callId,name:"adk_request_credential",response:je}],signal:Ze.signal})){if(Ze.signal.aborted)break;zn(te,Mt),Se=ml(Se,Mt);const pi=Mt.usageMetadata??Mt.usage_metadata;pi!=null&&pi.totalTokenCount&&(pt=pi.totalTokenCount),Mt.timestamp&&(_t=Mt.timestamp);const lo=[...Ve,...Se.blocks];C(te,Jm=>{var mi;const aa=Jm.slice(),oa=aa[aa.length-1];return(oa==null?void 0:oa.role)==="assistant"&&(aa[aa.length-1]={...oa,blocks:lo,meta:{tokens:pt||((mi=oa.meta)==null?void 0:mi.tokens),ts:_t}}),aa})}Hd(n)}catch(Se){(Se==null?void 0:Se.name)!=="AbortError"&&!Ze.signal.aborted&&ae.current===te&&we(String(Se))}finally{Ue.current.get(te)===Ze&&Ue.current.delete(te),Ie(te,!1),$e(Se=>({...Se,[te]:""})),Rt(Se=>({...Se,[te]:[]}))}}if(Re)return c.jsxs("div",{className:"boot boot-error",children:[c.jsx("p",{children:Re}),c.jsx("button",{type:"button",onClick:Gm,children:"重试"})]});if(le===null)return c.jsx("div",{className:"boot"});if(le==="unauthenticated")return c.jsx(kue,{branding:tt,onUsername:TP});if(!Ge)return c.jsx("div",{className:"boot"});const ia=Ge.capabilities.createAgents,aw=Ge.capabilities.manageAgents,ws=ia?An:null,Xm=ia&&Me,Qm=ia&&Z,ow=aw&&fr,lw=YL(e,Jl),Vd=q=>{var te;return((te=lw.find(xe=>xe.id===q))==null?void 0:te.label)??q},tc=Jl.find(q=>q.runtimeId&&q.apps.some(te=>Ka(q.id,te)===n)),Kd=tc&&tc.runtimeId?{runtimeId:tc.runtimeId,name:tc.name,region:tc.region??"cn-beijing"}:void 0,Zm=q=>{ec(Zs()),ae.current="",o(""),r(q)},DP=async q=>{const te=await cx(q.runtimeId,q.name,q.region);Zm(te)};return c.jsxs("div",{className:"layout",children:[c.jsx(jZ,{branding:tt,access:Ge,agentsSource:Fe,localApps:e,currentAgentId:n,currentAgentLabel:n?Vd(n):"",currentRuntime:Kd,onSelectAgent:Zm,features:Ht,sessions:s,currentSessionId:a,streamingSids:Le,onNewChat:()=>{st(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!1),oo()},onSearch:()=>{p&&sa(),st(null),Ot(!1),ke(!1),He(!1),St(!1),kt(!0),we("")},onQuickCreate:()=>{if(!ia){we("当前账号没有添加 Agent 的权限。");return}p&&sa(),ae.current="",o(""),Ot(!1),ke(!1),kt(!1),St(!1),st(null),yt(null),He(!0),we("")},onSkillCenter:()=>{p&&sa(),st(null),ke(!1),He(!1),kt(!1),St(!1),Ot(!0),we("")},onAddAgent:()=>{if(!ia){we("当前账号没有添加 Agent 的权限。");return}p&&sa(),ae.current="",st(null),Ot(!1),kt(!1),St(!1),o(""),He(!1),ke(!0),we("")},onManageAgents:()=>{if(!aw){we("当前账号没有管理 Agent 的权限。");return}p&&sa(),ae.current="",o(""),st(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!0),we("")},onPickSession:q=>{st(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!1),we(""),zd(q)},onDeleteSession:RP,userInfo:Zt,onLogout:NP}),(()=>{const q=c.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&c.jsx(xue,{onExit:oo}),c.jsx(xJ,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Vd(n):"Agent",value:L,onChange:O,onSubmit:()=>{if(!p&&j==="skill-create"){const Ke=L.trim();if(!Ke||ee)return;const Ye={id:`pending-${Date.now()}`,prompt:Ke,status:"provisioning",candidates:gx.map((Ze,Se)=>({id:`pending-${Se}`,model:Ze,modelLabel:Ze,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};re(!0);const Ve=++de.current;we(""),ne(Ye),O(""),Gce(Ke,Ze=>{de.current===Ve&&ne(Ze)}).then(Ze=>{de.current===Ve&&ne(Ze)}).catch(Ze=>{de.current===Ve&&(ne(null),O(Ke),we(Ze instanceof Error?Ze.message:String(Ze)))}).finally(()=>{de.current===Ve&&re(!1)});return}const te=L;if(O(""),p){IP(te);return}const xe=G,je=oe;W([]),he(Vs()),iw(te,xe,je),H0(xe)},disabled:p?!1:!We||j==="temporary"||j==="agent"&&!n,busy:p?g:j==="skill-create"?ee:yn,showMeta:P.length>0&&!p,attachments:p?[]:G,skills:p?[]:tr,agents:p?[]:Tr,invocation:p?Vs():oe,capabilitiesLoading:!p&&Ce,allowAttachments:!p,onInvocationChange:he,onAddFiles:OP,onRemoveAttachment:nr,newChatMode:p?"agent":j,newChatLayout:!p&&P.length===0&&D===null,showModeSelector:!p&&P.length===0&&D===null&&ia,temporaryEnabled:H.temporaryEnabled,skillCreateEnabled:H.skillCreateEnabled,onModeChange:te=>{if(!(te==="temporary"&&!H.temporaryEnabled||te==="skill-create"&&!H.skillCreateEnabled)){if(te==="temporary"){S(te),SP();return}if(S(te),we(""),te==="skill-create"){he(Vs());const xe=a&&Y.length===0&&G.length>0?a:"";Vt(G),W([]),xe&&(ae.current="",o(""),Pn(xe))}}}})]});return c.jsxs("section",{className:"main-shell",children:[c.jsx(BZ,{apps:lw.map(te=>te.id),appName:n,onAppChange:Zm,agentLabel:Vd,title:Xm?"添加 Agent":Qm?"添加 AgentKit 智能体":rr?void 0:Kt?"搜索":ow?"管理 Agent":ws?void 0:U,crumbs:rr?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:Kt||Qm||Xm||!ws?void 0:ws==="menu"?[{label:Bue,onClick:()=>{st(null),yt(null),He(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Fd(!0)},{label:Fue[ws]}],rightContent:c.jsx(Jue,{tasks:ia?Cn:[],onCancel:In})}),c.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[wt&&c.jsx("div",{className:"error",children:wt}),_e&&c.jsxs("div",{className:"session-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载会话…"]}),ow?c.jsx(zZ,{currentRuntimeId:Kd==null?void 0:Kd.runtimeId,onConnect:DP}):Xm?c.jsx(fM,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:zue,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{He(!1),yt(null),st("menu")}}]}):Kt?c.jsx(pZ,{userId:We,appId:n,agentInfo:J,capabilitiesLoading:Ce,agentLabel:Vd,onOpenSession:kP}):Qm?c.jsx(HZ,{onAdded:te=>{ec(Zs()),ke(!1),r(te)},onCancel:()=>ke(!1)}):rr?c.jsx(nZ,{}):ws!==null&&!jn?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,height:"100%",padding:24,textAlign:"center",color:"var(--text-secondary, #6b7280)"},children:[c.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),c.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",c.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",c.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):ws==="menu"?c.jsx(Xee,{onSelect:te=>{yt(null),st(te)},onImport:te=>{yt(te),st("custom")}}):ws==="intelligent"?c.jsx(_te,{userId:We,onBack:()=>st("menu"),onCreate:$d,onAgentAdded:rw,onDeploymentTaskChange:Jt}):ws==="custom"?c.jsx(une,{initialDraft:Lt??void 0,onBack:()=>st("menu"),onCreate:$d,onAgentAdded:rw,features:Ht,onDeploymentTaskChange:Jt}):ws==="template"?c.jsx(hne,{onBack:()=>st("menu"),onCreate:$d}):ws==="workflow"?c.jsx($ce,{onBack:()=>st("menu"),onCreate:$d}):P.length===0&&D?c.jsx(uue,{initialJob:D}):P.length===0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"welcome",children:[c.jsx(Yl,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":j==="skill-create"?"想创建一个什么 Skill?":K}),q]}),!p&&j==="agent"?c.jsx(FN,{appName:n,activeAgent:kn,seenAgents:er,execPath:_r}):null]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"transcript",ref:vP,onScroll:_P,children:P.map((te,xe)=>{var Ye;const je=xe===P.length-1;if(te.role==="user"){const Ve=te.blocks.map(pt=>pt.kind==="text"?pt.text:"").join(""),Ze=te.blocks.flatMap(pt=>pt.kind==="attachment"?pt.files:[]),Se=te.blocks.find(pt=>pt.kind==="invocation");return c.jsxs(Gt.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Se==null?void 0:Se.kind)==="invocation"&&c.jsx(fx,{value:Se.value}),Ze.length>0&&c.jsx(px,{appName:n,items:Ze}),Ve&&c.jsx("div",{className:"bubble",children:c.jsx(_d,{text:Ve})}),c.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ye=te.meta)==null?void 0:Ye.ts)&&c.jsx("span",{className:"meta-text",children:wP(te.meta.ts)}),c.jsx(TS,{text:Ve})]})]},xe)}const Ke=te.blocks.length===0;return c.jsx(Gt.div,{className:"turn turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:Ke?je&&zt?c.jsx(dM,{}):null:c.jsxs(c.Fragment,{children:[c.jsx(mx,{appName:n,blocks:te.blocks,onAction:LP,onAuth:MP}),!(je&&zt)&&!que(te)&&c.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(je&&zt)&&!Gue(te)&&c.jsxs("div",{className:"turn-meta",children:[c.jsxs("div",{className:"turn-actions",children:[!p&&c.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>ct(!0),children:c.jsx(Vue,{})}),c.jsx(TS,{text:Yue(te)})]}),te.meta&&c.jsx("span",{className:"meta-text",children:Kue(te.meta)})]})]})},xe)})}),!p&&c.jsx(FN,{appName:n,activeAgent:kn,seenAgents:er,execPath:_r}),q]})]})]})})(),vt&&a&&c.jsx(Tue,{appName:n,sessionId:a,onClose:()=>ct(!1)}),c.jsx(Eue,{open:b,state:N,error:A,onCancel:AP,onConfirm:()=>void CP()}),Bd&&c.jsx("div",{className:"confirm-scrim",onClick:()=>Fd(!1),children:c.jsxs("div",{className:"confirm-box",onClick:q=>q.stopPropagation(),children:[c.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),c.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),c.jsxs("div",{className:"confirm-actions",children:[c.jsx("button",{className:"confirm-btn",onClick:()=>Fd(!1),children:"取消"}),c.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{yt(null),st("menu"),Fd(!1)},children:"确定返回"})]})]})})]})}(()=>{if(!(window.opener&&window.opener!==window&&/[?&](code|state|error)=/.test(window.location.search)))return!1;try{window.opener.postMessage({veadkOAuth:!0,url:window.location.href},window.location.origin)}catch{}return window.close(),!0})()||z0.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(x5,{reducedMotion:"user",children:c.jsx(J9,{maskOpacity:.9,children:c.jsx(nde,{})})})}));export{v as A,bm as B,Or as C,ode as D,Qc as E,Va as F,XR as G,sde as R,Zn as V,et as a,gl as b,DT as c,lde as d,$E as e,kH as f,Bu as g,dt as h,zV as i,XV as j,AH as k,td as l,XK as m,RV as n,OV as o,sY as p,TK as q,NK as r,oO as s,c as t,Be as u,At as v,it as w,ade as x,$V as y,$a as z}; diff --git a/veadk/webui/index.html b/veadk/webui/index.html index bd5a634b..b251972d 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,8 +5,8 @@ VeADK Studio - - + +
From 10220a28b08ea6e5918720f2712a67eb03a45530 Mon Sep 17 00:00:00 2001 From: songyichun1 Date: Thu, 23 Jul 2026 16:52:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8C=89=E7=85=A7=E5=89=8D=E7=AB=AFspec?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E8=BF=9B=E8=A1=8C=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/create/CustomCreate.css | 16 +- frontend/src/create/CustomCreate.tsx | 41 +++- ...tor-C8L3YPfR.js => CodeEditor-Bryey6AH.js} | 2 +- ...SU.js => MarkdownPromptEditor-BBPnStN4.js} | 2 +- veadk/webui/assets/index-3Gub9jTa.css | 10 + veadk/webui/assets/index-BXS3Zyyl.css | 10 - .../{index-gtSqVSNF.js => index-CGGQQgcg.js} | 208 +++++++++--------- veadk/webui/index.html | 4 +- 8 files changed, 169 insertions(+), 124 deletions(-) rename veadk/webui/assets/{CodeEditor-C8L3YPfR.js => CodeEditor-Bryey6AH.js} (99%) rename veadk/webui/assets/{MarkdownPromptEditor-CwT7JlSU.js => MarkdownPromptEditor-BBPnStN4.js} (99%) create mode 100644 veadk/webui/assets/index-3Gub9jTa.css delete mode 100644 veadk/webui/assets/index-BXS3Zyyl.css rename veadk/webui/assets/{index-gtSqVSNF.js => index-CGGQQgcg.js} (79%) diff --git a/frontend/src/create/CustomCreate.css b/frontend/src/create/CustomCreate.css index 94b9eb60..a79ed31e 100644 --- a/frontend/src/create/CustomCreate.css +++ b/frontend/src/create/CustomCreate.css @@ -990,8 +990,8 @@ align-items: center; justify-content: space-between; width: 100%; - height: 34px; - min-height: 34px; + height: 32px; + min-height: 32px; gap: 8px; padding: 0 8px 0 10px; border: 0; @@ -1011,6 +1011,10 @@ background-color: hsl(var(--background)); filter: drop-shadow(0 2px 2px hsl(var(--foreground) / 0.2)); } +.cw-a2a-space-trigger:focus-visible { + outline: none; + box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12); +} .cw-a2a-space-trigger:disabled { cursor: not-allowed; opacity: 0.5; @@ -1081,13 +1085,17 @@ } .cw-a2a-space-refresh { flex-shrink: 0; - width: 34px; - height: 34px; + width: 32px; + height: 32px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--muted) / 0.38); color: hsl(var(--foreground)); } +.cw-a2a-space-refresh:focus-visible { + outline: none; + box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12); +} .cw-a2a-space-status { display: inline-flex; align-items: center; diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index 24669a51..2a0c350f 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -230,6 +230,43 @@ function DebugRunIcon({ className }: { className?: string }) { ); } +function A2aSelectChevronIcon({ className }: { className?: string }) { + return ( + + ); +} + +function A2aRefreshIcon({ className }: { className?: string }) { + return ( + + ); +} + const AGENT_TYPE_GAP_PX = 4; const AGENT_TYPE_BAR_LABELS: Record< NonNullable, @@ -510,7 +547,7 @@ function A2aSpaceSelect({ onClick={() => setOpen((current) => !current)} > {selectedLabel} - + {open && (
) : ( - + )}
diff --git a/veadk/webui/assets/CodeEditor-C8L3YPfR.js b/veadk/webui/assets/CodeEditor-Bryey6AH.js similarity index 99% rename from veadk/webui/assets/CodeEditor-C8L3YPfR.js rename to veadk/webui/assets/CodeEditor-Bryey6AH.js index 6332d5c0..c18a53d0 100644 --- a/veadk/webui/assets/CodeEditor-C8L3YPfR.js +++ b/veadk/webui/assets/CodeEditor-Bryey6AH.js @@ -1,4 +1,4 @@ -import{A as xe,t as sf}from"./index-gtSqVSNF.js";const of=1024;let Zm=0,Le=class{constructor(e,t){this.from=e,this.to=t}};class M{constructor(e={}){this.id=Zm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}M.closedBy=new M({deserialize:i=>i.split(" ")});M.openedBy=new M({deserialize:i=>i.split(" ")});M.group=new M({deserialize:i=>i.split(" ")});M.isolate=new M({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});M.contextHash=new M({perNode:!0});M.lookAhead=new M({perNode:!0});M.mounted=new M({perNode:!0});class Ri{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[M.mounted.id]}}const Am=Object.create(null);class Oe{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Am,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Oe(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(M.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(M.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}}Oe.none=new Oe("",Object.create(null),0,8);class Kn{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|I.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:na(Oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new U(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new U(Oe.none,t,n,r)))}static build(e){return zm(e)}}U.empty=new U(Oe.none,[],[],0);class ta{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ta(this.buffer,this.index)}}class It{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Oe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function vn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=h;e+=t){let c=l[e],O=a[e]+o.from,f;if(!(!(s&I.EnterBracketed&&c instanceof U&&(f=Ri.get(c))&&!f.overlay&&f.bracketed&&n>=O&&n<=O+c.length)&&!lf(r,n,O,O+c.length))){if(c instanceof It){if(s&I.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-O,r);if(u>-1)return new dt(new qm(o,c,e,O),null,u)}else if(s&I.IncludeAnonymous||!c.type.isAnonymous||ia(c)){let u;if(!(s&I.IgnoreMounts)&&(u=Ri.get(c))&&!u.overlay)return new Pe(u.tree,O,e,o);let d=new Pe(c,O,e,o);return s&I.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,r,s)}}}if(s&I.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&I.IgnoreOverlays)&&(r=Ri.get(this._tree))&&r.overlay){let s=e-this.from,o=n&I.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new Pe(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ch(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Go(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class qm{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class dt extends af{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new dt(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&I.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new dt(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new dt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new dt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hf(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let l=new Pe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(vn(l,e,t,!1))}}return r?hf(r):n}class Ur{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~I.EnterBracketed,e instanceof Pe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Pe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&I.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&I.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&I.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&I.IncludeAnonymous||l instanceof It||!l.type.isAnonymous||ia(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Go(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function ia(i){return i.children.some(e=>e instanceof It||!e.type.isAnonymous||ia(e))}function zm(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=of,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new ta(t,t.length):t,a=n.types,h=0,c=0;function O(x,k,$,q,_,B){let{id:z,start:A,end:V,size:E}=l,G=c,oe=h;if(E<0)if(l.next(),E==-1){let me=s[z];$.push(me),q.push(A-x);return}else if(E==-3){h=z;return}else if(E==-4){c=z;return}else throw new RangeError(`Unrecognized record size: ${E}`);let fe=a[z],we,ie,pe=A-x;if(V-A<=r&&(ie=g(l.pos-k,_))){let me=new Uint16Array(ie.size-ie.skip),ve=l.pos-ie.size,Me=me.length;for(;l.pos>ve;)Me=Q(ie.start,me,Me);we=new It(me,V-ie.start,n),pe=ie.start-x}else{let me=l.pos-E;l.next();let ve=[],Me=[],H=z>=o?z:-1,Fe=0,ni=V;for(;l.pos>me;)H>=0&&l.id==H&&l.size>=0?(l.end<=ni-r&&(d(ve,Me,A,Fe,l.end,ni,H,G,oe),Fe=ve.length,ni=l.end),l.next()):B>2500?f(A,me,ve,Me):O(A,me,ve,Me,H,B+1);if(H>=0&&Fe>0&&Fe-1&&Fe>0){let ki=u(fe,oe);we=na(fe,ve,Me,0,ve.length,0,V-A,ki,ki)}else we=m(fe,ve,Me,V-A,G-V,oe)}$.push(we),q.push(pe)}function f(x,k,$,q){let _=[],B=0,z=-1;for(;l.pos>k;){let{id:A,start:V,end:E,size:G}=l;if(G>4)l.next();else{if(z>-1&&V=0;E-=3)A[G++]=_[E],A[G++]=_[E+1]-V,A[G++]=_[E+2]-V,A[G++]=G;$.push(new It(A,_[2]-V,n)),q.push(V-x)}}function u(x,k){return($,q,_)=>{let B=0,z=$.length-1,A,V;if(z>=0&&(A=$[z])instanceof U){if(!z&&A.type==x&&A.length==_)return A;(V=A.prop(M.lookAhead))&&(B=q[z]+A.length+V)}return m(x,$,q,_,B,k)}}function d(x,k,$,q,_,B,z,A,V){let E=[],G=[];for(;x.length>q;)E.push(x.pop()),G.push(k.pop()+$-_);x.push(m(n.types[z],E,G,B-_,A-B,V)),k.push(_-$)}function m(x,k,$,q,_,B,z){if(B){let A=[M.contextHash,B];z=z?[A].concat(z):[A]}if(_>25){let A=[M.lookAhead,_];z=z?[A].concat(z):[A]}return new U(x,k,$,q,z)}function g(x,k){let $=l.fork(),q=0,_=0,B=0,z=$.end-r,A={size:0,start:0,skip:0};e:for(let V=$.pos-x;$.pos>V;){let E=$.size;if($.id==k&&E>=0){A.size=q,A.start=_,A.skip=B,B+=4,q+=4,$.next();continue}let G=$.pos-E;if(E<0||G=o?4:0,fe=$.start;for($.next();$.pos>G;){if($.size<0)if($.size==-3||$.size==-4)oe+=4;else break e;else $.id>=o&&(oe+=4);$.next()}_=fe,q+=E,B+=oe}return(k<0||q==x)&&(A.size=q,A.start=_,A.skip=B),A.size>4?A:void 0}function Q(x,k,$){let{id:q,start:_,end:B,size:z}=l;if(l.next(),z>=0&&q4){let V=l.pos-(z-4);for(;l.pos>V;)$=Q(x,k,$)}k[--$]=A,k[--$]=B-x,k[--$]=_-x,k[--$]=q}else z==-3?h=q:z==-4&&(c=q);return $}let S=[],y=[];for(;l.pos>0;)O(i.start||0,i.bufferStart||0,S,y,-1,0);let w=(e=i.length)!==null&&e!==void 0?e:S.length?y[0]+S[0].length:0;return new U(a[i.topID],S.reverse(),y.reverse(),w)}const Oh=new WeakMap;function Wr(i,e){if(!i.isAnonymous||e instanceof It||e.type!=i)return 1;let t=Oh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof U)){t=1;break}t+=Wr(i,n)}Oh.set(e,t)}return t}function na(i,e,t,n,r,s,o,l,a){let h=0;for(let d=n;d=c)break;k+=$}if(y==w+1){if(k>c){let $=d[w];u($.children,$.positions,0,$.children.length,m[w]+S);continue}O.push(d[w])}else{let $=m[y-1]+d[y-1].length-x;O.push(na(i,d,m,w,y,x,$,null,a))}f.push(x+S-s)}}return u(e,t,n,r,0),(l||a)(O,f,o)}class ra{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof dt?this.setBuffer(e.context.buffer,e.index,t):e instanceof Pe&&this.map.set(e.tree,t)}get(e){return e instanceof dt?this.getBuffer(e.context.buffer,e.index):e instanceof Pe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xt{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new Xt(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=n)for(;o&&o.from=f.from||O<=f.to||h){let u=Math.max(f.from,a)-h,d=Math.min(f.to,O)-h;f=u>=d?null:new Xt(u,d,f.tree,f.offset+h,l>0,!!c)}if(f&&r.push(f),o.to>O)break;o=snew Le(r.from,r.to)):[new Le(0,0)]:[new Le(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}}class _m{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function cf(i){return(e,t,n,r)=>new jm(e,i,t,n,r)}class fh{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function uh(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class Em{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Io=new M({perNode:!0});class jm{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new U(n.type,n.children,n.positions,n.length,n.propValues.concat([[Io,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[M.mounted.id]=new Ri(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let O=c.from+h.pos,f=c.to+h.pos;O>=r.from&&f<=r.to&&!t.ranges.some(u=>u.fromO)&&t.ranges.push({from:O,to:f})}}l=!1}else if(n&&(o=Vm(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Le(O.from-r.from,O.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new Le(r.from,r.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=mh(this.ranges,t.ranges);h.length&&(uh(h),this.inner.splice(t.index,0,new fh(t.parser,t.parser.startParse(this.input,gh(t.mounts,h),h),t.ranges.map(c=>new Le(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function Vm(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function dh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,I.IgnoreOverlays|I.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}let Lm=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Io))!==null&&t!==void 0?t:n.to,this.inner=new ph(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Io))!==null&&e!==void 0?e:t.to,this.inner=new ph(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(M.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function mh(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new Le(l,a.to))):a.to>l?t[s--]=new Le(l,a.to):t.splice(s--,1))}}return n}function Dm(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==i.length?1e9:o?i[r].to:i[r].from,O=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,t),u=Math.min(c,O,n);fnew Le(f.from+n,f.to+n)),O=Dm(e,c,a,h);for(let f=0,u=a;;f++){let d=f==O.length,m=d?h:O[f].from;if(m>u&&t.push(new Xt(u,m,r.tree,-o,s.from>=u||s.openStart,s.to<=m||s.openEnd)),d)break;u=O[f].to}}else t.push(new Xt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var Qh={};class Nr{constructor(e,t,n,r,s,o,l,a,h,c=0,O){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new Nr(e,[],t,n,n,0,[],0,r?new Sh(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==n)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Nr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Bm(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}}class Sh{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Bm{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Fr{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fr(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fr(this.stack,this.pos,this.index)}}function un(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Mr{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const bh=new Mr;class Gm{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=bh,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=bh,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class Zi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Of(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Zi.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class Hr{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?un(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(Of(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Hr.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class ae{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Of(i,e,t,n,r,s){let o=0,l=1<0){let d=i[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||Im(d,e.token.value,r,s))){e.acceptToken(d);break}}let c=e.next,O=0,f=i[o+2];if(e.next<0&&f>O&&i[h+f*3-3]==65535){o=i[h+f*3-1];continue e}for(;O>1,d=h+u+(u<<1),m=i[d],g=i[d+1]||65536;if(c=g)O=u+1;else{o=i[d+2],e.advance();continue e}}break}}function yh(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function Im(i,e,t,n){let r=yh(t,n,e);return r<0||yh(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}let Um=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?xh(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xh(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof U){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};class Nm{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Mr)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let f=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!c.extend&&(n=O,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new Mr,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Mr,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Um(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&Km(r);if(o)return ze&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw ze&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return ze&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let f=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(f>-1&&O.length&&(!h||(O.prop(M.contextHash)||0)==c))return e.useNode(O,f),ze&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof U)||O.children.length==0||O.positions[0]>0)break;let u=O.children[0];if(u instanceof U&&O.positions[0]==0)O=u;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),ze&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hr?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return kh(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),ze&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let O=l.split(),f=c;for(let u=0;u<10&&O.forceReduce()&&(ze&&console.log(f+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,n));u++)ze&&(f=this.stackID(O)+" -> ");for(let u of l.recoverByInsert(a))ze&&console.log(c+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),ze&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),kh(l,n)):(!r||r.scorei;class Ts{constructor(e){this.start=e.start,this.shift=e.shift||Us,this.reduce=e.reduce||Us,this.reuse=e.reuse||Us,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Rt extends sa{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[h++]);else{let O=l[h+-c];for(let f=-c;f>0;f--)s(l[h++],a,O);h++}}}this.nodeSet=new Kn(t.map((l,a)=>Oe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=of;let o=un(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Zi(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Fm(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vt(this.data,s+2);else break;r=t(vt(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(Rt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Ph(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}let Jm=0,ct=class Uo{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Jm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Uo&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Uo(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Kr(e);return n=>n.modified.indexOf(t)>-1?n:Kr.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},eg=0;class Kr{constructor(e){this.name=e,this.instances=[],this.id=eg++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&tg(t,l.modified));if(n)return n;let r=[],s=new ct(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=ig(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Kr.get(l,a));return s}}function tg(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function ig(i){let e=[[]];for(let t=0;tn.length-t.length)}function zt(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let O=0;;){if(l=="..."&&O>0&&O+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),O+=f[0].length,O==r.length)break;let u=r[O++];if(O==r.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+r);l=r.slice(O)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+r);let c=new Tn(n,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return ff.add(e)}const ff=new M({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Tn(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}});class Tn{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function ng(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function rg(i,e,t,n=0,r=i.length){let s=new sg(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}class sg{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(u=>!u.scope||u.scope(o)));let h=r,c=og(e)||Tn.empty,O=ng(s,c.tags);if(O&&(h&&(h+=" "),h+=O,c.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,l),h),c.opaque)return;let f=e.tree&&e.tree.prop(M.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),d=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,Q=l;;g++){let S=g=y||!e.nextSibling())););if(!S||y>n)break;Q=S.to+l,Q>t&&(this.highlightRange(u.cursor(),Math.max(t,S.from+l),Math.min(n,Q),"",d),this.startSpan(Math.min(n,Q),h))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function og(i){let e=i.type.prop(ff);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const T=ct.define,cr=T(),Vt=T(),$h=T(Vt),wh=T(Vt),Yt=T(),Or=T(Yt),Ns=T(Yt),ht=T(),oi=T(ht),ot=T(),lt=T(),No=T(),sn=T(No),fr=T(),p={comment:cr,lineComment:T(cr),blockComment:T(cr),docComment:T(cr),name:Vt,variableName:T(Vt),typeName:$h,tagName:T($h),propertyName:wh,attributeName:T(wh),className:T(Vt),labelName:T(Vt),namespace:T(Vt),macroName:T(Vt),literal:Yt,string:Or,docString:T(Or),character:T(Or),attributeValue:T(Or),number:Ns,integer:T(Ns),float:T(Ns),bool:T(Yt),regexp:T(Yt),escape:T(Yt),color:T(Yt),url:T(Yt),keyword:ot,self:T(ot),null:T(ot),atom:T(ot),unit:T(ot),modifier:T(ot),operatorKeyword:T(ot),controlKeyword:T(ot),definitionKeyword:T(ot),moduleKeyword:T(ot),operator:lt,derefOperator:T(lt),arithmeticOperator:T(lt),logicOperator:T(lt),bitwiseOperator:T(lt),compareOperator:T(lt),updateOperator:T(lt),definitionOperator:T(lt),typeOperator:T(lt),controlOperator:T(lt),punctuation:No,separator:T(No),bracket:sn,angleBracket:T(sn),squareBracket:T(sn),paren:T(sn),brace:T(sn),content:ht,heading:oi,heading1:T(oi),heading2:T(oi),heading3:T(oi),heading4:T(oi),heading5:T(oi),heading6:T(oi),contentSeparator:T(ht),list:T(ht),quote:T(ht),emphasis:T(ht),strong:T(ht),link:T(ht),monospace:T(ht),strikethrough:T(ht),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:fr,documentMeta:T(fr),annotation:T(fr),processingInstruction:T(fr),definition:ct.defineModifier("definition"),constant:ct.defineModifier("constant"),function:ct.defineModifier("function"),standard:ct.defineModifier("standard"),local:ct.defineModifier("local"),special:ct.defineModifier("special")};for(let i in p){let e=p[i];e instanceof ct&&(e.name=i)}uf([{tag:p.link,class:"tok-link"},{tag:p.heading,class:"tok-heading"},{tag:p.emphasis,class:"tok-emphasis"},{tag:p.strong,class:"tok-strong"},{tag:p.keyword,class:"tok-keyword"},{tag:p.atom,class:"tok-atom"},{tag:p.bool,class:"tok-bool"},{tag:p.url,class:"tok-url"},{tag:p.labelName,class:"tok-labelName"},{tag:p.inserted,class:"tok-inserted"},{tag:p.deleted,class:"tok-deleted"},{tag:p.literal,class:"tok-literal"},{tag:p.string,class:"tok-string"},{tag:p.number,class:"tok-number"},{tag:[p.regexp,p.escape,p.special(p.string)],class:"tok-string2"},{tag:p.variableName,class:"tok-variableName"},{tag:p.local(p.variableName),class:"tok-variableName tok-local"},{tag:p.definition(p.variableName),class:"tok-variableName tok-definition"},{tag:p.special(p.variableName),class:"tok-variableName2"},{tag:p.definition(p.propertyName),class:"tok-propertyName tok-definition"},{tag:p.typeName,class:"tok-typeName"},{tag:p.namespace,class:"tok-namespace"},{tag:p.className,class:"tok-className"},{tag:p.macroName,class:"tok-macroName"},{tag:p.propertyName,class:"tok-propertyName"},{tag:p.operator,class:"tok-operator"},{tag:p.comment,class:"tok-comment"},{tag:p.meta,class:"tok-meta"},{tag:p.invalid,class:"tok-invalid"},{tag:p.punctuation,class:"tok-punctuation"}]);const lg=316,ag=317,vh=1,hg=2,cg=3,Og=4,fg=318,ug=320,dg=321,pg=5,mg=6,gg=0,Fo=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],df=125,Qg=59,Ho=47,Sg=42,bg=43,yg=45,xg=60,kg=44,Pg=63,$g=46,wg=91,vg=new Ts({start:!1,shift(i,e){return e==pg||e==mg||e==ug?i:e==dg},strict:!1}),Tg=new ae((i,e)=>{let{next:t}=i;(t==df||t==-1||e.context)&&i.acceptToken(fg)},{contextual:!0,fallback:!0}),Xg=new ae((i,e)=>{let{next:t}=i,n;Fo.indexOf(t)>-1||t==Ho&&((n=i.peek(1))==Ho||n==Sg)||t!=df&&t!=Qg&&t!=-1&&!e.context&&i.acceptToken(lg)},{contextual:!0}),Cg=new ae((i,e)=>{i.next==wg&&!e.context&&i.acceptToken(ag)},{contextual:!0}),Rg=new ae((i,e)=>{let{next:t}=i;if(t==bg||t==yg){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(vh);i.acceptToken(n?vh:hg)}}else t==Pg&&i.peek(1)==$g&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(cg))},{contextual:!0});function Fs(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const Zg=new ae((i,e)=>{if(i.next!=xg||!e.dialectEnabled(gg)||(i.advance(),i.next==Ho))return;let t=0;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(Fs(i.next,!0)){for(i.advance(),t++;Fs(i.next,!1);)i.advance(),t++;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==kg)return;for(let n=0;;n++){if(n==7){if(!Fs(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Og,-t)}),Ag=zt({"get set async static":p.modifier,"for while do if else switch try catch finally return throw break continue default case defer":p.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":p.operatorKeyword,"let var const using function class extends":p.definitionKeyword,"import export from":p.moduleKeyword,"with debugger new":p.keyword,TemplateString:p.special(p.string),super:p.atom,BooleanLiteral:p.bool,this:p.self,null:p.null,Star:p.modifier,VariableName:p.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":p.function(p.variableName),VariableDefinition:p.definition(p.variableName),Label:p.labelName,PropertyName:p.propertyName,PrivatePropertyName:p.special(p.propertyName),"CallExpression/MemberExpression/PropertyName":p.function(p.propertyName),"FunctionDeclaration/VariableDefinition":p.function(p.definition(p.variableName)),"ClassDeclaration/VariableDefinition":p.definition(p.className),"NewExpression/VariableName":p.className,PropertyDefinition:p.definition(p.propertyName),PrivatePropertyDefinition:p.definition(p.special(p.propertyName)),UpdateOp:p.updateOperator,"LineComment Hashbang":p.lineComment,BlockComment:p.blockComment,Number:p.number,String:p.string,Escape:p.escape,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,RegExp:p.regexp,Equals:p.definitionOperator,Arrow:p.function(p.punctuation),": Spread":p.punctuation,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace,"InterpolationStart InterpolationEnd":p.special(p.brace),".":p.derefOperator,", ;":p.separator,"@":p.meta,TypeName:p.typeName,TypeDefinition:p.definition(p.typeName),"type enum interface implements namespace module declare":p.definitionKeyword,"abstract global Privacy readonly override":p.modifier,"is keyof unique infer asserts":p.operatorKeyword,JSXAttributeValue:p.attributeValue,JSXText:p.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":p.angleBracket,"JSXIdentifier JSXNameSpacedName":p.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":p.attributeName,"JSXBuiltin/JSXIdentifier":p.standard(p.tagName)}),qg={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Wg={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Mg={__proto__:null,"<":193},zg=Rt.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:vg,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Ag],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Xg,Cg,Rg,Zg,2,3,4,5,6,7,8,9,10,11,12,13,14,Tg,new Hr("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Hr("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:i=>qg[i]||-1},{term:343,get:i=>Wg[i]||-1},{term:95,get:i=>Mg[i]||-1}],tokenPrec:15201});let Ko=[],pf=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=pf[n])e=n+1;else return!0;if(e==t)return!1}}function Th(i){return i>=127462&&i<=127487}const Xh=8205;function Eg(i,e,t=!0,n=!0){return(t?mf:jg)(i,e,n)}function mf(i,e,t){if(e==i.length)return e;e&&gf(i.charCodeAt(e))&&Qf(i.charCodeAt(e-1))&&e--;let n=Hs(i,e);for(e+=Ch(n);e=0&&Th(Hs(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function jg(i,e,t){for(;e>1;){let n=mf(i,e-2,t);if(n=56320&&i<57344}function Qf(i){return i>=55296&&i<56320}function Ch(i){return i<65536?1:2}class D{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Vi(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ot.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vi(this,e,t);let n=[];return this.decompose(e,t,n,0),Ot.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new gn(this),s=new gn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new gn(this,e)}iterRange(e,t=this.length){return new Sf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?D.empty:e.length<=32?new le(e):Ot.from(le.split(e,[]))}}class le extends D{constructor(e,t=Vg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new Yg(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new le(Rh(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=zr(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new le(l,o.length+s.length));else{let a=l.length>>1;n.push(new le(l.slice(0,a)),new le(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof le))return super.replace(e,t,n);[e,t]=Vi(this,e,t);let r=zr(this.text,zr(n.text,Rh(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new le(r,s):Ot.from(le.split(r,[]),s)}sliceString(e,t=this.length,n=` +import{A as xe,t as sf}from"./index-CGGQQgcg.js";const of=1024;let Zm=0,Le=class{constructor(e,t){this.from=e,this.to=t}};class M{constructor(e={}){this.id=Zm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}M.closedBy=new M({deserialize:i=>i.split(" ")});M.openedBy=new M({deserialize:i=>i.split(" ")});M.group=new M({deserialize:i=>i.split(" ")});M.isolate=new M({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});M.contextHash=new M({perNode:!0});M.lookAhead=new M({perNode:!0});M.mounted=new M({perNode:!0});class Ri{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[M.mounted.id]}}const Am=Object.create(null);class Oe{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Am,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Oe(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(M.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(M.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}}Oe.none=new Oe("",Object.create(null),0,8);class Kn{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|I.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:na(Oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new U(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new U(Oe.none,t,n,r)))}static build(e){return zm(e)}}U.empty=new U(Oe.none,[],[],0);class ta{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ta(this.buffer,this.index)}}class It{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Oe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function vn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=h;e+=t){let c=l[e],O=a[e]+o.from,f;if(!(!(s&I.EnterBracketed&&c instanceof U&&(f=Ri.get(c))&&!f.overlay&&f.bracketed&&n>=O&&n<=O+c.length)&&!lf(r,n,O,O+c.length))){if(c instanceof It){if(s&I.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-O,r);if(u>-1)return new dt(new qm(o,c,e,O),null,u)}else if(s&I.IncludeAnonymous||!c.type.isAnonymous||ia(c)){let u;if(!(s&I.IgnoreMounts)&&(u=Ri.get(c))&&!u.overlay)return new Pe(u.tree,O,e,o);let d=new Pe(c,O,e,o);return s&I.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,r,s)}}}if(s&I.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&I.IgnoreOverlays)&&(r=Ri.get(this._tree))&&r.overlay){let s=e-this.from,o=n&I.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new Pe(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ch(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Go(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class qm{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class dt extends af{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new dt(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&I.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new dt(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new dt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new dt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hf(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let l=new Pe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(vn(l,e,t,!1))}}return r?hf(r):n}class Ur{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~I.EnterBracketed,e instanceof Pe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Pe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&I.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&I.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&I.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&I.IncludeAnonymous||l instanceof It||!l.type.isAnonymous||ia(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Go(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function ia(i){return i.children.some(e=>e instanceof It||!e.type.isAnonymous||ia(e))}function zm(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=of,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new ta(t,t.length):t,a=n.types,h=0,c=0;function O(x,k,$,q,_,B){let{id:z,start:A,end:V,size:E}=l,G=c,oe=h;if(E<0)if(l.next(),E==-1){let me=s[z];$.push(me),q.push(A-x);return}else if(E==-3){h=z;return}else if(E==-4){c=z;return}else throw new RangeError(`Unrecognized record size: ${E}`);let fe=a[z],we,ie,pe=A-x;if(V-A<=r&&(ie=g(l.pos-k,_))){let me=new Uint16Array(ie.size-ie.skip),ve=l.pos-ie.size,Me=me.length;for(;l.pos>ve;)Me=Q(ie.start,me,Me);we=new It(me,V-ie.start,n),pe=ie.start-x}else{let me=l.pos-E;l.next();let ve=[],Me=[],H=z>=o?z:-1,Fe=0,ni=V;for(;l.pos>me;)H>=0&&l.id==H&&l.size>=0?(l.end<=ni-r&&(d(ve,Me,A,Fe,l.end,ni,H,G,oe),Fe=ve.length,ni=l.end),l.next()):B>2500?f(A,me,ve,Me):O(A,me,ve,Me,H,B+1);if(H>=0&&Fe>0&&Fe-1&&Fe>0){let ki=u(fe,oe);we=na(fe,ve,Me,0,ve.length,0,V-A,ki,ki)}else we=m(fe,ve,Me,V-A,G-V,oe)}$.push(we),q.push(pe)}function f(x,k,$,q){let _=[],B=0,z=-1;for(;l.pos>k;){let{id:A,start:V,end:E,size:G}=l;if(G>4)l.next();else{if(z>-1&&V=0;E-=3)A[G++]=_[E],A[G++]=_[E+1]-V,A[G++]=_[E+2]-V,A[G++]=G;$.push(new It(A,_[2]-V,n)),q.push(V-x)}}function u(x,k){return($,q,_)=>{let B=0,z=$.length-1,A,V;if(z>=0&&(A=$[z])instanceof U){if(!z&&A.type==x&&A.length==_)return A;(V=A.prop(M.lookAhead))&&(B=q[z]+A.length+V)}return m(x,$,q,_,B,k)}}function d(x,k,$,q,_,B,z,A,V){let E=[],G=[];for(;x.length>q;)E.push(x.pop()),G.push(k.pop()+$-_);x.push(m(n.types[z],E,G,B-_,A-B,V)),k.push(_-$)}function m(x,k,$,q,_,B,z){if(B){let A=[M.contextHash,B];z=z?[A].concat(z):[A]}if(_>25){let A=[M.lookAhead,_];z=z?[A].concat(z):[A]}return new U(x,k,$,q,z)}function g(x,k){let $=l.fork(),q=0,_=0,B=0,z=$.end-r,A={size:0,start:0,skip:0};e:for(let V=$.pos-x;$.pos>V;){let E=$.size;if($.id==k&&E>=0){A.size=q,A.start=_,A.skip=B,B+=4,q+=4,$.next();continue}let G=$.pos-E;if(E<0||G=o?4:0,fe=$.start;for($.next();$.pos>G;){if($.size<0)if($.size==-3||$.size==-4)oe+=4;else break e;else $.id>=o&&(oe+=4);$.next()}_=fe,q+=E,B+=oe}return(k<0||q==x)&&(A.size=q,A.start=_,A.skip=B),A.size>4?A:void 0}function Q(x,k,$){let{id:q,start:_,end:B,size:z}=l;if(l.next(),z>=0&&q4){let V=l.pos-(z-4);for(;l.pos>V;)$=Q(x,k,$)}k[--$]=A,k[--$]=B-x,k[--$]=_-x,k[--$]=q}else z==-3?h=q:z==-4&&(c=q);return $}let S=[],y=[];for(;l.pos>0;)O(i.start||0,i.bufferStart||0,S,y,-1,0);let w=(e=i.length)!==null&&e!==void 0?e:S.length?y[0]+S[0].length:0;return new U(a[i.topID],S.reverse(),y.reverse(),w)}const Oh=new WeakMap;function Wr(i,e){if(!i.isAnonymous||e instanceof It||e.type!=i)return 1;let t=Oh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof U)){t=1;break}t+=Wr(i,n)}Oh.set(e,t)}return t}function na(i,e,t,n,r,s,o,l,a){let h=0;for(let d=n;d=c)break;k+=$}if(y==w+1){if(k>c){let $=d[w];u($.children,$.positions,0,$.children.length,m[w]+S);continue}O.push(d[w])}else{let $=m[y-1]+d[y-1].length-x;O.push(na(i,d,m,w,y,x,$,null,a))}f.push(x+S-s)}}return u(e,t,n,r,0),(l||a)(O,f,o)}class ra{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof dt?this.setBuffer(e.context.buffer,e.index,t):e instanceof Pe&&this.map.set(e.tree,t)}get(e){return e instanceof dt?this.getBuffer(e.context.buffer,e.index):e instanceof Pe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xt{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new Xt(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=n)for(;o&&o.from=f.from||O<=f.to||h){let u=Math.max(f.from,a)-h,d=Math.min(f.to,O)-h;f=u>=d?null:new Xt(u,d,f.tree,f.offset+h,l>0,!!c)}if(f&&r.push(f),o.to>O)break;o=snew Le(r.from,r.to)):[new Le(0,0)]:[new Le(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}}class _m{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function cf(i){return(e,t,n,r)=>new jm(e,i,t,n,r)}class fh{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function uh(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class Em{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Io=new M({perNode:!0});class jm{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new U(n.type,n.children,n.positions,n.length,n.propValues.concat([[Io,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[M.mounted.id]=new Ri(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let O=c.from+h.pos,f=c.to+h.pos;O>=r.from&&f<=r.to&&!t.ranges.some(u=>u.fromO)&&t.ranges.push({from:O,to:f})}}l=!1}else if(n&&(o=Vm(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Le(O.from-r.from,O.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new Le(r.from,r.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=mh(this.ranges,t.ranges);h.length&&(uh(h),this.inner.splice(t.index,0,new fh(t.parser,t.parser.startParse(this.input,gh(t.mounts,h),h),t.ranges.map(c=>new Le(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function Vm(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function dh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,I.IgnoreOverlays|I.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}let Lm=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Io))!==null&&t!==void 0?t:n.to,this.inner=new ph(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Io))!==null&&e!==void 0?e:t.to,this.inner=new ph(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(M.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function mh(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new Le(l,a.to))):a.to>l?t[s--]=new Le(l,a.to):t.splice(s--,1))}}return n}function Dm(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==i.length?1e9:o?i[r].to:i[r].from,O=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,t),u=Math.min(c,O,n);fnew Le(f.from+n,f.to+n)),O=Dm(e,c,a,h);for(let f=0,u=a;;f++){let d=f==O.length,m=d?h:O[f].from;if(m>u&&t.push(new Xt(u,m,r.tree,-o,s.from>=u||s.openStart,s.to<=m||s.openEnd)),d)break;u=O[f].to}}else t.push(new Xt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var Qh={};class Nr{constructor(e,t,n,r,s,o,l,a,h,c=0,O){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new Nr(e,[],t,n,n,0,[],0,r?new Sh(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==n)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Nr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Bm(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}}class Sh{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Bm{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Fr{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fr(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fr(this.stack,this.pos,this.index)}}function un(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Mr{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const bh=new Mr;class Gm{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=bh,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=bh,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class Zi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Of(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Zi.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class Hr{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?un(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(Of(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Hr.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class ae{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Of(i,e,t,n,r,s){let o=0,l=1<0){let d=i[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||Im(d,e.token.value,r,s))){e.acceptToken(d);break}}let c=e.next,O=0,f=i[o+2];if(e.next<0&&f>O&&i[h+f*3-3]==65535){o=i[h+f*3-1];continue e}for(;O>1,d=h+u+(u<<1),m=i[d],g=i[d+1]||65536;if(c=g)O=u+1;else{o=i[d+2],e.advance();continue e}}break}}function yh(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function Im(i,e,t,n){let r=yh(t,n,e);return r<0||yh(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}let Um=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?xh(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xh(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof U){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};class Nm{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Mr)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let f=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!c.extend&&(n=O,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new Mr,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Mr,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Um(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&Km(r);if(o)return ze&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw ze&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return ze&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let f=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(f>-1&&O.length&&(!h||(O.prop(M.contextHash)||0)==c))return e.useNode(O,f),ze&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof U)||O.children.length==0||O.positions[0]>0)break;let u=O.children[0];if(u instanceof U&&O.positions[0]==0)O=u;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),ze&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hr?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return kh(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),ze&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let O=l.split(),f=c;for(let u=0;u<10&&O.forceReduce()&&(ze&&console.log(f+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,n));u++)ze&&(f=this.stackID(O)+" -> ");for(let u of l.recoverByInsert(a))ze&&console.log(c+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),ze&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),kh(l,n)):(!r||r.scorei;class Ts{constructor(e){this.start=e.start,this.shift=e.shift||Us,this.reduce=e.reduce||Us,this.reuse=e.reuse||Us,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Rt extends sa{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[h++]);else{let O=l[h+-c];for(let f=-c;f>0;f--)s(l[h++],a,O);h++}}}this.nodeSet=new Kn(t.map((l,a)=>Oe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=of;let o=un(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Zi(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Fm(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vt(this.data,s+2);else break;r=t(vt(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(Rt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Ph(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}let Jm=0,ct=class Uo{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Jm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Uo&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Uo(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Kr(e);return n=>n.modified.indexOf(t)>-1?n:Kr.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},eg=0;class Kr{constructor(e){this.name=e,this.instances=[],this.id=eg++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&tg(t,l.modified));if(n)return n;let r=[],s=new ct(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=ig(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Kr.get(l,a));return s}}function tg(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function ig(i){let e=[[]];for(let t=0;tn.length-t.length)}function zt(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let O=0;;){if(l=="..."&&O>0&&O+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),O+=f[0].length,O==r.length)break;let u=r[O++];if(O==r.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+r);l=r.slice(O)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+r);let c=new Tn(n,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return ff.add(e)}const ff=new M({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Tn(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}});class Tn{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function ng(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function rg(i,e,t,n=0,r=i.length){let s=new sg(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}class sg{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(u=>!u.scope||u.scope(o)));let h=r,c=og(e)||Tn.empty,O=ng(s,c.tags);if(O&&(h&&(h+=" "),h+=O,c.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,l),h),c.opaque)return;let f=e.tree&&e.tree.prop(M.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),d=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,Q=l;;g++){let S=g=y||!e.nextSibling())););if(!S||y>n)break;Q=S.to+l,Q>t&&(this.highlightRange(u.cursor(),Math.max(t,S.from+l),Math.min(n,Q),"",d),this.startSpan(Math.min(n,Q),h))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function og(i){let e=i.type.prop(ff);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const T=ct.define,cr=T(),Vt=T(),$h=T(Vt),wh=T(Vt),Yt=T(),Or=T(Yt),Ns=T(Yt),ht=T(),oi=T(ht),ot=T(),lt=T(),No=T(),sn=T(No),fr=T(),p={comment:cr,lineComment:T(cr),blockComment:T(cr),docComment:T(cr),name:Vt,variableName:T(Vt),typeName:$h,tagName:T($h),propertyName:wh,attributeName:T(wh),className:T(Vt),labelName:T(Vt),namespace:T(Vt),macroName:T(Vt),literal:Yt,string:Or,docString:T(Or),character:T(Or),attributeValue:T(Or),number:Ns,integer:T(Ns),float:T(Ns),bool:T(Yt),regexp:T(Yt),escape:T(Yt),color:T(Yt),url:T(Yt),keyword:ot,self:T(ot),null:T(ot),atom:T(ot),unit:T(ot),modifier:T(ot),operatorKeyword:T(ot),controlKeyword:T(ot),definitionKeyword:T(ot),moduleKeyword:T(ot),operator:lt,derefOperator:T(lt),arithmeticOperator:T(lt),logicOperator:T(lt),bitwiseOperator:T(lt),compareOperator:T(lt),updateOperator:T(lt),definitionOperator:T(lt),typeOperator:T(lt),controlOperator:T(lt),punctuation:No,separator:T(No),bracket:sn,angleBracket:T(sn),squareBracket:T(sn),paren:T(sn),brace:T(sn),content:ht,heading:oi,heading1:T(oi),heading2:T(oi),heading3:T(oi),heading4:T(oi),heading5:T(oi),heading6:T(oi),contentSeparator:T(ht),list:T(ht),quote:T(ht),emphasis:T(ht),strong:T(ht),link:T(ht),monospace:T(ht),strikethrough:T(ht),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:fr,documentMeta:T(fr),annotation:T(fr),processingInstruction:T(fr),definition:ct.defineModifier("definition"),constant:ct.defineModifier("constant"),function:ct.defineModifier("function"),standard:ct.defineModifier("standard"),local:ct.defineModifier("local"),special:ct.defineModifier("special")};for(let i in p){let e=p[i];e instanceof ct&&(e.name=i)}uf([{tag:p.link,class:"tok-link"},{tag:p.heading,class:"tok-heading"},{tag:p.emphasis,class:"tok-emphasis"},{tag:p.strong,class:"tok-strong"},{tag:p.keyword,class:"tok-keyword"},{tag:p.atom,class:"tok-atom"},{tag:p.bool,class:"tok-bool"},{tag:p.url,class:"tok-url"},{tag:p.labelName,class:"tok-labelName"},{tag:p.inserted,class:"tok-inserted"},{tag:p.deleted,class:"tok-deleted"},{tag:p.literal,class:"tok-literal"},{tag:p.string,class:"tok-string"},{tag:p.number,class:"tok-number"},{tag:[p.regexp,p.escape,p.special(p.string)],class:"tok-string2"},{tag:p.variableName,class:"tok-variableName"},{tag:p.local(p.variableName),class:"tok-variableName tok-local"},{tag:p.definition(p.variableName),class:"tok-variableName tok-definition"},{tag:p.special(p.variableName),class:"tok-variableName2"},{tag:p.definition(p.propertyName),class:"tok-propertyName tok-definition"},{tag:p.typeName,class:"tok-typeName"},{tag:p.namespace,class:"tok-namespace"},{tag:p.className,class:"tok-className"},{tag:p.macroName,class:"tok-macroName"},{tag:p.propertyName,class:"tok-propertyName"},{tag:p.operator,class:"tok-operator"},{tag:p.comment,class:"tok-comment"},{tag:p.meta,class:"tok-meta"},{tag:p.invalid,class:"tok-invalid"},{tag:p.punctuation,class:"tok-punctuation"}]);const lg=316,ag=317,vh=1,hg=2,cg=3,Og=4,fg=318,ug=320,dg=321,pg=5,mg=6,gg=0,Fo=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],df=125,Qg=59,Ho=47,Sg=42,bg=43,yg=45,xg=60,kg=44,Pg=63,$g=46,wg=91,vg=new Ts({start:!1,shift(i,e){return e==pg||e==mg||e==ug?i:e==dg},strict:!1}),Tg=new ae((i,e)=>{let{next:t}=i;(t==df||t==-1||e.context)&&i.acceptToken(fg)},{contextual:!0,fallback:!0}),Xg=new ae((i,e)=>{let{next:t}=i,n;Fo.indexOf(t)>-1||t==Ho&&((n=i.peek(1))==Ho||n==Sg)||t!=df&&t!=Qg&&t!=-1&&!e.context&&i.acceptToken(lg)},{contextual:!0}),Cg=new ae((i,e)=>{i.next==wg&&!e.context&&i.acceptToken(ag)},{contextual:!0}),Rg=new ae((i,e)=>{let{next:t}=i;if(t==bg||t==yg){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(vh);i.acceptToken(n?vh:hg)}}else t==Pg&&i.peek(1)==$g&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(cg))},{contextual:!0});function Fs(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const Zg=new ae((i,e)=>{if(i.next!=xg||!e.dialectEnabled(gg)||(i.advance(),i.next==Ho))return;let t=0;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(Fs(i.next,!0)){for(i.advance(),t++;Fs(i.next,!1);)i.advance(),t++;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==kg)return;for(let n=0;;n++){if(n==7){if(!Fs(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Og,-t)}),Ag=zt({"get set async static":p.modifier,"for while do if else switch try catch finally return throw break continue default case defer":p.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":p.operatorKeyword,"let var const using function class extends":p.definitionKeyword,"import export from":p.moduleKeyword,"with debugger new":p.keyword,TemplateString:p.special(p.string),super:p.atom,BooleanLiteral:p.bool,this:p.self,null:p.null,Star:p.modifier,VariableName:p.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":p.function(p.variableName),VariableDefinition:p.definition(p.variableName),Label:p.labelName,PropertyName:p.propertyName,PrivatePropertyName:p.special(p.propertyName),"CallExpression/MemberExpression/PropertyName":p.function(p.propertyName),"FunctionDeclaration/VariableDefinition":p.function(p.definition(p.variableName)),"ClassDeclaration/VariableDefinition":p.definition(p.className),"NewExpression/VariableName":p.className,PropertyDefinition:p.definition(p.propertyName),PrivatePropertyDefinition:p.definition(p.special(p.propertyName)),UpdateOp:p.updateOperator,"LineComment Hashbang":p.lineComment,BlockComment:p.blockComment,Number:p.number,String:p.string,Escape:p.escape,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,RegExp:p.regexp,Equals:p.definitionOperator,Arrow:p.function(p.punctuation),": Spread":p.punctuation,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace,"InterpolationStart InterpolationEnd":p.special(p.brace),".":p.derefOperator,", ;":p.separator,"@":p.meta,TypeName:p.typeName,TypeDefinition:p.definition(p.typeName),"type enum interface implements namespace module declare":p.definitionKeyword,"abstract global Privacy readonly override":p.modifier,"is keyof unique infer asserts":p.operatorKeyword,JSXAttributeValue:p.attributeValue,JSXText:p.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":p.angleBracket,"JSXIdentifier JSXNameSpacedName":p.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":p.attributeName,"JSXBuiltin/JSXIdentifier":p.standard(p.tagName)}),qg={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Wg={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Mg={__proto__:null,"<":193},zg=Rt.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:vg,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Ag],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Xg,Cg,Rg,Zg,2,3,4,5,6,7,8,9,10,11,12,13,14,Tg,new Hr("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Hr("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:i=>qg[i]||-1},{term:343,get:i=>Wg[i]||-1},{term:95,get:i=>Mg[i]||-1}],tokenPrec:15201});let Ko=[],pf=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=pf[n])e=n+1;else return!0;if(e==t)return!1}}function Th(i){return i>=127462&&i<=127487}const Xh=8205;function Eg(i,e,t=!0,n=!0){return(t?mf:jg)(i,e,n)}function mf(i,e,t){if(e==i.length)return e;e&&gf(i.charCodeAt(e))&&Qf(i.charCodeAt(e-1))&&e--;let n=Hs(i,e);for(e+=Ch(n);e=0&&Th(Hs(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function jg(i,e,t){for(;e>1;){let n=mf(i,e-2,t);if(n=56320&&i<57344}function Qf(i){return i>=55296&&i<56320}function Ch(i){return i<65536?1:2}class D{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Vi(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ot.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vi(this,e,t);let n=[];return this.decompose(e,t,n,0),Ot.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new gn(this),s=new gn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new gn(this,e)}iterRange(e,t=this.length){return new Sf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?D.empty:e.length<=32?new le(e):Ot.from(le.split(e,[]))}}class le extends D{constructor(e,t=Vg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new Yg(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new le(Rh(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=zr(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new le(l,o.length+s.length));else{let a=l.length>>1;n.push(new le(l.slice(0,a)),new le(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof le))return super.replace(e,t,n);[e,t]=Vi(this,e,t);let r=zr(this.text,zr(n.text,Rh(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new le(r,s):Ot.from(le.split(r,[]),s)}sliceString(e,t=this.length,n=` `){[e,t]=Vi(this,e,t);let r="";for(let s=0,o=0;s<=t&&oe&&o&&(r+=n),es&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new le(n,r)),n=[],r=-1);return r>-1&&t.push(new le(n,r)),t}}class Ot extends D{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s=o){let h=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?n.push(l):l.decompose(e-o,t-o,n,h)}o=a+1}}replace(e,t,n){if([e,t]=Vi(this,e,t),n.lines=s&&t<=l){let a=o.replace(e-s,t-s,n),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new Ot(c,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){[e,t]=Vi(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ot))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],h=e.children[s];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let u of e)n+=u.lines;if(n<32){let u=[];for(let d of e)d.flatten(u);return new le(u,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function O(u){let d;if(u.lines>s&&u instanceof Ot)for(let m of u.children)O(m);else u.lines>o&&(a>o||!a)?(f(),l.push(u)):u instanceof le&&a&&(d=c[c.length-1])instanceof le&&u.lines+d.lines<=32?(a+=u.lines,h+=u.length+1,c[c.length-1]=new le(d.text.concat(u.text),d.length+1+u.length)):(a+u.lines>r&&f(),a+=u.lines,h+=u.length+1,c.push(u))}function f(){a!=0&&(l.push(c.length==1?c[0]:Ot.from(c,h)),h=-1,a=c.length=0)}for(let u of e)O(u);return f(),l.length==1?l[0]:new Ot(l,t)}}D.empty=new le([""],0);function Vg(i){let e=-1;for(let t of i)e+=t.length+1;return e}function zr(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(a>n&&(l=l.slice(0,n-r)),r0?1:(e instanceof le?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof le?r.text.length:r.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(r instanceof le){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof le?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Sf{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new gn(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class bf{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=function(){return this.iter()},gn.prototype[Symbol.iterator]=Sf.prototype[Symbol.iterator]=bf.prototype[Symbol.iterator]=function(){return this});let Yg=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function Vi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function de(i,e,t=!0,n=!0){return Eg(i,e,t,n)}function Lg(i){return i>=56320&&i<57344}function Dg(i){return i>=55296&&i<56320}function Re(i,e){let t=i.charCodeAt(e);if(!Dg(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Lg(n)?(t-55296<<10)+(n-56320)+65536:t}function oa(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function ft(i){return i<65536?1:2}const Jo=/\r\n?|\n/;var Se=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(Se||(Se={}));class Qt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=l}else{if(n!=Se.Simple&&h>=e&&(n==Se.TrackDel&&re||n==Se.TrackBefore&&re))return null;if(h>e||h==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&l>=e)return rt?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(e)}static create(e){return new Qt(e)}}class ce extends Qt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return el(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return tl(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length0&&Bt(n,t,s.text),s.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;of||O<0||f>t)throw new RangeError(`Invalid change range ${O} to ${f} (in doc of length ${t})`);let d=u?typeof u=="string"?D.of(u.split(n||Jo)):u:D.empty,m=d.length;if(O==f&&m==0)return;Oo&&ke(r,O-o,-1),ke(r,f-O,m),Bt(s,r,d),o=f}}return h(e),a(!l),l}static empty(e){return new ce(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function Bt(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,h,s,c,O),r=h,s=c}}}function tl(i,e,t,n=!1){let r=[],s=n?[]:null,o=new Xn(i),l=new Xn(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ke(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let O=Math.min(c,l.len);h+=O,c-=O,l.forward(O)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>h),s.forward2(a),o.forward(a)}}}}class Xn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?D.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?D.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Lt{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new Lt(n,r,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,n,r){return new Lt(e,t,n,r)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>Lt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;rr.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function xf(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let la=0;class C{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=la++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new C(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:aa),!!e.static,e.enables)}of(e){return new _r([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new _r(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new _r(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function aa(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class _r{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=la++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let O of this.dependencies)O=="doc"?a=!0:O=="selection"?h=!0:((t=e[O.id])!==null&&t!==void 0?t:1)&1||c.push(e[O.id]);return{create(O){return O.values[o]=n(O),1},update(O,f){if(a&&f.docChanged||h&&(f.docChanged||f.selection)||il(O,c)){let u=n(O);if(l?!Zh(u,O.values[o],r):!r(u,O.values[o]))return O.values[o]=u,1}return 0},reconfigure:(O,f)=>{let u,d=f.config.address[s];if(d!=null){let m=es(f,d);if(this.dependencies.every(g=>g instanceof C?f.facet(g)===O.facet(g):g instanceof ye?f.field(g,!1)==O.field(g,!1):!0)||(l?Zh(u=n(O),m,r):r(u=n(O),m)))return O.values[o]=m,0}else u=n(O);return O.values[o]=u,1}}}get extension(){return this}}function Zh(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let h=[];for(let c=0;cn===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ur).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(ur),o=r.facet(ur),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,ur.of({field:this,create:e})]}get extension(){return this}}const ai={lowest:4,low:3,default:2,high:1,highest:0};function on(i){return e=>new kf(e,i)}const _t={highest:on(ai.highest),high:on(ai.high),default:on(ai.default),low:on(ai.low),lowest:on(ai.lowest)};class kf{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class Xs{of(e){return new nl(this,e)}reconfigure(e){return Xs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class nl{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class Jr{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of Gg(e,t,o))f instanceof ye?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],h=[];for(let f of r)l[f.id]=h.length<<1,h.push(u=>f.slot(u));let c=n==null?void 0:n.config.facets;for(let f in s){let u=s[f],d=u[0].facet,m=c&&c[f]||[];if(u.every(g=>g.type==0))if(l[d.id]=a.length<<1|1,aa(m,u))a.push(n.facet(d));else{let g=d.combine(u.map(Q=>Q.value));a.push(n&&d.compare(g,n.facet(d))?n.facet(d):g)}else{for(let g of u)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(Q=>g.dynamicSlot(Q)));l[d.id]=h.length<<1,h.push(g=>Bg(g,d,u))}}let O=h.map(f=>f(l));return new Jr(e,o,O,l,a,s)}}function Gg(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let h=n[a].indexOf(o);h>-1&&n[a].splice(h,1),o instanceof nl&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof nl){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,l)}else if(o instanceof kf)s(o.inner,o.prec);else if(o instanceof ye)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof _r)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,ai.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(i,ai.default),n.reduce((o,l)=>o.concat(l))}function Qn(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function es(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const Pf=C.define(),rl=C.define({combine:i=>i.some(e=>e),static:!0}),$f=C.define({combine:i=>i.length?i[0]:void 0,static:!0}),wf=C.define(),vf=C.define(),Tf=C.define(),Xf=C.define({combine:i=>i.length?i[0]:!1});class bt{constructor(e,t){this.type=e,this.value=t}static define(){return new Ig}}class Ig{of(e){return new bt(this,e)}}class Ug{constructor(e){this.map=e}of(e){return new W(this,e)}}class W{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new W(this.type,t)}is(e){return this.type==e}static define(e={}){return new Ug(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}}W.reconfigure=W.define();W.appendConfig=W.define();class he{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&xf(n,t.newLength),s.some(l=>l.type==he.time)||(this.annotations=s.concat(he.time.of(Date.now())))}static create(e,t,n,r,s,o){return new he(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(he.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}he.time=bt.define();he.userEvent=bt.define();he.addToHistory=bt.define();he.remote=bt.define();function Ng(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof he?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof he?i=s[0]:i=Rf(e,Ai(s),!1)}return i}function Hg(i){let e=i.startState,t=e.facet(Tf),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=Cf(n,sl(e,s,i.changes.newLength),!0))}return n==i?i:he.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const Kg=[];function Ai(i){return i==null?Kg:Array.isArray(i)?i:[i]}var te=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(te||(te={}));const Jg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ol;try{ol=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function e0(i){if(ol)return ol.test(i);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||Jg.test(t)))return!0}return!1}function t0(i){return e=>{if(!/\S/.test(e))return te.Space;if(e0(e))return te.Word;for(let t=0;t-1)return te.Word;return te.Other}}class Y{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(h,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(W.reconfigure)?(t=null,n=l.value):l.is(W.appendConfig)&&(t=null,n=Ai(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=Jr.resolve(n,r,this),s=new Y(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(rl)?e.newSelection:e.newSelection.asSingle();new Y(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Ai(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return Y.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Jr.resolve(e.extensions||[],new Map),n=e.doc instanceof D?e.doc:D.of((e.doc||"").split(t.staticFacet(Y.lineSeparator)||Jo)),r=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return xf(r,n.length),t.staticFacet(rl)||(r=r.asSingle()),new Y(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Y.tabSize)}get lineBreak(){return this.facet(Y.lineSeparator)||` diff --git a/veadk/webui/assets/MarkdownPromptEditor-CwT7JlSU.js b/veadk/webui/assets/MarkdownPromptEditor-BBPnStN4.js similarity index 99% rename from veadk/webui/assets/MarkdownPromptEditor-CwT7JlSU.js rename to veadk/webui/assets/MarkdownPromptEditor-BBPnStN4.js index e0bd12ac..ae254cf1 100644 --- a/veadk/webui/assets/MarkdownPromptEditor-CwT7JlSU.js +++ b/veadk/webui/assets/MarkdownPromptEditor-BBPnStN4.js @@ -1,4 +1,4 @@ -var i2=Object.defineProperty;var s2=(t,e,n)=>e in t?i2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var P=(t,e,n)=>s2(t,typeof e!="symbol"?e+"":e,n);import{i as Dd,j as l2,f as a2,g as Fc,y as c2,G as u2,s as f2,A as C,a as N,e as Fd,c as Hd,V as it,x as mn,E as Ns,C as Za,B as d2,b as Vd,u as rn,w as pl,h as tf,v as xr,F as Un,D as zt,d as fi,k as h2,t as L,z as nr,o as g2,m as p2,n as m2,l as y2,r as x2,p as _2,q as v2,R as qo}from"./index-gtSqVSNF.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++ne in t?i2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var P=(t,e,n)=>s2(t,typeof e!="symbol"?e+"":e,n);import{i as Dd,j as l2,f as a2,g as Fc,y as c2,G as u2,s as f2,A as C,a as N,e as Fd,c as Hd,V as it,x as mn,E as Ns,C as Za,B as d2,b as Vd,u as rn,w as pl,h as tf,v as xr,F as Un,D as zt,d as fi,k as h2,t as L,z as nr,o as g2,m as p2,n as m2,l as y2,r as x2,p as _2,q as v2,R as qo}from"./index-CGGQQgcg.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++nsvg{width:18px;height:18px}.builtin-tool-label{font-size:13.5px;font-weight:400;line-height:1.35}.builtin-tool-head.is-done .builtin-tool-label{color:hsl(var(--muted-foreground))}.builtin-tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.builtin-tool-chevron.is-open{transform:rotate(90deg)}.new-chat-mode{position:relative;align-self:flex-start}.new-chat-mode__trigger{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:2px 7px 2px 5px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer;transition:color .12s ease,background .12s ease}.composer--new-chat .new-chat-mode__trigger{min-height:36px;font-size:15px}.new-chat-mode__trigger:hover,.new-chat-mode__trigger[aria-expanded=true]{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-mode__current{max-width:min(180px,42vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__trigger:focus-visible,.new-chat-mode__option:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:1px}.new-chat-mode__icon,.new-chat-mode__option-icon{display:inline-grid;place-items:center;flex:0 0 auto}.new-chat-mode__icon svg{width:15px;height:15px}.new-chat-mode__option-icon svg{width:18px;height:18px}.new-chat-mode svg{fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}.new-chat-mode__skill-icon path:first-child{fill:currentColor;stroke:none}.new-chat-mode__chevron{width:12px;height:12px;transition:transform .14s ease}.new-chat-mode__trigger[aria-expanded=true] .new-chat-mode__chevron{transform:rotate(180deg)}.new-chat-mode__menu{position:absolute;z-index:42;top:calc(100% + 7px);right:0;width:286px;padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-mode__option{display:grid;grid-template-columns:24px minmax(0,1fr) 18px;align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.new-chat-mode__option.is-active{background:hsl(var(--accent))}.new-chat-mode__option:disabled{cursor:not-allowed;opacity:.48}.new-chat-mode__copy{display:flex;min-width:0;flex-direction:column;gap:2px}.new-chat-mode__copy>span:last-child{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.new-chat-mode__label{display:flex;align-items:center;gap:7px;font-size:13px;line-height:1.3}.new-chat-mode__beta{padding:1px 5px;border:1px solid hsl(var(--border));border-radius:999px;color:hsl(var(--muted-foreground));font-size:9px;font-weight:500;line-height:1.2}.new-chat-mode__check{width:16px;height:16px;color:hsl(var(--primary))}@media (prefers-reduced-motion: reduce){.new-chat-mode__trigger,.new-chat-mode__chevron{transition:none}}.stk{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.stk-head{text-align:center;margin-bottom:26px}.stk-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em}.stk-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.stk-list{display:flex;flex-direction:column;gap:12px;width:100%;max-width:520px}.stk-card{display:flex;align-items:center;gap:14px;width:100%;padding:18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));cursor:pointer;font:inherit;text-align:left;transition:border-color .15s,box-shadow .15s,background .12s}.stk-card:hover{border-color:hsl(var(--ring) / .35);background:hsl(var(--foreground) / .02);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.stk-card-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.stk-card-icon svg{width:21px;height:21px}.stk-card-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.stk-card-title{font-size:15px;font-weight:600}.stk-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.stk-card-arrow{flex-shrink:0;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.stk-card:hover .stk-card-arrow{opacity:1;transform:translate(0)}.stk-card-disabled{opacity:.5;cursor:not-allowed}.stk-card-disabled:hover{border-color:hsl(var(--border));background:hsl(var(--card));box-shadow:none}.stk-card-disabled .stk-card-arrow{display:none}.stk-footer{margin-top:18px;width:100%;max-width:520px;display:flex;justify-content:center}.stk-import{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border:1px dashed hsl(var(--border));border-radius:9px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.stk-import:hover{color:hsl(var(--foreground));border-color:hsl(var(--ring) / .4);background:hsl(var(--foreground) / .03)}.stk-import svg{width:15px;height:15px}.code-browser-trigger{min-height:26px;display:inline-flex;align-items:center;gap:5px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:color .12s ease,background-color .12s ease}.code-browser-trigger svg{width:13px;height:13px}.code-browser-trigger:hover{background:hsl(var(--foreground) / .04);color:hsl(var(--foreground))}.code-browser-trigger:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:1px}.code-browser-backdrop{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:code-browser-fade-in .14s ease-out}.code-browser-dialog{width:min(1040px,92vw);height:min(720px,84vh);min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .16);animation:code-browser-rise-in .18s cubic-bezier(.2,.8,.2,1)}.code-browser-head{flex:0 0 58px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 16px 0 18px;border-bottom:1px solid hsl(var(--border))}.code-browser-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.code-browser-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-title-icon svg,.code-browser-close svg{width:16px;height:16px}.code-browser-title-wrap h2,.code-browser-title-wrap p{margin:0}.code-browser-title-wrap h2{color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.code-browser-title-wrap p{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.code-browser-close{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.code-browser-close:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-workspace{flex:1;min-height:0;display:flex}.code-browser-sidebar{flex:0 0 220px;min-width:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .22)}.code-browser-sidebar-head,.code-browser-path{flex:0 0 38px;min-height:38px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.code-browser-sidebar-head{justify-content:space-between;padding:0 12px;color:hsl(var(--muted-foreground));font-size:11px;font-weight:650}.code-browser-sidebar-head span{font-variant-numeric:tabular-nums;font-weight:500}.code-browser-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.code-browser-file,.code-browser-folder{width:100%;min-height:30px;display:flex;align-items:center;gap:6px;padding-top:4px;padding-right:10px;padding-bottom:4px;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;text-align:left;cursor:pointer}.code-browser-file:hover,.code-browser-folder:hover{background:hsl(var(--foreground) / .045);color:hsl(var(--foreground))}.code-browser-file.is-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.code-browser-file svg,.code-browser-folder svg{width:14px;height:14px;flex:0 0 auto}.code-browser-folder>svg:first-child{width:12px;height:12px;transition:transform .12s ease}.code-browser-folder>svg:first-child.is-open{transform:rotate(90deg)}.code-browser-file span,.code-browser-folder span,.code-browser-path span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-browser-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.code-browser-path{gap:7px;padding:0 13px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px}.code-browser-path svg{width:13px;height:13px;flex:0 0 auto}.code-browser-editor{flex:1;min-height:0;overflow:hidden}.code-browser-editor>div,.code-browser-editor .cm-theme,.code-browser-editor .cm-editor{height:100%}.code-browser-editor .cm-scroller{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12.5px}.code-browser-empty{height:100%;display:grid;place-items:center;padding:20px;color:hsl(var(--muted-foreground));font-size:12px}@keyframes code-browser-fade-in{0%{opacity:0}to{opacity:1}}@keyframes code-browser-rise-in{0%{opacity:0;transform:translateY(8px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 720px){.code-browser-backdrop{padding:12px}.code-browser-dialog{width:100%;height:min(760px,92vh)}.code-browser-sidebar{flex-basis:168px}}@media (prefers-reduced-motion: reduce){.code-browser-backdrop,.code-browser-dialog{animation:none}}.pp-root{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.pp-toolbar{flex:0 0 auto;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:10px 24px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-toolbar-left,.pp-toolbar-actions,.pp-actions{display:flex;align-items:center}.pp-toolbar-left{min-width:0;gap:18px}.pp-toolbar-actions{flex:0 0 auto;gap:8px}.pp-toolbar-back{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer}.pp-toolbar-back:hover{color:hsl(var(--foreground))}.pp-toolbar-title{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-secondary,.pp-deploy{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border-radius:6px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.pp-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.pp-secondary:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--accent))}.pp-deploy{min-width:82px;border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-deploy:hover:not(:disabled){background:hsl(var(--primary) / .9)}.pp-deploy:disabled,.pp-secondary:disabled{opacity:.55;cursor:default}.pp-body{flex:1;min-height:0;min-width:0;display:flex}.pp-files-area{flex:1 1 auto;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.pp-sidebar{flex:0 0 218px;width:218px;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .24)}.pp-sidebar-head,.pp-main-head{flex:0 0 42px;min-height:42px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.pp-sidebar-head{gap:8px;padding:0 9px 0 14px}.pp-project-name{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:650;letter-spacing:.04em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.pp-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.pp-row{width:100%;min-height:29px;display:flex;align-items:center;gap:6px;padding:4px 8px;border:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.pp-row:hover{background:hsl(var(--foreground) / .045)}.pp-file.pp-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.pp-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-folder .pp-label{color:hsl(var(--muted-foreground))}.pp-ic{width:15px;height:15px;flex:0 0 auto}.pp-chevron{color:hsl(var(--muted-foreground));transition:transform .12s ease}.pp-chevron.pp-open{transform:rotate(90deg)}.pp-icon-btn{width:28px;height:28px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-icon-btn:hover:not(:disabled){background:hsl(var(--foreground) / .07);color:hsl(var(--foreground))}.pp-icon-btn:disabled{opacity:.45;cursor:default}.pp-danger:hover:not(:disabled){color:hsl(var(--destructive))}.pp-new-input{width:calc(100% - 16px);height:30px;margin:2px 8px 6px;padding:0 8px;border:1px solid hsl(var(--ring) / .55);border-radius:4px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.pp-empty,.pp-placeholder{width:100%;padding:28px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.pp-main{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.pp-main-head{gap:12px;padding:0 10px 0 14px;background:hsl(var(--background))}.pp-path{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-actions{gap:2px}.pp-content{flex:1;min-height:0;min-width:0;display:flex;overflow:hidden}.pp-codemirror,.pp-codemirror>div,.pp-codemirror .cm-editor{width:100%;height:100%;min-height:0}.pp-codemirror .cm-editor{overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground));font-size:12.5px}.pp-codemirror .cm-scroller{overflow:auto;overscroll-behavior:none;scroll-padding-block:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.58}.pp-codemirror .cm-content{padding:10px 0 0}.pp-codemirror .cm-line{padding:0 14px 0 8px}.pp-codemirror .cm-content>.cm-line:last-child:has(>br:only-child){display:none}.pp-codemirror .cm-gutters{border-right:1px solid hsl(var(--border) / .7);background:hsl(var(--secondary) / .2);color:hsl(var(--muted-foreground) / .65)}.pp-codemirror .cm-activeLine,.pp-codemirror .cm-activeLineGutter{background:hsl(var(--foreground) / .035)}.pp-codemirror .cm-focused{outline:none}.pp-editor-loading{height:100%;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12px}.pp-pre{flex:1;width:100%;height:100%;box-sizing:border-box;margin:0;padding:14px 16px 0;overflow:auto;background:hsl(var(--background));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px;font-style:normal;font-variant-ligatures:none;font-weight:400;line-height:1.58;-moz-tab-size:2;tab-size:2;white-space:pre}.pp-root.is-deploy .pp-body{display:grid;grid-template-columns:minmax(260px,3fr) minmax(520px,7fr)}.pp-root.is-deploy .pp-files-area{display:none}.pp-topology-pane{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-topology-head{flex:0 0 58px;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;border-bottom:1px solid hsl(var(--border))}.pp-topology-title{color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-topology-count{margin-top:2px;color:hsl(var(--muted-foreground));font-size:10.5px}.pp-topology-scroll{flex:1;min-height:0;overflow-y:auto;padding:12px 12px 16px}.pp-topology-tree{padding-bottom:12px}.pp-topology-branch{position:relative}.pp-topology-children{position:relative;display:flex;flex-direction:column;gap:2px;margin-top:2px}.pp-topology-children:before{content:"";position:absolute;top:0;bottom:6px;left:8px;width:1px;background:hsl(var(--border))}.pp-agent-node{position:relative;width:100%;min-height:49px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:7px 9px;border:1px solid transparent;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:default;transition:border-color .12s ease,background-color .12s ease}.pp-agent-node:hover,.pp-agent-node:focus-visible,.pp-agent-node.is-inspected{border-color:hsl(var(--primary) / .16);outline:none;background:hsl(var(--primary) / .04)}.pp-agent-node-icon,.pp-agent-inspector-icon{display:inline-flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground))}.pp-agent-node-icon{width:24px;height:24px;flex:0 0 24px}.pp-agent-node-icon svg,.pp-agent-inspector-icon svg{width:15px;height:15px}.pp-agent-node-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.pp-agent-node-name{overflow:hidden;color:hsl(var(--foreground));font-size:12.5px;font-weight:550;text-overflow:ellipsis;white-space:nowrap}.pp-agent-node-type{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.pp-agent-child-count{flex:0 0 auto;min-width:18px;padding:1px 5px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:9.5px;text-align:center}.pp-agent-inspector{padding:13px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .22)}.pp-agent-inspector-head{display:flex;align-items:center;gap:9px}.pp-agent-inspector-icon{width:28px;height:28px;flex:0 0 28px;border-radius:7px;background:hsl(var(--background))}.pp-agent-inspector-head>div{min-width:0;display:flex;flex-direction:column;gap:1px}.pp-agent-inspector-head strong{overflow:hidden;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-agent-inspector-head span,.pp-agent-inspector p{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-agent-inspector p{margin:10px 0 0;line-height:1.5}.pp-agent-config-grid{display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 12px;margin:12px 0 0;padding-top:11px;border-top:1px solid hsl(var(--border) / .72);font-size:10.5px}.pp-agent-config-grid dt{color:hsl(var(--muted-foreground))}.pp-agent-config-grid dd{min-width:0;margin:0;overflow-wrap:anywhere;color:hsl(var(--foreground));text-align:right}.pp-topology-actions{flex:0 0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px 12px;border-top:1px solid hsl(var(--border))}.pp-topology-actions .pp-secondary{width:100%;padding-inline:8px}.pp-config{min-width:0;width:auto;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.pp-config-head{flex:0 0 58px;height:58px;box-sizing:border-box;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid hsl(var(--border))}.pp-config-title{color:hsl(var(--foreground));font-size:17px;font-weight:650;letter-spacing:-.01em}.pp-env-sub{margin-top:4px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.pp-config-scroll{flex:1;min-height:0;overflow-y:auto}.pp-config-actions{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:6px;padding:10px 14px;border-top:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-config-actions .pp-deploy{min-width:108px}.pp-config-section{padding:16px 18px 18px}.pp-config-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650;letter-spacing:-.01em}.pp-config-select,.pp-channel-fields input,.pp-network-fields input,.pp-env-row input{width:100%;min-width:0;height:34px;box-sizing:border-box;padding:0 10px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;transition:border-color .12s ease,box-shadow .12s ease}.pp-config-select:focus,.pp-channel-fields input:focus,.pp-network-fields input:focus,.pp-env-row input:focus{border-color:hsl(var(--ring) / .55);box-shadow:0 0 0 2px hsl(var(--ring) / .08)}.pp-config-select:disabled,.pp-channel-fields input:disabled,.pp-network-fields input:disabled,.pp-env-row input:disabled{opacity:.55}.pp-channel{width:auto;display:inline-flex;align-items:center;justify-content:flex-start;gap:10px;padding:2px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.pp-channel:disabled{cursor:default}.pp-channel-title{color:hsl(var(--foreground));font-size:13px;font-weight:560}.pp-switch{position:relative;flex:0 0 34px;width:34px;height:19px;border-radius:999px;background:hsl(var(--foreground) / .16);transition:background-color .15s ease}.pp-switch span{position:absolute;top:3px;left:3px;width:13px;height:13px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .18);transition:transform .15s ease}.pp-channel.is-on .pp-switch{background:hsl(var(--primary))}.pp-channel.is-on .pp-switch span{transform:translate(15px)}.pp-channel-fields{display:flex;flex-direction:column;gap:12px;margin-top:14px}.pp-channel-fields label{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-channel-fields label>span{color:hsl(var(--foreground));font-weight:560}.pp-channel-fields small{margin-left:5px;color:hsl(var(--destructive));font-size:10px;font-weight:500}.pp-channel-fields code{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-channel-fields input{grid-column:1 / -1}.pp-network-modes{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;padding:3px;border:1px solid hsl(var(--border) / .8);border-radius:6px;background:hsl(var(--secondary) / .42)}.pp-network-modes button{min-height:29px;padding:0 7px;border:0;border-radius:4px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer}.pp-network-modes button.is-on{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .08)}.pp-network-modes button:disabled{cursor:default}.pp-network-fields{display:flex;flex-direction:column;gap:12px;margin-top:14px}.pp-network-fields label:not(.pp-network-check){display:flex;flex-direction:column;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-network-fields small{font-size:10.5px;font-weight:400}.pp-network-check{display:flex;align-items:center;gap:8px;color:hsl(var(--foreground));font-size:12.5px;cursor:pointer}.pp-network-check input{width:14px;height:14px;margin:0}.pp-env-section{padding-bottom:16px}.pp-env-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.pp-env-head .pp-config-label{display:flex;align-items:center;gap:7px;margin-bottom:0}.pp-env-count{display:inline-flex;align-items:center}.pp-env-table{display:flex;flex-direction:column;margin-top:10px}.pp-env-group{padding:4px 7px 0;border:1px solid hsl(var(--border) / .75);border-radius:6px;background:hsl(var(--secondary) / .16)}.pp-env-group-head{display:flex;align-items:center;justify-content:space-between;padding:5px 1px 3px;color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.pp-env-group-head small{color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:450}.pp-env-group-head-custom{margin-top:12px}.pp-env-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px;align-items:center;gap:7px;padding:7px 0;border-bottom:1px solid hsl(var(--border) / .65)}.pp-env-row input:first-child{font-family:inherit;font-size:13px}.pp-env-row-derived:last-child{border-bottom:0}.pp-env-key-fixed{background:hsl(var(--secondary) / .32)!important;cursor:default}.pp-env-source{color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.pp-env-remove{width:28px;height:28px}.pp-env-add{width:100%;min-height:52px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer}.pp-env-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025);color:hsl(var(--foreground))}.pp-env-add:disabled{opacity:.5}.pp-steps{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none}.pp-step{position:relative;min-height:34px;display:flex;align-items:flex-start;gap:9px}.pp-step:not(:last-child):after{content:"";position:absolute;top:20px;bottom:-2px;left:9px;width:1px;background:hsl(var(--border))}.pp-step-dot{z-index:1;width:19px;height:19px;flex:0 0 19px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10px}.pp-step-body{min-width:0;display:flex;flex-direction:column;padding-top:1px}.pp-step-label{color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560}.pp-step-msg{max-width:300px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-step.is-active .pp-step-dot{border-color:hsl(var(--primary));color:hsl(var(--primary))}.pp-step.is-done .pp-step-dot{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-step.is-failed .pp-step-dot{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.pp-error{margin:14px 18px;padding:10px 11px;border:1px solid hsl(var(--destructive) / .22);border-radius:5px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.pp-deploy-result{margin:14px 18px 18px;padding:14px;border:1px solid hsl(var(--primary) / .2);border-radius:6px;background:hsl(var(--primary) / .035)}.pp-deploy-result-header{margin-bottom:12px;color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-deploy-result-body{display:flex;flex-direction:column;gap:10px}.pp-deploy-result-field{display:flex;flex-direction:column;gap:4px}.pp-deploy-result-field label{color:hsl(var(--muted-foreground));font-size:12.5px}.pp-deploy-result-field code{overflow-wrap:anywhere;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px}.pp-deploy-result-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.pp-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;min-height:0}.pp-confirm-head{flex-basis:60px}.pp-confirm-icon{background:#f59f0a1f;color:#ba6708}.pp-confirm-body{padding:24px 20px}.pp-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.pp-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.pp-confirm-actions button{min-width:76px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.pp-confirm-actions button:hover{background:hsl(var(--secondary))}.pp-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.pp-confirm-actions .is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-confirm-actions .is-primary:hover{background:hsl(var(--primary) / .9)}.pp-deploy-result-btn,.pp-console-link-btn{min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border-radius:5px;font-size:12.5px;font-weight:600;text-decoration:none;cursor:pointer}.pp-deploy-result-btn{border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-console-link-btn{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.spin{animation:pp-spin .85s linear infinite}@keyframes pp-spin{to{transform:rotate(360deg)}}@media (max-width: 1120px){.pp-root.is-deploy .pp-body{grid-template-columns:minmax(235px,3fr) minmax(470px,7fr)}.pp-sidebar{flex-basis:190px;width:190px}}@media (max-width: 860px){.pp-toolbar{align-items:flex-start;flex-direction:column;gap:8px}.pp-toolbar-actions{width:100%}.pp-body{overflow-y:auto;flex-direction:column}.pp-root.is-deploy .pp-body{display:flex}.pp-topology-pane{flex:0 0 auto;min-height:420px;border-right:0;border-bottom:1px solid hsl(var(--border))}.pp-files-area{min-height:520px}.pp-config{width:100%;min-height:520px;border-top:1px solid hsl(var(--border));border-left:0}}.ic-root{display:flex;flex-direction:column;height:100%;min-height:0}.ic-body{flex:1;min-height:0;display:flex}.ic-chat{flex:0 0 380px;width:380px;min-width:0;display:flex;flex-direction:column;min-height:0;border-right:1px solid hsl(var(--border))}.ic-transcript{flex:1;min-height:0;overflow-y:auto;padding:24px 20px 12px}.ic-turn{display:flex;gap:10px;max-width:760px;margin:0 auto 16px}.ic-turn:last-child{margin-bottom:0}.ic-turn--assistant{justify-content:flex-start}.ic-turn--user{justify-content:flex-end}.ic-avatar{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:hsl(var(--secondary));color:#7c48f4}.ic-avatar-icon{width:17px;height:17px}.ic-bubble{max-width:78%;padding:11px 15px;border-radius:16px;font-size:14px;line-height:1.6;word-break:break-word}.ic-turn--user .ic-bubble{white-space:pre-wrap}.ic-turn--assistant .ic-bubble{background:hsl(var(--secondary));color:hsl(var(--foreground));border-top-left-radius:5px}.ic-turn--user .ic-bubble{background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-top-right-radius:5px}.ic-bubble .md>:first-child{margin-top:0}.ic-bubble .md>:last-child{margin-bottom:0}.ic-bubble--typing{display:inline-flex;align-items:center;gap:4px;padding:14px 16px}.ic-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground));animation:ic-bounce 1.2s ease-in-out infinite}.ic-dot:nth-child(2){animation-delay:.16s}.ic-dot:nth-child(3){animation-delay:.32s}@keyframes ic-bounce{0%,60%,to{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.ic-error{flex-shrink:0;display:flex;align-items:center;gap:8px;max-width:760px;width:100%;margin:0 auto;padding:9px 14px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px;line-height:1.45}.ic-error-icon{width:15px;height:15px;flex-shrink:0}.ic-composer{flex-shrink:0;max-width:760px;width:100%;margin:0 auto;padding:8px 20px 18px}.ic-composer-box{display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 12px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background));transition:border-color .15s,box-shadow .15s}.ic-composer-box:focus-within{border-color:hsl(var(--ring) / .4);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.ic-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 2px;max-height:160px;overflow-y:auto}.ic-input::placeholder{color:hsl(var(--muted-foreground))}.ic-input:disabled{opacity:.6}.ic-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.ic-send-icon{width:17px;height:17px}.ic-send:hover:not(:disabled){opacity:.85}.ic-send:active:not(:disabled){transform:scale(.94)}.ic-send:disabled{opacity:.3;cursor:default}.ic-composer-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.ic-composer-hint{flex:1;text-align:center;font-size:11px;color:hsl(var(--muted-foreground))}.ic-ab-toggle{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;cursor:pointer;-webkit-user-select:none;user-select:none}.ic-ab-checkbox{position:absolute;opacity:0;width:0;height:0}.ic-ab-track{position:relative;display:inline-block;width:30px;height:17px;border-radius:999px;background:hsl(var(--muted-foreground) / .35);transition:background .15s}.ic-ab-thumb{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0003;transition:transform .15s}.ic-ab-checkbox:checked+.ic-ab-track{background:hsl(var(--primary))}.ic-ab-checkbox:checked+.ic-ab-track .ic-ab-thumb{transform:translate(13px)}.ic-ab-checkbox:disabled+.ic-ab-track{opacity:.5}.ic-ab-checkbox:focus-visible+.ic-ab-track{box-shadow:0 0 0 3px hsl(var(--ring) / .25)}.ic-ab-label{font-size:12px;font-weight:600;color:hsl(var(--foreground))}.ic-compare{flex:1;min-height:0;display:flex}.ic-compare-divider{flex:0 0 1px;background:hsl(var(--border))}.ic-pane{flex:1 1 0;min-width:0;min-height:0;display:flex;flex-direction:column}.ic-pane-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background))}.ic-pane-title{display:flex;align-items:center;gap:8px;min-width:0}.ic-pane-tag{flex-shrink:0;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;color:#fff}.ic-pane-tag--a{background:#7c48f4}.ic-pane-tag--b{background:#0da2e7}.ic-pane-model{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ic-adopt{flex-shrink:0;padding:6px 12px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font-size:12px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.ic-adopt:hover:not(:disabled){opacity:.85}.ic-adopt:active:not(:disabled){transform:scale(.96)}.ic-adopt:disabled{opacity:.4;cursor:default}.ic-pane-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.ic-pane-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-size:13px;color:hsl(var(--muted-foreground))}.ic-pane-spinner{width:22px;height:22px;color:#7c48f4;animation:ic-spin .9s linear infinite}@keyframes ic-spin{to{transform:rotate(360deg)}}.ic-pane-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.ic-preview{flex:1 1 0;min-width:0;display:flex;flex-direction:column;min-height:0;background:hsl(var(--muted) / .35)}.ic-preview-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px;text-align:center}.ic-preview-empty-icon{position:relative;display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:18px;background:#7c48f414;color:#7c48f4;margin-bottom:4px}.ic-preview-empty-glyph{width:30px;height:30px}.ic-preview-empty-spark{position:absolute;top:9px;right:9px;width:14px;height:14px}.ic-preview-empty-title{font-size:15px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.ic-preview-empty-sub{font-size:13px;line-height:1.55;color:hsl(var(--muted-foreground));max-width:240px}@media (max-width: 920px){.ic-body{flex-direction:column}.ic-preview{width:100%;border-left:none;border-top:1px solid hsl(var(--border));min-height:320px}}.cw-root{--cw-workbench-toolbar-height: 64px;flex:1;min-height:0;display:flex;flex-direction:column;height:100%;color:hsl(var(--foreground))}.cw-editor{flex:1;min-height:0;display:flex;align-items:stretch}.cw-tree{flex-shrink:0;width:248px;overflow-y:auto;padding:16px 14px;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.cw-tree-head{font-size:12px;font-weight:650;letter-spacing:.02em;color:hsl(var(--muted-foreground));padding:0 6px;margin-bottom:10px}.cw-tree-branch{display:flex;flex-direction:column}.cw-tree-node{position:relative;display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:8px;cursor:pointer;font-size:13px;border:1px solid transparent;transition:background .12s ease,border-color .12s ease}.cw-tree-node:hover{background:hsl(var(--accent))}.cw-tree-node.is-selected{background:hsl(var(--primary) / .04);border-color:hsl(var(--primary) / .16)}.cw-tree-node.is-invalid{background:hsl(var(--destructive) / .07);border-color:hsl(var(--destructive) / .5)}.cw-tree-node.is-invalid.is-selected{background:hsl(var(--destructive) / .1);border-color:hsl(var(--destructive) / .6)}.cw-tree-node.is-draggable{cursor:grab}.cw-tree-node.is-draggable:active{cursor:grabbing}.cw-tree-node.is-dragover{background:hsl(var(--primary) / .1);border-color:hsl(var(--primary) / .45)}.cw-tree-icon{width:15px;height:15px;flex-shrink:0;opacity:.8}.cw-tree-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.cw-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.cw-tree-type{font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:hsl(var(--muted-foreground))}.cw-tree-actions{display:flex;align-items:center;gap:1px;flex-shrink:0;opacity:0;pointer-events:none;transition:opacity .12s ease}.cw-tree-node:hover .cw-tree-actions,.cw-tree-node.is-selected .cw-tree-actions{opacity:1;pointer-events:auto}.cw-tree-children{display:flex;flex-direction:column;gap:2px;margin-top:2px;margin-left:8px;padding-left:8px;border-left:1px solid hsl(var(--border))}.cw-detail{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-typebar{position:relative;z-index:5;flex-shrink:0;height:var(--cw-workbench-toolbar-height);background:hsl(var(--panel));border-bottom:1px solid hsl(var(--border));padding:10px 16px}.cw-typebar-inner{height:100%;display:flex;align-items:center;max-width:1080px;margin:0 auto}.cw-detail-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;padding:24px 16px 48px}.cw-detail-inner{max-width:780px;margin:0 auto}.cw-lower{display:flex;gap:8px;align-items:flex-start}.cw-detail .cw-form-col{flex:1;min-width:0;max-width:720px;margin:0}.cw-debug{flex-shrink:0;width:380px;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid hsl(var(--border));background:hsl(var(--panel));transition:width .22s cubic-bezier(.22,1,.36,1),min-width .22s cubic-bezier(.22,1,.36,1),height .22s cubic-bezier(.22,1,.36,1),min-height .22s cubic-bezier(.22,1,.36,1),flex-basis .22s cubic-bezier(.22,1,.36,1),padding .18s ease}.cw-debug:not(.is-collapsed)>*{animation:cw-debug-content-in .18s ease-out both}.cw-debug.is-collapsed .cw-debug-expand{animation:cw-debug-control-in .18s .06s ease-out both}@keyframes cw-debug-content-in{0%{opacity:0;transform:scale(.985)}}@keyframes cw-debug-control-in{0%{opacity:0;transform:scale(.9)}}@media (prefers-reduced-motion: reduce){.cw-debug{transition:none}.cw-debug:not(.is-collapsed)>*,.cw-debug.is-collapsed .cw-debug-expand{animation:none}}.cw-debug-head{flex-shrink:0;height:var(--cw-workbench-toolbar-height);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid hsl(var(--border))}.cw-debug-head-actions{display:flex;align-items:center;gap:6px}.cw-debug-collapse,.cw-debug-expand{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s,background .12s,transform .12s}.cw-debug-collapse{width:24px;height:24px}.cw-debug-collapse:hover,.cw-debug-expand:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.cw-debug-expand:hover{transform:scale(1.06)}.cw-debug.is-collapsed{width:48px;min-width:48px;height:100%;min-height:0;align-items:center;padding-top:14px}.cw-debug-expand{width:34px;height:34px;min-height:34px}.cw-debug-title{display:inline-flex;align-items:center;gap:7px;font-size:17px;font-weight:650;color:hsl(var(--foreground))}.cw-debug-deploy,.cw-debug-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:6px 10px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:opacity .12s,transform .1s}.cw-debug-deploy{gap:4px;font-size:13px}.cw-debug-deploy .cw-i{width:13px;height:13px;transition:transform .18s ease}.cw-debug-deploy:hover:not(:disabled) .cw-i:not(.cw-spin){transform:translate(2px)}@media (prefers-reduced-motion: reduce){.cw-debug-deploy .cw-i{transition:none}.cw-debug-deploy:hover:not(:disabled) .cw-i:not(.cw-spin){transform:none}}.cw-debug-deploy:hover:not(:disabled),.cw-debug-start:hover:not(:disabled){opacity:.86}.cw-debug-deploy:active:not(:disabled),.cw-debug-start:active:not(:disabled){transform:scale(.96)}.cw-debug-deploy:disabled,.cw-debug-start:disabled{opacity:.45;cursor:default}.cw-debug-sub{flex-shrink:0;display:flex;flex-direction:column;gap:3px;padding:10px 16px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.cw-debug-deploy-error{margin:0 16px 12px;padding:8px 10px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px;line-height:1.45}.cw-debug-stage{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.cw-debug-body{flex:1;min-height:0;overflow-y:auto;padding:10px 16px 18px}.cw-debug-empty{min-height:120px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:14px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-start{color:hsl(var(--primary-foreground))}.cw-debug-run-icon{width:17px;height:17px;transition:transform .16s cubic-bezier(.22,1,.36,1)}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:translate(1.5px)}@media (prefers-reduced-motion: reduce){.cw-debug-run-icon{transition:none}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:none}}.cw-debug-progress{display:flex;flex-direction:column;gap:8px}.cw-debug-logline{display:flex;align-items:center;gap:8px;min-height:28px;padding:7px 9px;border-radius:9px;background:hsl(var(--foreground) / .04);color:hsl(var(--muted-foreground));font-size:12.5px}.cw-debug-logline .cw-i{color:hsl(var(--foreground))}.cw-debug-error{display:flex;flex-direction:column;gap:12px;color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-debug-error-detail,.cw-debug-msg-error{width:100%;min-width:0;color:hsl(var(--destructive));text-align:left}.cw-debug-error-detail .deploy-error-message-text,.cw-debug-msg-error .deploy-error-message-text{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px}.cw-debug-chat{min-height:100%;display:flex;flex-direction:column;gap:18px}.cw-debug-chat-empty{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-msg{display:flex;flex-direction:column;gap:6px;max-width:100%}.cw-debug-msg-user{align-items:flex-end}.cw-debug-msg-assistant{align-items:flex-start}.cw-debug-role{display:none}.cw-debug-content{max-width:100%;color:hsl(var(--foreground));font-size:14px;line-height:1.65;word-break:break-word}.cw-debug-msg-user .cw-debug-content{max-width:88%;padding:9px 14px;border-radius:18px;background:hsl(var(--secondary))}.cw-debug-msg-assistant .cw-debug-content{width:100%}.cw-debug-composer{flex-shrink:0;padding:10px 14px 14px;background:hsl(var(--panel))}.cw-debug-composerbox{display:flex;align-items:center;gap:6px;padding:6px 6px 6px 10px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background))}.cw-debug-input{flex:1;min-width:0;max-height:120px;padding:8px 4px;border:none;outline:none;resize:none;overflow-y:auto;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.5}.cw-debug-input::placeholder{color:hsl(var(--muted-foreground))}.cw-debug-send{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:50%;cursor:pointer;transition:opacity .15s,transform .1s,background .12s,color .12s}.cw-debug-send{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-debug-send:hover:not(:disabled){opacity:.85}.cw-debug-send:active:not(:disabled){transform:scale(.94)}.cw-debug-send:disabled{opacity:.3;cursor:default}.cw-debug-overlay{position:absolute;z-index:5;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:22px;background:hsl(var(--panel) / .5);backdrop-filter:blur(9px) saturate(.9);-webkit-backdrop-filter:blur(9px) saturate(.9)}.cw-debug-overlay-content{width:min(100%,290px);display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px;border:1px solid hsl(var(--border) / .72);border-radius:12px;background:hsl(var(--background) / .82);box-shadow:0 10px 30px hsl(var(--foreground) / .08);text-align:center}.cw-debug-overlay-title{color:hsl(var(--foreground));font-size:14px;font-weight:650}.cw-debug-overlay-copy{color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55}.cw-debug-overlay-progress{width:100%;display:flex;flex-direction:column;gap:8px}.cw-debug-overlay-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:2px}.cw-debug-ignore{min-height:30px;padding:6px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background) / .72);color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s,transform .1s}.cw-debug-ignore:hover:not(:disabled){border-color:hsl(var(--foreground) / .2);background:hsl(var(--background))}.cw-debug-ignore:active:not(:disabled){transform:scale(.96)}.cw-debug-ignore:disabled{opacity:.45;cursor:default}.cw-header{flex-shrink:0;display:flex;align-items:flex-start;gap:16px;padding:18px 24px 16px;border-bottom:1px solid hsl(var(--border))}.cw-header-title{flex:1;min-width:0}.cw-header-mode{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:hsl(var(--muted-foreground))}.cw-title{margin:5px 0 2px;font-size:21px;font-weight:650;letter-spacing:-.02em}.cw-subtitle{margin:0;font-size:13px;color:hsl(var(--muted-foreground))}.cw-progress-pill{flex-shrink:0;margin-top:2px;padding:5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}.cw-body{flex:1;min-height:0;overflow-y:auto}.cw-center{display:flex;align-items:flex-start;justify-content:center;gap:32px;max-width:960px;margin:0 auto;padding:32px 24px 80px}.cw-form-col{flex:1 1 auto;min-width:0;max-width:640px;display:flex;flex-direction:column;gap:44px}.cw-section{scroll-margin-top:24px}.cw-sec-head{margin-bottom:18px}.cw-sec-title{display:flex;align-items:center;gap:8px;margin:0 0 4px;font-size:17px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.cw-sec-required{padding:1px 7px;border-radius:999px;background:hsl(var(--foreground) / .08);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600;letter-spacing:.02em}.cw-sec-hint{margin:0;font-size:13px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-rail{position:sticky;top:12px;align-self:flex-start;flex-shrink:0;width:32px;margin-left:auto;padding:0;z-index:4}.cw-steps{position:relative;list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.cw-rail-track{position:absolute;left:15px;top:18px;bottom:18px;width:2px;border-radius:2px;background:hsl(var(--border));z-index:0}.cw-rail-fill{position:absolute;left:0;top:0;width:100%;border-radius:2px;background:hsl(var(--foreground) / .55)}.cw-step{position:relative;display:flex;align-items:center;justify-content:center;width:32px;min-height:36px;padding:0;border:none;border-radius:9px;background:none;text-align:left;cursor:pointer;font:inherit;transition:background .12s}.cw-step:hover{background:hsl(var(--foreground) / .05)}.cw-step.is-active{background:hsl(var(--foreground) / .06)}.cw-step:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-step-marker{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:32px;height:36px}.cw-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--foreground) / .25);transition:background .15s,width .15s,height .15s}.cw-step.is-active .cw-dot{width:10px;height:10px;background:hsl(var(--foreground));box-shadow:0 0 0 3px hsl(var(--panel))}.cw-step-check{width:14px;height:14px;padding:1px;border-radius:50%;background:hsl(var(--panel));color:hsl(var(--foreground) / .68)}.cw-step-tooltip{position:absolute;z-index:5;top:50%;right:calc(100% + 8px);padding:5px 8px;border-radius:6px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 4px 12px hsl(var(--foreground) / .12);font-size:11.5px;font-weight:550;white-space:nowrap;opacity:0;pointer-events:none;transform:translate(4px,-50%);transition:opacity .12s,transform .12s}.cw-step:hover .cw-step-tooltip,.cw-step:focus-visible .cw-step-tooltip{opacity:1;transform:translateY(-50%)}.cw-form{display:flex;flex-direction:column;gap:20px}.cw-section-desc{margin:0;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.cw-field{display:flex;flex-direction:column;gap:7px}.cw-more-options{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;margin-top:-4px;padding:4px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer;transition:color .14s ease}.cw-more-options:hover,.cw-more-options:focus-visible{color:hsl(var(--foreground))}.cw-more-options:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:3px;border-radius:4px}.cw-more-options-chevron{width:14px;height:14px;transition:transform .18s ease}.cw-more-options-chevron.is-open{transform:rotate(90deg)}.cw-more-options-count{margin-left:2px;padding:2px 7px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:10.5px;font-weight:600}.cw-model-advanced{display:flex;flex-direction:column;gap:20px;overflow:hidden}.cw-label{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-req{margin-left:2px;color:hsl(var(--destructive))}.cw-help{font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-remote-center-head{display:flex;flex-direction:column;gap:6px}.cw-remote-center-description{display:block;max-width:560px;margin:0;line-height:1.6}.cw-a2a-space-picker{display:flex;flex-direction:column;gap:8px}.cw-a2a-space-row{display:flex;align-items:center;gap:8px}.cw-a2a-space-select-wrap{position:relative;flex:1;min-width:0}.cw-a2a-space-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:32px;min-height:32px;gap:8px;padding:0 8px 0 10px;border:0;border-radius:6px;background-color:hsl(var(--muted) / .38);color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;letter-spacing:0}.cw-a2a-space-trigger[aria-expanded=true]{border-bottom-right-radius:0;border-bottom-left-radius:0;background-color:hsl(var(--background));filter:drop-shadow(0 2px 2px hsl(var(--foreground) / .2))}.cw-a2a-space-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-a2a-space-trigger:disabled{cursor:not-allowed;opacity:.5}.cw-a2a-space-trigger.is-error{box-shadow:0 0 0 1px hsl(var(--destructive) / .55)}.cw-a2a-space-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-trigger-icon{width:14px;height:14px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .14s ease}.cw-a2a-space-trigger[aria-expanded=true] .cw-a2a-space-trigger-icon{transform:rotate(90deg)}.cw-a2a-space-menu{position:absolute;z-index:30;top:100%;left:0;width:100%;max-height:238px;overflow-y:auto;padding:0;border-bottom-right-radius:6px;border-bottom-left-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));filter:drop-shadow(0 2px 2px hsl(var(--foreground) / .2));font-size:12px}.cw-a2a-space-option{display:flex;align-items:center;width:100%;min-height:32px;padding:8px;border:0;background:transparent;color:hsl(var(--foreground));cursor:default;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left}.cw-a2a-space-option:hover,.cw-a2a-space-option:focus-visible{outline:none;background:hsl(var(--muted) / .55)}.cw-a2a-space-option.is-selected{background:hsl(var(--muted) / .55);color:hsl(var(--foreground))}.cw-a2a-space-option:last-child{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.cw-a2a-space-refresh{flex-shrink:0;width:32px;height:32px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--muted) / .38);color:hsl(var(--foreground))}.cw-a2a-space-refresh:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-a2a-space-status{display:inline-flex;align-items:center;gap:6px}.cw-a2a-space-error{align-items:flex-start;padding:9px 11px;font-size:12.5px}.cw-error-text{font-size:12px;color:hsl(var(--destructive))}.cw-env-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:12px;margin-top:5px}.cw-env-field{display:flex;min-width:0;flex-direction:column;gap:6px}.cw-env-field-head{display:grid;min-width:0;gap:3px;color:hsl(var(--foreground));font-size:12px;font-weight:560}.cw-env-field-label{min-width:0;line-height:1.4;overflow-wrap:anywhere}.cw-env-field-head code{display:block;max-width:100%;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.cw-env-empty{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12px}.cw-input{min-width:0;width:100%;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .12s,box-shadow .12s}.cw-input::placeholder{color:hsl(var(--muted-foreground))}.cw-input:focus{outline:none;border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-input.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-textarea{width:100%;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.6;resize:vertical;transition:border-color .12s,box-shadow .12s}.cw-textarea::placeholder{color:hsl(var(--muted-foreground))}.cw-textarea:focus{outline:none;border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-textarea.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}@keyframes cw-error-shake-a{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}@keyframes cw-error-shake-b{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}.cw-error-shake-0{animation:cw-error-shake-a .28s ease-in-out}.cw-error-shake-1{animation:cw-error-shake-b .28s ease-in-out}@media (prefers-reduced-motion: reduce){.cw-error-shake-0,.cw-error-shake-1{animation:none}}.cw-textarea-sm{min-height:80px;max-height:160px;overflow-y:auto}.cw-textarea-lg{min-height:340px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.cw-markdown-loading,.cw-markdown-editor:not(.mdxeditor-popup-container){min-height:340px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background))}.cw-markdown-loading{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px}.cw-markdown-editor:not(.mdxeditor-popup-container){display:flex;flex-direction:column;max-height:420px;overflow:hidden;color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.cw-markdown-editor:not(.mdxeditor-popup-container):focus-within{border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-markdown-editor:not(.mdxeditor-popup-container).is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-markdown-toolbar{flex-shrink:0;min-height:40px;padding:5px 8px;border:0;border-bottom:1px solid hsl(var(--border));border-radius:0;background:hsl(var(--muted) / .38)}.cw-markdown-toolbar button,.cw-markdown-toolbar [role=combobox]{color:hsl(var(--foreground))}.cw-markdown-content{min-height:298px;max-height:360px;overflow-y:auto;padding:18px 20px 28px;color:hsl(var(--foreground));font-size:14px;line-height:1.7}.cw-markdown-content:focus{outline:none}.cw-markdown-content h1,.cw-markdown-content h2,.cw-markdown-content h3{margin:1.1em 0 .45em;color:hsl(var(--foreground));font-weight:650;line-height:1.3}.cw-markdown-content h1:first-child,.cw-markdown-content h2:first-child,.cw-markdown-content h3:first-child{margin-top:0}.cw-markdown-content h1{font-size:20px}.cw-markdown-content h2{font-size:17px}.cw-markdown-content h3{font-size:15px}.cw-markdown-content p{margin:0 0 .8em}.cw-markdown-content ul,.cw-markdown-content ol{margin:.5em 0 .9em;padding-left:1.5em}.cw-markdown-content blockquote{margin:.8em 0;padding-left:12px;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.cw-markdown-error{display:block;margin-top:6px;color:hsl(var(--destructive));font-size:12px}.cw-tag-editor{display:flex;flex-direction:column;gap:12px}.cw-tag-inputrow{display:flex;gap:8px}.cw-tag-inputrow .cw-input{flex:1}.cw-presets{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.cw-presets-label{font-size:11.5px;color:hsl(var(--muted-foreground));margin-right:2px}.cw-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12.5px;white-space:nowrap}.cw-chip-ghost{border:1px dashed hsl(var(--border));background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;transition:background .12s,color .12s,border-color .12s}.cw-chip-ghost:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-chip-sub{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-pills{display:flex;flex-wrap:wrap;gap:8px}.cw-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 6px 5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:13px}.cw-pill-x{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:none;border-radius:50%;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-pill-x:hover{background:hsl(var(--destructive) / .12);color:hsl(var(--destructive))}.cw-empty-line{margin:0;font-size:12.5px;color:hsl(var(--muted-foreground))}.cw-check-inline{display:flex;align-items:center;gap:8px;margin-top:2px;font-size:13px;color:hsl(var(--foreground));cursor:pointer;-webkit-user-select:none;user-select:none}.cw-check-inline input[type=checkbox]{width:16px;height:16px;margin:0;flex-shrink:0;accent-color:hsl(var(--primary));cursor:pointer}.cw-checklist{display:flex;flex-direction:column;gap:8px}.cw-tools-list-shell{min-width:0;container-type:inline-size}.cw-checklist-tools{--cw-checklist-row-height: 65px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(var(--cw-checklist-row-height),auto);max-height:var(--cw-checklist-max-height);padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-checklist-tools .cw-check{min-height:var(--cw-checklist-row-height)}.cw-checklist-tools .cw-check-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}@container (max-width: 575px){.cw-checklist-tools{grid-template-columns:minmax(0,1fr)}}.cw-check{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-check:hover{background:hsl(var(--foreground) / .05)}.cw-check.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-check-box{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background));color:hsl(var(--background));transition:background .12s,border-color .12s,color .12s}.cw-check.is-on .cw-check-box{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-check-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-check-title{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.cw-check-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-segmented{display:flex;flex-wrap:wrap;gap:8px}.cw-seg{flex:1 1 160px;display:flex;flex-direction:column;gap:2px;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-seg:hover{background:hsl(var(--foreground) / .05)}.cw-seg.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-seg-title{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-seg-desc{font-size:11.5px;line-height:1.45;color:hsl(var(--muted-foreground))}.cw-ctool{display:flex;flex-direction:column;gap:12px}.cw-ctool-inputs{display:flex;flex-wrap:wrap;gap:8px}.cw-ctool-inputs .cw-input{flex:1 1 180px}.cw-ctool-list{display:flex;flex-direction:column;gap:8px}.cw-ctool-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--card))}.cw-ctool-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}.cw-ctool-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ctool-name{font-size:13.5px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--foreground));word-break:break-word}.cw-ctool-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp,.cw-mcp-list{display:flex;flex-direction:column;gap:12px}.cw-mcp-row{display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.cw-mcp-rowhead{display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-mcp-transport{display:inline-flex;gap:6px}.cw-seg-sm{flex:0 0 auto;min-width:72px;flex-direction:row;align-items:center;justify-content:center;text-align:center;padding:6px 16px;border-radius:9px}.cw-seg-sm .cw-seg-title{font-size:12.5px}.cw-mcp-note{margin:0;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp .cw-add-sub{margin-top:0}.cw-subfield{margin:-2px 0 2px;padding:14px 16px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .02)}.cw-toggle-stack{gap:14px}.cw-toggle{display:flex;align-items:center;gap:14px;width:100%;padding:16px 18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));text-align:left;cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s,background .15s}.cw-toggle:hover{border-color:hsl(var(--ring) / .25)}.cw-toggle.is-on{border-color:hsl(var(--primary) / .4);box-shadow:0 1px 2px hsl(var(--foreground) / .04)}.cw-toggle-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));transition:background .15s,color .15s}.cw-toggle.is-on .cw-toggle-icon{background:hsl(var(--primary) / .1);color:hsl(var(--primary))}.cw-toggle-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-toggle-title{font-size:14px;font-weight:600}.cw-toggle-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-switch{flex-shrink:0;display:flex;align-items:center;width:42px;height:24px;padding:2px;border-radius:999px;background:hsl(var(--border));transition:background .18s}.cw-toggle.is-on .cw-switch{background:hsl(var(--primary));justify-content:flex-end}.cw-switch-knob{display:block;width:20px;height:20px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .2)}.cw-sub-list{display:flex;flex-direction:column;gap:14px}.cw-sub{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .03)}.cw-sub-head{display:flex;align-items:center;justify-content:space-between}.cw-sub-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.cw-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-icon-btn:not(:disabled):hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-icon-btn:disabled{opacity:.35;cursor:not-allowed}.cw-icon-danger:not(:disabled):hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.cw-sub-head-actions{display:inline-flex;align-items:center;gap:2px}.cw-sub-list-wrap{display:flex;flex-direction:column}.cw-typeradio{display:flex}.cw-typeradio--row{position:relative;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:var(--cw-agent-type-gap);height:44px;width:100%;max-width:100%;padding:4px;overflow:visible;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-typeradio-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-agent-type-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-type-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-typeradio-item{position:relative;z-index:1;flex:1 1 0;min-width:0;min-height:34px;display:flex;align-items:center;justify-content:center;padding:7px 10px;border:none;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .16s,background .16s}.cw-typeradio-item:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-typeradio-item.is-disabled{color:hsl(var(--muted-foreground) / .45);cursor:not-allowed}.cw-typeradio-item.is-disabled:hover{background:transparent;color:hsl(var(--muted-foreground) / .45)}.cw-typeradio-disabled-hint{position:absolute;top:calc(100% + 17px);right:0;width:max-content;max-width:220px;padding:7px 10px;border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--popover));box-shadow:0 8px 24px hsl(var(--foreground) / .1);color:hsl(var(--popover-foreground));font-size:12px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-2px);transition:opacity .14s ease,transform .14s ease}.cw-typeradio-item.is-disabled:hover .cw-typeradio-disabled-hint,.cw-typeradio-item.is-disabled:focus .cw-typeradio-disabled-hint,.cw-typeradio-item.is-disabled:focus-visible .cw-typeradio-disabled-hint{opacity:1;transform:translateY(0)}.cw-typeradio-item.is-on{background:transparent;color:hsl(var(--foreground))}.cw-typeradio-item:has(.cw-typeradio-input:focus-visible){box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-typeradio-input{position:absolute;opacity:0;width:0;height:0}.cw-typeradio-title{min-width:0;white-space:normal;word-break:keep-all;font-size:clamp(11px,1.1vw,13px);font-weight:600;line-height:1.12;text-align:center}.cw-add-sub{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:14px;padding:12px;width:100%;border:1px dashed hsl(var(--border));border-radius:12px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13.5px;font-weight:500;cursor:pointer;transition:background .12s,color .12s,border-color .12s}.cw-add-sub:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-banner{display:flex;align-items:center;gap:8px;padding:11px 14px;border-radius:var(--radius);background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-review{display:flex;flex-direction:column;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;background:hsl(var(--card))}.cw-review-row{display:flex;gap:18px;padding:13px 16px;border-bottom:1px solid hsl(var(--border))}.cw-review-row:last-child{border-bottom:none}.cw-review-key{flex-shrink:0;width:110px;font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.cw-review-val{flex:1;min-width:0;font-size:13.5px}.cw-review-strong{font-weight:600}.cw-review-muted{color:hsl(var(--muted-foreground))}.cw-review-pre{margin:0;padding:10px 12px;background:hsl(var(--muted));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:200px;overflow-y:auto}.cw-review-chips,.cw-review-subs{display:flex;flex-wrap:wrap;gap:6px}.cw-tag{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:500}.cw-tag-on{background:#22c35d24;color:#1c7d3f}.cw-tag-off{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.cw-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:13.5px;font-weight:550;cursor:pointer;transition:background .13s,opacity .13s,border-color .13s,transform .1s}.cw-btn:active{transform:scale(.98)}.cw-btn-primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-btn-primary:hover:not(:disabled){opacity:.88}.cw-btn-primary:disabled{opacity:.4;cursor:default}.cw-btn-ghost{background:hsl(var(--background));border-color:hsl(var(--border));color:hsl(var(--foreground))}.cw-btn-ghost:hover{background:hsl(var(--accent))}.cw-btn-soft{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));flex-shrink:0}.cw-btn-soft:hover:not(:disabled){background:hsl(var(--accent))}.cw-btn-soft:disabled{opacity:.45;cursor:default}.cw-i{width:16px;height:16px;flex-shrink:0}.cw-i-sm{width:14px;height:14px}.cw-root-preview{height:100%}.cw-preview-body{flex:1;min-height:0;display:flex}.cw-preview-body>*{flex:1;min-height:0}.cw-skillhub{display:flex;flex-direction:column;gap:14px}.cw-skill-searchrow{display:flex;gap:8px}.cw-skill-searchbox{position:relative;flex:1;min-width:0;display:flex;align-items:center}.cw-skill-searchicon{position:absolute;left:11px;color:hsl(var(--muted-foreground));pointer-events:none}.cw-skill-input{padding-left:36px}.cw-skill-selected{display:flex;flex-direction:column;gap:8px}.cw-skill-selected-label{font-size:11.5px;font-weight:600;color:hsl(var(--muted-foreground))}.cw-skill-results{display:flex;flex-direction:column;gap:8px;max-height:472px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-skill-result{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s;min-height:72px;max-height:72px;overflow:hidden}.cw-skill-result:hover{background:hsl(var(--foreground) / .05)}.cw-skill-result.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-skill-result-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--muted-foreground));transition:background .12s,border-color .12s,color .12s}.cw-skill-result.is-on .cw-skill-result-icon{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-skill-result-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-skill-result-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground));word-break:break-word}.cw-skill-result-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-skill-result-repo{font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--muted-foreground));word-break:break-all}.cw-spin{animation:cw-spin .8s linear infinite}@keyframes cw-spin{to{transform:rotate(360deg)}}.cw-skillspane{display:flex;flex-direction:column;gap:10px}.cw-skill-add{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:600;transition:border-color .15s,background .15s,color .15s}.cw-skill-add:hover{border-color:hsl(var(--foreground) / .34);background:transparent;color:hsl(var(--foreground))}.cw-skill-add:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-skill-add-icon{flex-shrink:0;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}.cw-skill-dialog-backdrop{position:fixed;z-index:80;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:20px;background:#15181e47;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.cw-skill-dialog{width:min(680px,calc(100vw - 32px));height:min(640px,calc(100dvh - 40px));min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 72px #10131933}.cw-skill-dialog-head{flex-shrink:0;min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px 0 20px;border-bottom:1px solid hsl(var(--border))}.cw-skill-dialog-head h3{margin:0;font-size:16px;font-weight:650;letter-spacing:-.01em}.cw-skill-dialog-close{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-skill-dialog-close:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-skill-dialog-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px;padding:18px 20px 20px}.cw-skill-sourcetabs{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;height:44px;padding:4px;overflow:hidden;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-skill-tab-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-skill-tab-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-skill-tab-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-skill-pickertab{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:7px 10px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background .16s,color .16s}.cw-skill-pickertab:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-skill-pickertab.is-on{background:transparent;color:hsl(var(--foreground))}.cw-skill-pickertab:focus-visible{outline:none;box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-skill-tabbody{flex:1;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}.cw-selected-skill-list{display:flex;flex-direction:column;gap:7px;max-height:347px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-selected-skill-row{display:flex;align-items:center;gap:10px;min-width:0;min-height:52px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--card))}.cw-selected-skill-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-selected-skill-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-selected-skill-name{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-detail{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-remove{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-selected-skill-remove:hover{background:hsl(var(--destructive) / .09);color:hsl(var(--destructive))}.cw-advanced-section{overflow:hidden}.cw-advanced-disclosure{width:100%;display:flex;align-items:center;gap:10px;padding:0;border:0;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.cw-advanced-disclosure-title{font-size:17px;font-weight:650;letter-spacing:-.01em}.cw-advanced-disclosure-chevron{width:18px;height:18px;color:hsl(var(--muted-foreground));transition:transform .18s ease}.cw-advanced-disclosure-chevron.is-open{transform:rotate(90deg)}.cw-advanced-content{overflow:hidden}.cw-advanced-group{padding-top:20px}.cw-advanced-group+.cw-advanced-group{margin-top:22px}.cw-advanced-group-head{display:flex;align-items:center;margin-bottom:12px;color:hsl(var(--foreground));font-size:15px;font-weight:600}.cw-local-dropzone{display:flex;flex-direction:column;align-items:center;gap:9px;padding:18px 14px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .15s,color .15s}.cw-local-drop-icon{width:20px;height:20px;color:hsl(var(--muted-foreground))}.cw-local-dropzone.is-dragging{border-color:hsl(var(--foreground) / .48);color:hsl(var(--foreground))}.cw-local-drop-hint{margin:0;color:hsl(var(--muted-foreground));font-size:11.5px}.cw-local-dropzone.is-dragging .cw-local-drop-hint,.cw-local-dropzone.is-dragging .cw-local-drop-icon{color:hsl(var(--foreground))}.cw-local-hint{margin:0 0 8px;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-skillspace-header{display:flex;gap:8px;align-items:flex-start;margin-bottom:10px}.cw-skillspace-select{width:100%;flex:1;min-width:0}.cw-skillspace-console-link{flex-shrink:0;padding:9px 12px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-color:hsl(var(--primary))}.cw-skillspace-console-link .cw-i{display:block}.cw-skill-result-version{color:hsl(var(--muted-foreground));font-weight:400;font-size:11px;margin-left:4px}.cw-skill-result-repo .cw-i{vertical-align:-2px;margin-right:2px}@media (max-width: 1280px){.cw-debug{width:280px}.cw-tree{width:208px}}@media (max-width: 1080px){.cw-editor{flex-wrap:wrap;overflow-y:auto}.cw-tree{height:260px}.cw-detail{height:min(720px,calc(100dvh - 120px));min-height:560px}.cw-debug{flex:0 0 100%;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px;border-left:none;border-top:1px solid hsl(var(--border))}.cw-debug.is-collapsed{flex:0 0 48px;width:100%;min-width:0;height:48px;min-height:48px;align-items:flex-end;padding:7px 12px}.cw-debug.is-collapsed .cw-debug-expand{width:34px;min-height:34px}.cw-rail{display:none}.cw-lower{gap:0}.cw-detail .cw-form-col{max-width:100%}}@media (max-width: 860px){.cw-editor{flex-direction:column;flex-wrap:nowrap;overflow-x:hidden;overflow-y:auto}.cw-tree{width:100%;height:auto;max-height:220px;border-right:0;border-bottom:1px solid hsl(var(--border))}.cw-detail{flex:none;width:100%;height:min(720px,calc(100dvh - 120px));min-height:560px}.cw-typebar{padding-inline:12px}.cw-detail-scroll{padding:20px 12px 40px}.cw-debug{flex:none;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px}.cw-debug.is-collapsed{width:100%;height:48px;min-height:48px}.cw-center{gap:0;padding:24px 16px 64px}.cw-form-col{max-width:100%}}@media (max-width: 700px){.cw-typeradio-item{padding-inline:6px}.cw-typeradio-title{font-size:12.5px}}.tpl-root{flex:1;min-height:0;display:flex;flex-direction:column}.tpl-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 18px;padding:6px 10px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,color .12s}.tpl-back:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.tpl-back .icon{width:15px;height:15px}.tpl-scroll{flex:1;min-height:0;overflow-y:auto;padding:24px 28px 40px}.tpl-scroll--detail{padding-left:14px;padding-right:14px}.tpl-head{max-width:720px;margin:8px auto 28px;text-align:center}.tpl-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;max-width:1100px;margin:0 auto}.tpl-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;height:100%;padding:16px 16px 18px;text-align:left;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;transition:background .14s,border-color .14s}.tpl-card:hover{background:hsl(var(--foreground) / .05)}.tpl-card:active{background:hsl(var(--foreground) / .08)}.tpl-card-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;color:hsl(var(--muted-foreground))}.tpl-card-icon .icon{width:20px;height:20px}.tpl-card-name{font-size:14px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground))}.tpl-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.tpl-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.tpl-tags--detail{margin-top:0}.tpl-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border:1px solid hsl(var(--border));border-radius:999px;background:none;color:hsl(var(--muted-foreground));font-size:11.5px;white-space:nowrap}.tpl-tag-icon{width:12px;height:12px;flex-shrink:0}.tpl-detail{max-width:720px;margin:0 auto;display:flex;flex-direction:column;gap:20px}.tpl-detail-head{display:flex;align-items:flex-start;gap:14px}.tpl-detail-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;border:1px solid hsl(var(--border));border-radius:12px;background:none;color:hsl(var(--muted-foreground))}.tpl-detail-icon .icon{width:22px;height:22px}.tpl-detail-headtext{min-width:0}.tpl-detail-name{font-size:20px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-detail-desc{margin-top:4px;font-size:13.5px;line-height:1.6;color:hsl(var(--muted-foreground))}.tpl-field{display:flex;flex-direction:column;gap:8px}.tpl-field-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.tpl-input{width:100%;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .15s}.tpl-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.tpl-instruction{margin:0;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .03);color:hsl(var(--foreground));font-size:13px;line-height:1.7;white-space:pre-wrap}.tpl-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px}.tpl-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.tpl-meta-key{flex-shrink:0;color:hsl(var(--muted-foreground))}.tpl-meta-val{text-align:right;word-break:break-word;color:hsl(var(--foreground))}.tpl-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.tpl-subagents{display:flex;flex-direction:column;gap:10px}.tpl-subagent{padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background))}.tpl-subagent-top{display:flex;align-items:center;gap:8px}.tpl-subagent-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.tpl-subagent-tools{margin-left:auto;font-size:11px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.tpl-subagent-desc{margin-top:5px;font-size:12.5px;line-height:1.55;color:hsl(var(--muted-foreground))}.tpl-create{display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:flex-start;margin-top:4px;padding:11px 20px;border:none;border-radius:12px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.tpl-create:hover{opacity:.88}.tpl-create:active{transform:scale(.98)}.tpl-create .icon{width:17px;height:17px}@media (max-width: 560px){.tpl-meta-grid{grid-template-columns:1fr}.tpl-scroll{padding:20px 16px 32px}}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}.wfb{flex:1;min-height:0;display:flex;flex-direction:column;height:100%}.wfb-create{position:absolute;top:14px;right:14px;z-index:5;display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border:1px solid transparent;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:550;cursor:pointer;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .4);transition:opacity .15s,transform .1s}.wfb-create:hover:not(:disabled){opacity:.88}.wfb-create:active:not(:disabled){transform:scale(.97)}.wfb-create:disabled{opacity:.4;cursor:default}.wfb-grid{flex:1;min-height:0;display:grid;grid-template-columns:248px minmax(0,1fr) 288px}.wfb-section-label{margin:4px 0 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.wfb-field{display:flex;flex-direction:column;gap:5px}.wfb-field-label{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-input{width:100%;border:1px solid hsl(var(--border));border-radius:var(--radius);padding:8px 10px;font:inherit;font-size:13px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.wfb-input::placeholder{color:hsl(var(--muted-foreground) / .7)}.wfb-input:focus{outline:none;border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.wfb-input--error,.wfb-input--error:focus{border-color:hsl(var(--destructive));box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.wfb-field-error,.wfb-field-help{font-size:11px;line-height:1.4}.wfb-field-error{color:hsl(var(--destructive))}.wfb-field-help{color:hsl(var(--muted-foreground))}.wfb-textarea{resize:vertical;min-height:52px;line-height:1.5}.wfb-palette{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-right:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-types{display:flex;flex-direction:column;gap:6px}.wfb-type{display:flex;align-items:center;gap:10px;width:100%;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:border-color .12s,background .12s}.wfb-type:hover{border-color:hsl(var(--ring) / .3)}.wfb-type .icon{color:hsl(var(--muted-foreground))}.wfb-type--active{border-color:hsl(var(--ring) / .55);background:hsl(var(--accent))}.wfb-type--active .icon{color:#7c48f4}.wfb-type-text{display:flex;flex-direction:column;gap:1px;min-width:0}.wfb-type-name{font-size:13px;font-weight:550}.wfb-type-desc{font-size:11px;color:hsl(var(--muted-foreground))}.wfb-palette-item{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));cursor:grab;transition:border-color .12s,background .12s}.wfb-palette-item:hover{border-color:hsl(var(--ring) / .4);background:hsl(var(--accent))}.wfb-palette-item:active{cursor:grabbing}.wfb-grip{color:hsl(var(--muted-foreground) / .7)}.wfb-palette-item-text{font-size:13px;font-weight:500}.wfb-add{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;padding:9px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background .12s}.wfb-add:hover{background:hsl(var(--accent))}.wfb-hint{margin-top:auto;padding-top:10px;font-size:11.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.wfb-canvas{position:relative;min-width:0;height:100%;background:hsl(var(--canvas))}.wfb-canvas .react-flow{background:transparent}.wfb-node{display:flex;align-items:center;gap:10px;width:188px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .2);transition:border-color .12s,box-shadow .12s}.wfb-node--selected{border-color:hsl(var(--ring) / .6);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.wfb-node-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:9px;background:hsl(var(--secondary));color:#7c48f4}.wfb-node-icon--sm{width:24px;height:24px;border-radius:7px}.wfb-node-body{min-width:0;display:flex;flex-direction:column;gap:2px}.wfb-node-name{font-size:13px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-node-desc{font-size:11px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-handle{width:9px!important;height:9px!important;background:hsl(var(--background))!important;border:2px solid hsl(258 89% 62%)!important}.wfb-handle:hover{background:#7c48f4!important}.wfb-canvas .react-flow__controls{border-radius:10px;overflow:hidden;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .25);border:1px solid hsl(var(--border))}.wfb-canvas .react-flow__controls-button{background:hsl(var(--background));border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground))}.wfb-canvas .react-flow__controls-button:hover{background:hsl(var(--accent))}.wfb-canvas .react-flow__controls-button svg{fill:hsl(var(--foreground))}.wfb-canvas .react-flow__edge-path{stroke:hsl(var(--muted-foreground) / .55);stroke-width:1.5}.wfb-canvas .react-flow__edge.selected .react-flow__edge-path,.wfb-canvas .react-flow__edge:hover .react-flow__edge-path{stroke:#7c48f4}.wfb-canvas .react-flow__arrowhead *{fill:hsl(var(--muted-foreground) / .55)}.wfb-minimap{border:1px solid hsl(var(--border));border-radius:10px;overflow:hidden}.wfb-inspector{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-left:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-inspector-head{display:flex;align-items:center;justify-content:space-between}.wfb-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:7px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.wfb-icon-btn:hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.wfb-inspector-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;padding-top:12px;border-top:1px solid hsl(var(--border))}.wfb-meta-key{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-meta-val{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;padding:2px 7px;border-radius:6px;background:hsl(var(--muted));color:hsl(var(--foreground))}.wfb-inspector-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:hsl(var(--muted-foreground));font-size:13px}.wfb-empty-icon{width:32px;height:32px;opacity:.4;margin-bottom:4px}.wfb-inspector-empty p{margin:0}.wfb-empty-sub{font-size:12px;color:hsl(var(--muted-foreground) / .8)}@media (max-width: 900px){.wfb-grid{grid-template-columns:220px minmax(0,1fr)}.wfb-inspector{display:none}}.skill-workspace{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:34px clamp(18px,4vw,54px) 44px;background:hsl(var(--panel))}.skill-workspace__intro{width:min(1180px,100%);margin:0 auto 32px}.skill-workspace__intro h1{margin:0;font-size:22px;font-weight:620;letter-spacing:-.025em}.skill-workspace__poll-error{width:min(1180px,100%);margin:0 auto 14px;padding:9px 11px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px}.skill-workspace__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1;min-height:0;gap:clamp(36px,5vw,72px);width:min(1180px,100%);margin:0 auto}.skill-candidate{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;background:transparent}.skill-candidate:nth-child(2):before{position:absolute;top:0;bottom:0;left:calc(clamp(36px,5vw,72px)/-2);width:1px;background:hsl(var(--border));content:""}.skill-candidate__header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:0 0 12px;border-bottom:1px solid hsl(var(--border))}.skill-candidate__header h2{margin:0;font-family:inherit;font-size:13px;font-weight:500;line-height:1.4;letter-spacing:0}.skill-candidate__selected{padding:3px 7px;border-radius:999px;background:hsl(var(--primary) / .1);color:hsl(var(--primary));font-size:10px}.skill-candidate__view{min-height:0;overflow-y:auto;padding-right:8px;scrollbar-gutter:stable;animation:skill-view-in .18s ease-out}.skill-candidate__status{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:46px;padding:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.4;text-align:left}.skill-candidate--succeeded .skill-candidate__status{color:#2a844f}.skill-candidate--failed .skill-candidate__status{color:hsl(var(--destructive))}.skill-candidate__status-icon{display:inline-grid;place-items:center;width:18px;height:18px}.skill-candidate__status-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__spinner{animation:skill-spin .9s linear infinite}.skill-candidate__spinner circle{opacity:.2}.skill-candidate__duration{margin-left:auto;font-size:10px;color:hsl(var(--muted-foreground))}.skill-conversation{min-height:220px;margin:0 0 16px;padding:8px 0 18px}.skill-conversation .bubble{font-size:13px;line-height:1.65}.skill-conversation .think-head,.skill-conversation .tool-head,.skill-conversation .builtin-tool-head{display:grid;grid-template-columns:20px minmax(0,1fr) 13px;align-items:center;gap:8px;width:100%;min-height:38px;padding:4px 0;text-align:left}.skill-conversation .think-label,.skill-conversation .tool-name,.skill-conversation .builtin-tool-label{min-width:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere;text-align:left}.skill-conversation .think-icon,.skill-conversation .tool-icon,.skill-conversation .builtin-tool-icon{width:20px;height:26px}.skill-conversation .chev,.skill-conversation .tool-chevron,.skill-conversation .builtin-tool-chevron{justify-self:end}.skill-candidate__error{margin:0 0 14px;padding:9px 10px;border-radius:7px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:11px;line-height:1.5}.skill-candidate__view-actions{display:flex;justify-content:flex-start;padding:4px 0 20px}.skill-candidate__preview-nav{display:flex;align-items:center;min-height:46px}.skill-candidate__back{display:inline-flex;align-items:center;gap:6px;padding:5px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer}.skill-candidate__back:hover{color:hsl(var(--foreground))}.skill-candidate__back svg,.skill-action--preview svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__result{padding:0 0 20px}.skill-candidate__summary{display:grid;grid-template-columns:1fr .55fr .7fr;gap:8px;margin-bottom:13px}.skill-candidate__summary>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:9px 10px;border-radius:8px;background:hsl(var(--muted) / .55)}.skill-candidate__summary span{color:hsl(var(--muted-foreground));font-size:9px;text-transform:uppercase;letter-spacing:.05em}.skill-candidate__summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:560}.skill-candidate__summary .is-valid{color:#2a844f}.skill-candidate__summary .is-invalid{color:hsl(var(--destructive))}.skill-candidate__description{margin:0 0 13px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.skill-validation{margin-bottom:12px;font-size:11px;color:hsl(var(--muted-foreground))}.skill-validation summary{margin-bottom:6px;cursor:pointer;color:hsl(var(--foreground))}.skill-files{overflow:hidden;margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:9px}.skill-files__tabs{display:flex;gap:2px;overflow-x:auto;padding:5px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--muted) / .34)}.skill-files__tabs button{flex:0 0 auto;max-width:180px;overflow:hidden;text-overflow:ellipsis;padding:4px 7px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:10px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer}.skill-files__tabs button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 3px hsl(var(--foreground) / .08)}.skill-files__content{margin:0;overflow-x:auto;padding:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:10.5px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-word}.skill-files__truncated{margin:0;padding:8px 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:10px}.skill-files__unavailable{padding:20px 12px;color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.skill-candidate__actions{display:flex;flex-wrap:wrap;gap:7px}.skill-action{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px;text-decoration:none;cursor:pointer}.skill-action:hover:not(:disabled){background:hsl(var(--accent))}.skill-action:disabled{cursor:default;opacity:.42}.skill-action--select{border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-action--select[aria-pressed=true]{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.skill-action--preview{gap:7px;border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-publish-form{display:flex;flex-direction:column;gap:9px;margin-top:12px;padding:11px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--muted) / .28)}.skill-publish-form label{display:flex;flex-direction:column;gap:4px;color:hsl(var(--muted-foreground));font-size:10px}.skill-publish-form input{min-width:0;height:31px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px}.skill-publish-form input:focus{border-color:hsl(var(--primary) / .55)}.skill-publish-form__optional{display:grid;grid-template-columns:1fr 1fr;gap:8px}@keyframes skill-spin{to{transform:rotate(360deg)}}@keyframes skill-view-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 780px){.skill-workspace{overflow-y:auto;padding:24px 12px 32px}.skill-workspace__grid{flex:none;grid-template-columns:1fr;gap:32px}.skill-candidate{display:block}.skill-candidate__view{overflow:visible;padding-right:0}.skill-candidate:nth-child(2){padding-top:32px;border-top:1px solid hsl(var(--border))}.skill-candidate:nth-child(2):before{display:none}.skill-workspace__intro h1{font-size:20px}.skill-publish-form__optional{grid-template-columns:1fr}.skill-action{min-height:44px}}@media (prefers-reduced-motion: reduce){.skill-candidate__view,.skill-candidate__spinner{animation:none}}.sandbox-entry{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid hsl(268 58% 58% / .34);background:#f4eefb;color:#5b318c;font:inherit;font-weight:600;cursor:pointer;transition:background-color .14s ease-out,border-color .14s ease-out}.sandbox-entry svg{width:15px;height:15px;flex:0 0 auto}.sandbox-entry:hover:not(:disabled){border-color:#803ecc85;background:#ece2f9}.sandbox-entry:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-entry:disabled{cursor:default;opacity:.72}.sandbox-entry--composer{min-height:30px;padding:0 13px;border-radius:999px;font-size:12px}.sandbox-entry--header{min-height:32px;padding:0 10px;border-radius:7px;font-size:12px}.sandbox-entry.is-active{border-style:dashed}.sandbox-new-chat-entry{display:flex;justify-content:center;min-height:30px}.composer-slot{width:100%;min-width:0}.sandbox-composer-wrap{position:relative;z-index:2}.sandbox-session-warning{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;width:calc(100% - 32px);max-width:736px;min-height:24px;margin:0 auto 6px;color:#c7840f;font-size:12px}.sandbox-session-warning-dot{display:none}.sandbox-session-warning-copy{grid-column:2;white-space:nowrap;text-align:center}.sandbox-session-warning button{grid-column:3;justify-self:end;padding:3px 5px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-weight:580;cursor:pointer}.sandbox-session-warning button:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.sandbox-composer-wrap .composer-box{display:grid;grid-template-columns:1fr auto;grid-template-rows:minmax(44px,auto) 36px;align-items:center;gap:2px 8px;min-height:104px;padding:10px 8px 8px;border-radius:24px}.sandbox-composer-wrap .comp-input{grid-row:1;grid-column:1 / -1;align-self:stretch;width:100%;min-height:44px;padding:8px 10px 4px}.sandbox-composer-wrap .composer-menu-wrap{grid-row:2;grid-column:1;justify-self:start}.sandbox-composer-wrap .comp-send{grid-row:2;grid-column:2}.main.is-sandbox-session{position:relative;isolation:isolate;background:linear-gradient(to bottom,#f4edfd,#f8f3fc,#fbf8fc 48%,hsl(var(--panel)) 76%)}.main.is-sandbox-session:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;background:radial-gradient(ellipse 78% 40% at 18% 0%,hsl(244 82% 84% / .24),transparent 70%),radial-gradient(ellipse 70% 36% at 52% 0%,hsl(284 70% 86% / .2),transparent 72%),radial-gradient(ellipse 64% 38% at 88% 2%,hsl(324 66% 88% / .16),transparent 72%),linear-gradient(to bottom,hsl(var(--panel) / 0),hsl(var(--panel) / .18) 42%,hsl(var(--panel)) 76%);filter:blur(24px);opacity:1;animation:sandbox-smoke-enter .42s ease-out both}.main.is-sandbox-session>*{position:relative;z-index:1}.sandbox-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .24);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.sandbox-dialog{width:min(440px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 20px 56px hsl(var(--foreground) / .2);animation:sandbox-dialog-enter .18s ease-out both}.sandbox-dialog-visual{position:relative;display:grid;height:112px;place-items:center;overflow:hidden;border-bottom:1px solid hsl(var(--border));background:radial-gradient(circle at 35% 70%,hsl(256 68% 78% / .34),transparent 40%),radial-gradient(circle at 68% 30%,hsl(276 66% 72% / .28),transparent 42%),#f9f8fc}.sandbox-dialog-orbit{position:absolute;width:104px;height:44px;border:1px solid hsl(268 52% 54% / .22);border-radius:50%;transform:rotate(-12deg)}.sandbox-dialog-icon{display:grid;width:46px;height:46px;place-items:center;border:1px solid hsl(268 58% 58% / .3);border-radius:14px;background:hsl(var(--panel) / .9);color:#68389f;box-shadow:0 8px 24px #6c38a824}.sandbox-dialog-icon svg{width:23px;height:23px}.sandbox-spinner{width:21px;height:21px;border:2px solid hsl(268 48% 42% / .2);border-top-color:currentColor;border-radius:50%;animation:sandbox-spin .8s linear infinite}.sandbox-dialog-copy{padding:22px 24px 20px;text-align:center}.sandbox-dialog-copy h2{margin:0 0 8px;color:hsl(var(--foreground));font-size:17px;font-weight:650}.sandbox-dialog-copy p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.65}.sandbox-dialog-copy .sandbox-dialog-error{color:hsl(var(--destructive))}.sandbox-dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.sandbox-dialog-actions button{min-width:80px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.sandbox-dialog-actions button:hover{background:hsl(var(--secondary))}.sandbox-dialog-actions button:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-dialog-actions .is-primary{border-color:#68389f;background:#68389f;color:hsl(var(--primary-foreground))}.sandbox-dialog-actions .is-primary:hover{background:#5b318c}@keyframes sandbox-spin{to{transform:rotate(360deg)}}@keyframes sandbox-dialog-enter{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sandbox-smoke-enter{0%{opacity:0}to{opacity:1}}@media (max-width: 700px){.sandbox-entry--header span{display:none}.sandbox-entry--header{width:32px;padding:0}.sandbox-session-warning{grid-template-columns:1fr auto;width:calc(100% - 16px)}.sandbox-session-warning-copy{grid-column:1;white-space:normal;text-align:left}.sandbox-session-warning button{grid-column:2}}@media (prefers-reduced-motion: reduce){.sandbox-entry,.sandbox-dialog,.main.is-sandbox-session:before{animation:none;transition:none}}.PhotoView-Portal{direction:ltr;height:100%;left:0;overflow:hidden;position:fixed;top:0;touch-action:none;width:100%;z-index:2000}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes PhotoView__delayIn{0%,50%{opacity:0}to{opacity:1}}.PhotoView__Spinner{animation:PhotoView__delayIn .4s linear both}.PhotoView__Spinner svg{animation:PhotoView__rotate .6s linear infinite}.PhotoView__Photo{cursor:grab;max-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.PhotoView__Photo:active{cursor:grabbing}.PhotoView__icon{display:inline-block;left:0;position:absolute;top:0;transform:translate(-50%,-50%)}.PhotoView__PhotoBox,.PhotoView__PhotoWrap{bottom:0;direction:ltr;left:0;position:absolute;right:0;top:0;touch-action:none;width:100%}.PhotoView__PhotoWrap{overflow:hidden;z-index:10}.PhotoView__PhotoBox{transform-origin:left top}@keyframes PhotoView__fade{0%{opacity:0}to{opacity:1}}.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,.PhotoView-Slider__clean .PhotoView-Slider__Overlay,.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover{opacity:0}.PhotoView-Slider__Backdrop{background:#000;height:100%;left:0;position:absolute;top:0;transition-property:background-color;width:100%;z-index:-1}.PhotoView-Slider__fadeIn{animation:PhotoView__fade linear both;opacity:0}.PhotoView-Slider__fadeOut{animation:PhotoView__fade linear reverse both;opacity:0}.PhotoView-Slider__BannerWrap{align-items:center;background-color:#00000080;color:#fff;display:flex;height:44px;justify-content:space-between;left:0;position:absolute;top:0;transition:opacity .2s ease-out;width:100%;z-index:20}.PhotoView-Slider__BannerWrap:hover{opacity:1}.PhotoView-Slider__Counter{font-size:14px;opacity:.75;padding:0 10px}.PhotoView-Slider__BannerRight{align-items:center;display:flex;height:100%}.PhotoView-Slider__toolbarIcon{fill:#fff;box-sizing:border-box;cursor:pointer;opacity:.75;padding:10px;transition:opacity .2s linear}.PhotoView-Slider__toolbarIcon:hover{opacity:1}.PhotoView-Slider__ArrowLeft,.PhotoView-Slider__ArrowRight{align-items:center;bottom:0;cursor:pointer;display:flex;height:100px;justify-content:center;margin:auto;opacity:.75;position:absolute;top:0;transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;z-index:20}.PhotoView-Slider__ArrowLeft:hover,.PhotoView-Slider__ArrowRight:hover{opacity:1}.PhotoView-Slider__ArrowLeft svg,.PhotoView-Slider__ArrowRight svg{fill:#fff;background:#0000004d;box-sizing:content-box;height:24px;padding:10px;width:24px}.PhotoView-Slider__ArrowLeft{left:0}.PhotoView-Slider__ArrowRight{right:0}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--destructive: 0 72% 51%;--border: 240 5.9% 90%;--ring: 240 5.9% 10%;--radius: .5rem;--canvas: 240 5% 97.3%;--panel: 0 0% 100%;color-scheme:light;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0;overflow:hidden;overscroll-behavior:none}#root{position:fixed;top:0;right:0;bottom:0;left:0}body{background:hsl(var(--canvas));color:hsl(var(--foreground));-webkit-font-smoothing:antialiased}.icon{width:16px;height:16px;flex-shrink:0}.spin{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}*{scrollbar-width:thin;scrollbar-color:hsl(var(--foreground) / .18) transparent}*::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:hsl(var(--foreground) / .18);border-radius:999px;border:2px solid transparent;background-clip:content-box}*::-webkit-scrollbar-thumb:hover{background:hsl(var(--foreground) / .32);background-clip:content-box}*::-webkit-scrollbar-corner{background:transparent}.layout{display:flex;height:100vh;height:100dvh;min-height:0;overflow:hidden}.main-shell{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.sidebar{width:236px;height:100%;min-height:0;flex-shrink:0;display:flex;flex-direction:column;background:transparent;position:relative;transition:width .22s cubic-bezier(.22,1,.36,1)}.sidebar.is-collapsed{width:56px}@media (max-width: 860px){.sidebar{width:204px}}.sidebar-top{display:flex;flex-direction:column;gap:2px;padding:0 10px 8px}.sidebar-brand-row{height:54px;min-height:54px;display:flex;align-items:center;gap:6px;padding:0 0 0 10px}.brand{flex:1;min-width:0;display:flex;align-items:center;gap:9px;font-weight:600;font-size:15px;letter-spacing:-.01em}.brand-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand-logo,.brand-title,.login-brand-logo,.login-brand,.login-title{cursor:text}.sidebar-collapse-toggle{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.sidebar-collapse-toggle:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.sidebar-collapse-toggle .icon{width:17px;height:17px}.sidebar.is-collapsed .sidebar-brand-row{justify-content:center;padding-inline:0}.sidebar.is-collapsed .brand{display:none}.brand-logo,.login-brand-logo{display:block;width:20px;min-width:20px;max-width:20px;height:20px;min-height:20px;max-height:20px;flex:0 0 20px;object-fit:contain}.new-chat{display:flex;align-items:center;gap:10px;padding:10px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;cursor:pointer;transition:background .12s}.new-chat .icon{width:18px;height:18px}.new-chat:hover{background:hsl(var(--foreground) / .05)}.sidebar.is-collapsed .new-chat,.sidebar.is-collapsed .agent-row{align-self:center;width:36px;height:36px;min-height:36px;gap:0;padding:9px;overflow:hidden;white-space:nowrap}.sidebar.is-collapsed .agent-row-name,.sidebar.is-collapsed .agent-row-region,.sidebar.is-collapsed .agent-row-chev,.sidebar.is-collapsed .sidebar-nav-label,.sidebar.is-collapsed .sidebar-history{display:none}.agent-row{display:flex;align-items:center;gap:9px;margin:2px 0 6px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,border-color .12s}.agent-row:hover{background:hsl(var(--foreground) / .04);border-color:hsl(var(--foreground) / .2)}.agent-row--empty{border-color:#e2b3ac;background:#fcf6f5;color:#905047}.agent-row--empty .agent-row-lead{color:#bc6052}.agent-row--empty .agent-row-chev{color:#ac7e77}.agent-row--empty:hover{border-color:#d6998f;background:#faf1ef}.agent-row-lead{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0;transform:translateY(3px)}.agent-row--connected .agent-row-lead{color:#328f54}.agent-row-name{flex:1;min-width:0;text-align:left;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agent-row-region{flex-shrink:0;padding:1px 6px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10px;font-weight:550;line-height:1.5}.agent-row-chev{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .15s;flex-shrink:0;transform:translateY(1px)}.agent-row-chev.open{transform:translateY(1px) rotate(90deg)}.agentsel{--agentsel-available-width: calc(100vw - 250px) ;container-type:inline-size;position:absolute;left:100%;top:8px;z-index:32;display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;align-content:stretch;gap:8px;width:min(320px,var(--agentsel-available-width));background:transparent;border:0;margin-left:6px;overflow:visible;animation:agentsel-in .16s ease-out}.agentsel.has-detail{width:min(688px,var(--agentsel-available-width))}.sidebar.is-collapsed .agentsel{--agentsel-available-width: calc(100vw - 70px) }.agentsel-main{width:320px;height:100%;max-height:100%;min-width:min(240px,100%);flex:1 1 320px;display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 40px hsl(var(--foreground) / .14)}.agentsel-detail{width:360px;height:100%;max-height:100%;min-width:min(280px,100%);flex:1 1 360px;display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 40px hsl(var(--foreground) / .14)}.agentsel-preview{animation:agentsel-preview-in .16s cubic-bezier(.22,1,.36,1)}@container (max-width: 527px){.agentsel.has-detail>.agentsel-main,.agentsel.has-detail>.agentsel-detail{height:calc((100% - 8px)/2);max-height:calc((100% - 8px)/2)}}.agentsel-preview-head{padding:7px 14px}.agentsel-detail-tabs{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;height:36px;padding:3px;overflow:hidden;border:1px solid hsl(var(--border) / .58);border-radius:9px;background:hsl(var(--secondary) / .58)}.agentsel-detail-tabs-slider{position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc(50% - 3px);border:1px solid hsl(var(--border) / .72);border-radius:6px;background:hsl(var(--background));transform:translate(0);transition:transform .24s cubic-bezier(.22,1,.36,1)}.agentsel-detail-tabs.is-runtime .agentsel-detail-tabs-slider{transform:translate(100%)}.agentsel-detail-tabs button{position:relative;z-index:1;min-width:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;font-weight:550;text-align:center;cursor:pointer;transition:color .16s}.agentsel-detail-tabs button:hover,.agentsel-detail-tabs button[aria-selected=true]{color:hsl(var(--foreground))}.agentsel-detail-tabs button:focus-visible{outline:2px solid hsl(var(--ring) / .24);outline-offset:-2px}.agentsel-tab-panel{display:flex;flex:1;min-height:0;min-width:0;flex-direction:column}.agentsel-tab-panel[hidden]{display:none}.agentsel-detail-body{flex:1;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:12px 14px}.agentsel-panel-state{display:flex;align-items:center;justify-content:center;gap:7px;min-height:120px;color:hsl(var(--muted-foreground));font-size:12.5px}.agentsel-panel-state .icon{width:15px;height:15px}.agentsel-panel-empty{display:flex;flex-direction:column;gap:6px;padding:24px 8px;text-align:center;color:hsl(var(--muted-foreground));font-size:12.5px;overflow-wrap:anywhere}.agentsel-panel-empty small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground) / .75);font-size:11px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:3}.agentsel-identity,.agentsel-runtime-identity{display:flex;align-items:flex-start;gap:10px;min-width:0}.agentsel-identity{padding-bottom:12px}.agentsel-identity-icon,.agentsel-runtime-identity>.icon{width:18px;height:18px;margin-top:1px;flex-shrink:0;color:hsl(var(--muted-foreground))}.agentsel-identity-copy,.agentsel-runtime-identity>div{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}.agentsel-identity-copy strong,.agentsel-runtime-identity strong{overflow:hidden;color:hsl(var(--foreground));font-size:13.5px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.agentsel-identity-copy span,.agentsel-runtime-identity span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.agentsel-runtime-identity{margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid hsl(var(--border))}.agentsel-info-section{min-width:0;padding:11px 0;border-top:1px solid hsl(var(--border))}.agentsel-info-section h3{display:flex;align-items:center;gap:6px;margin:0 0 8px;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:600}.agentsel-info-section h3 .icon{width:13px;height:13px}.agentsel-description{max-height:104px;margin:0;overflow-y:auto;white-space:pre-wrap;overflow-wrap:anywhere;color:hsl(var(--foreground));font-size:12.5px;line-height:1.65}.agentsel-chips{display:flex;flex-wrap:wrap;gap:5px;min-width:0}.agentsel-chip{display:block;max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--canvas) / .7);color:hsl(var(--foreground));font-size:11.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.agentsel-info-list{display:flex;min-width:0;flex-direction:column;gap:6px}.agentsel-info-list-item{display:flex;min-width:0;flex-direction:column;gap:2px;padding:7px 8px;border-radius:6px;background:hsl(var(--canvas) / .72)}.agentsel-info-list-item>strong,.agentsel-component-head>strong{overflow:hidden;font-size:12px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.agentsel-info-list-item>span{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:3}.agentsel-component-head{display:flex;align-items:center;gap:8px;min-width:0}.agentsel-component-head>strong{flex:1;min-width:0}.agentsel-component-head>span{flex-shrink:0;padding:1px 5px;border-radius:4px;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));font-size:10px}.agentsel-kv{margin:0;display:flex;flex-direction:column;gap:8px}.agentsel-kv-row{display:grid;grid-template-columns:52px 1fr;gap:8px;font-size:12.5px}.agentsel-kv-row dt{color:hsl(var(--muted-foreground))}.agentsel-kv-row dd{min-width:0;margin:0;color:hsl(var(--foreground));overflow-wrap:anywhere}.agentsel-envs{margin-top:14px}.agentsel-envs-head{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));margin-bottom:6px}.agentsel-env{display:flex;flex-direction:column;gap:1px;margin-bottom:6px}.agentsel-env-k{overflow-wrap:anywhere;font-family:inherit;font-size:11px;color:hsl(var(--muted-foreground))}.agentsel-env-v{overflow-wrap:anywhere;font-family:inherit;font-size:11.5px;color:hsl(var(--foreground))}.agentsel-head-actions{display:flex;align-items:center;gap:2px}.agentsel-pager{display:flex;align-items:center;justify-content:center;gap:14px;flex:0 0 36px;padding:6px 10px 0}.agentsel-pager button{display:flex;border:none;background:none;padding:2px;cursor:pointer;color:hsl(var(--muted-foreground))}.agentsel-pager button:hover:not(:disabled){color:hsl(var(--foreground))}.agentsel-pager button:disabled{opacity:.3;cursor:default}.agentsel-pager button .icon{width:18px;height:18px}.agentsel-pager-label{font-size:13px;color:hsl(var(--muted-foreground));min-width:40px;text-align:center}@keyframes agentsel-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes agentsel-preview-in{0%{opacity:0;transform:translate(-6px)}to{opacity:1;transform:translate(0)}}.agentsel-head{display:flex;align-items:center;justify-content:space-between;height:52px;flex-shrink:0;box-sizing:border-box;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.agentsel-title{display:flex;min-width:0;align-items:center;gap:8px;overflow:hidden;font-weight:600;font-size:14px;text-overflow:ellipsis;white-space:nowrap}.agentsel-title .icon{width:17px;height:17px}.agentsel-refresh{display:flex;border:none;background:none;cursor:pointer;color:hsl(var(--muted-foreground));padding:4px;border-radius:6px}.agentsel-refresh:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.agentsel-refresh .icon{width:16px;height:16px}.agentsel-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:10px}.agentsel-body--cloud{display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}.agentsel-tools{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}.agentsel-search{display:flex;align-items:center;gap:8px;border:1px solid hsl(var(--border));border-radius:8px;padding:7px 10px}.agentsel-search .icon{width:15px;height:15px;color:hsl(var(--muted-foreground))}.agentsel-search input{flex:1;border:none;outline:none;background:none;font:inherit;font-size:13px;color:hsl(var(--foreground))}.agentsel-regions{display:grid;grid-template-columns:repeat(2,1fr);gap:2px;padding:2px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--canvas) / .55)}.agentsel-regions button{height:27px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;outline:none;cursor:pointer}.agentsel-regions button:hover{color:hsl(var(--foreground))}.agentsel-regions button:focus-visible{box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.agentsel-regions button.active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.agentsel-mine{display:flex;align-items:center;gap:7px;font-size:12.5px;color:hsl(var(--muted-foreground));cursor:pointer}.agentsel-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.agentsel-listwrap{position:relative;min-height:220px}.agentsel-body--cloud .agentsel-listwrap{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:auto}.agentsel-loading{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);border-radius:8px}.agentsel-loading .icon{width:16px;height:16px}.agentsel-item{width:100%;display:flex;align-items:center;gap:9px;min-height:46px;padding:4px 0;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13.5px;text-align:left}.agentsel-main button.agentsel-item{min-height:0;padding:9px 10px;cursor:pointer}.agentsel-item:hover{background:hsl(var(--foreground) / .05);box-shadow:none;transform:none}.agentsel-runtime-item:hover{background:none}.agentsel-item.active{background:hsl(var(--foreground) / .08);font-weight:600}.agentsel-item.is-previewed{background:hsl(var(--foreground) / .055)}.agentsel-runtime-item.active,.agentsel-runtime-item.is-previewed{background:none}.agentsel-item .icon{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-item-main{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}.agentsel-item-name{min-width:0;overflow:hidden;font-size:13px;font-weight:550;text-overflow:ellipsis;white-space:nowrap}.agentsel-item-meta{display:flex;align-items:center;gap:4px;min-width:0}.agentsel-item-actions{display:flex;align-items:center;gap:1px;flex-shrink:0}.agentsel-connect,.agentsel-info{border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.agentsel-connect{min-width:38px;height:28px;padding:0 5px;font-size:11.5px;font-weight:550}.agentsel-info{display:grid;width:28px;height:28px;padding:0;place-items:center}.agentsel-connect:hover:not(:disabled),.agentsel-info:hover{background:hsl(var(--foreground) / .07);color:hsl(var(--foreground));box-shadow:none}.agentsel-info.active{background:transparent;color:hsl(var(--foreground));box-shadow:none}.agentsel-connect:disabled{opacity:.55;cursor:default}.agentsel-info .icon{width:15px;height:15px}.agentsel-rt{display:flex;flex-direction:column}.agentsel-rt-row{width:100%;display:flex;align-items:center;gap:7px;padding:9px 8px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13.5px;cursor:pointer;text-align:left}.agentsel-rt-row:hover{background:hsl(var(--foreground) / .05)}.agentsel-rt-row .icon{width:15px;height:15px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-rt-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agentsel-badge{flex-shrink:0;font-size:10px;font-weight:600;padding:1px 6px;border-radius:999px;background:#007bff1f;color:#0b68cb}.agentsel-status{flex-shrink:0;font-size:10px;padding:1px 6px;border-radius:999px}.agentsel-status.is-ok{background:#21c45d24;color:#238b49}.agentsel-status.is-warn{background:#f59f0a29;color:#b86614}.agentsel-status.is-bad{background:#dc282824;color:#ca2b2b}.agentsel-status.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.agentsel-apps{display:flex;flex-direction:column;gap:2px;padding:2px 0 6px 20px}.agentsel-app{width:100%;display:flex;align-items:center;gap:8px;padding:7px 10px;border:none;border-radius:7px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;text-align:left}.agentsel-app:hover{background:hsl(var(--foreground) / .05)}.agentsel-app.active{background:hsl(var(--foreground) / .08);font-weight:600}.agentsel-app .icon{width:14px;height:14px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-apps-note{display:flex;align-items:center;gap:7px;padding:7px 10px;font-size:12.5px;color:hsl(var(--muted-foreground))}.agentsel-apps-note .icon{width:14px;height:14px}.agentsel-apps-note--muted{font-style:italic}.agentsel-empty{padding:24px 10px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.agentsel-error{min-width:0;max-width:100%;margin:4px 0 10px;padding:8px 10px;overflow:hidden;overflow-wrap:anywhere;border-radius:8px;background:#dc282814;color:#bd2828;font-size:12.5px;white-space:pre-wrap}.agentsel-more{width:100%;margin-top:8px;padding:9px;border:1px dashed hsl(var(--border));border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer}.agentsel-more:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}@media (max-width: 860px){.agentsel{--agentsel-available-width: calc(100vw - 218px) }}.sidebar-history{flex:1;min-height:0;display:flex;flex-direction:column}.history-head{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 6px 20px;font-size:12px;font-weight:500;color:hsl(var(--muted-foreground))}.history-refresh{background:none;border:none;cursor:pointer;padding:2px;color:hsl(var(--muted-foreground));display:flex}.history-refresh:hover{color:hsl(var(--foreground))}.history-new-chat{width:24px;height:24px;margin:-4px 0;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s}.history-new-chat .icon{width:15px;height:15px}.history-new-chat:hover{background:transparent;color:hsl(var(--foreground))}.history-list{flex:1;overflow-y:auto;padding:4px 10px 12px;display:flex;flex-direction:column;gap:2px}.history-empty{padding:16px 8px;font-size:13px;color:hsl(var(--muted-foreground));text-align:center}.history-item{position:relative;display:flex;align-items:center;border-radius:8px;transition:background .12s}.history-item:hover{background:hsl(var(--foreground) / .05)}.history-item.active{background:hsl(var(--foreground) / .08)}.history-item-btn{flex:1;min-width:0;display:flex;align-items:center;gap:7px;text-align:left;padding:9px 10px;border:none;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;cursor:pointer}.history-title{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-streaming{flex-shrink:0;width:7px;height:7px;margin-right:4px;border-radius:50%;background:#22c55e;box-shadow:0 0 #22c55e80;animation:history-pulse 1.4s ease-in-out infinite}@keyframes history-pulse{0%,to{box-shadow:0 0 #22c55e80}50%{box-shadow:0 0 0 4px #22c55e00}}.history-more{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:28px;height:28px;margin-right:4px;border:none;border-radius:6px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;opacity:0;transition:opacity .12s,background .12s}.history-item:hover .history-more{opacity:1}.history-more:hover{background:hsl(var(--border));color:hsl(var(--foreground))}.menu-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:30}.history-menu{position:absolute;top:100%;right:4px;z-index:31;min-width:120px;margin-top:2px;padding:4px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:8px;box-shadow:0 6px 20px hsl(var(--foreground) / .12)}.menu-item{display:flex;align-items:center;gap:8px;width:100%;padding:7px 10px;border:none;border-radius:6px;background:none;font:inherit;font-size:13px;cursor:pointer;color:hsl(var(--foreground))}.menu-item:hover{background:hsl(var(--accent))}.menu-item--danger{color:hsl(var(--destructive))}.menu-item .icon{width:15px;height:15px}.main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;margin:0 10px 10px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:12px;overflow:hidden}.error{margin:10px auto 0;max-width:768px;width:calc(100% - 32px);padding:10px 12px;border-radius:var(--radius);background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px}.transcript{flex:1;overflow-y:auto;padding:28px 16px 8px}.welcome{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 16px 6vh;gap:22px}.welcome-title{margin:0;font-size:26px;font-weight:600;letter-spacing:-.02em}.welcome .composer{padding:0}.turn{max-width:768px;margin:0 auto 22px;display:flex;flex-direction:column;gap:8px}.turn:last-child{margin-bottom:0}.turn--user{align-items:flex-end}.turn--assistant{align-items:flex-start}.bubble{line-height:1.65;font-size:14px}.turn--user .bubble{max-width:85%;padding:10px 16px;border-radius:18px;background:hsl(var(--secondary))}.turn--assistant .bubble{max-width:100%}.md{font-size:14px;line-height:1.65}.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}.md p{margin:0 0 .7em}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{margin:1.1em 0 .5em;font-weight:650;line-height:1.3;letter-spacing:-.01em}.md h1{font-size:1.4em}.md h2{font-size:1.25em}.md h3{font-size:1.1em}.md h4,.md h5,.md h6{font-size:1em}.md ul,.md ol{margin:0 0 .7em;padding-left:1.4em}.md li{margin:.15em 0}.md li>ul,.md li>ol{margin:.15em 0}.md a{color:hsl(var(--primary));text-decoration:underline;text-underline-offset:2px}.md a:hover{opacity:.8}.md blockquote{margin:0 0 .7em;padding:.1em .9em;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.md hr{border:none;border-top:1px solid hsl(var(--border));margin:1em 0}.md strong{font-weight:650}.md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.875em;background:hsl(var(--muted));padding:.12em .35em;border-radius:5px}.md pre{margin:0 0 .7em;padding:12px 14px;background:hsl(var(--muted));border-radius:8px;overflow-x:auto;line-height:1.55}.md pre code{background:none;padding:0;border-radius:0;font-size:12.5px}.md table{width:100%;margin:0 0 .7em;border-collapse:collapse;font-size:.95em;border-radius:12px;overflow:hidden;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border))}.md table thead th,.md table th{background:hsl(var(--muted));font-weight:650;border:1px solid hsl(var(--border));padding:12px 16px;text-align:left;font-size:.98em}.md table tbody td,.md table td{border:1px solid hsl(var(--border));padding:12px 16px;text-align:left;vertical-align:top;line-height:1.65}.md table tbody tr:nth-child(2n){background:hsl(var(--muted) / .25)}.md table tbody tr:hover{background:hsl(var(--accent))}.md table caption{caption-side:top;text-align:left;padding:0 0 8px;font-weight:600;color:hsl(var(--muted-foreground));font-size:.9em}.md table colgroup,.md table col{display:table-column}.md table thead,.md table tbody,.md table tfoot{display:table-row-group}.md table tr{display:table-row}.md strong,.md b{font-weight:650}.md em,.md i{font-style:italic}.md del,.md s{text-decoration:line-through}.md ins,.md u{text-decoration:underline}.md mark{background:#fff3c2b3;padding:.1em .3em;border-radius:4px}.md sub{vertical-align:sub;font-size:.8em}.md sup{vertical-align:super;font-size:.8em}.md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.md pre{overflow-x:auto}@media (max-width: 640px){.md table{font-size:.85em}.md table thead th,.md table th,.md table tbody td,.md table td{padding:8px 10px}}.md p{line-height:1.7}.md br{display:block;content:"";margin:.4em 0}.md hr{border:none;border-top:1px solid hsl(var(--border));margin:1.5em 0}.md blockquote{border-left:3px solid hsl(var(--primary) / .4);padding:.6em 1em;margin:.8em 0;background:hsl(var(--muted) / .3);border-radius:0 8px 8px 0}.md ul,.md ol{padding-left:1.6em;margin:.6em 0}.md li{margin:.3em 0;line-height:1.6}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{margin-top:1.2em;margin-bottom:.5em;line-height:1.3}.md h1{font-size:1.6em;font-weight:700}.md h2{font-size:1.4em;font-weight:650}.md h3{font-size:1.2em;font-weight:600}.md h4{font-size:1.1em;font-weight:600}.md h5,.md h6{font-size:1em;font-weight:600}.md .image-preview-trigger{position:relative;display:block;width:fit-content;max-width:40%;margin:0 0 .7em;padding:0;overflow:hidden;border:0;border-radius:10px;background:hsl(var(--muted));box-shadow:0 0 0 1px hsl(var(--border));cursor:zoom-in;line-height:0}.md .image-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .image-preview-trigger img{display:block;width:auto;max-width:100%;height:auto;border-radius:inherit;transition:filter .18s ease,transform .18s ease}.md .image-preview-trigger:hover img{filter:brightness(.92);transform:scale(1.01)}.image-preview-hint{position:absolute;right:8px;bottom:8px;display:grid;width:28px;height:28px;place-items:center;border:1px solid hsl(0 0% 100% / .2);border-radius:8px;background:#131316ad;color:#fff;opacity:0;transform:translateY(3px);transition:opacity .16s ease,transform .16s ease}.image-preview-hint svg{width:14px;height:14px}.image-preview-trigger:hover .image-preview-hint,.image-preview-trigger:focus-visible .image-preview-hint{opacity:1;transform:translateY(0)}.md .video-container{margin:0 0 .7em;display:grid;gap:6px}.md .video-caption{font-size:.9em;color:hsl(var(--muted-foreground))}.md .video-link-text{color:inherit;text-decoration:none;transition:color .15s ease}.md .video-link-text:hover{color:hsl(var(--foreground));text-decoration:underline}.md .video-preview-trigger{position:relative;display:block;width:fit-content;max-width:80%;padding:0;overflow:hidden;border:0;border-radius:12px;background:hsl(var(--muted));box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border));cursor:pointer;line-height:0;transition:box-shadow .18s ease,transform .18s ease}.md .video-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .video-preview-trigger:hover{box-shadow:0 4px 16px hsl(var(--foreground) / .15),0 0 0 1px hsl(var(--border));transform:translateY(-1px)}.md .video-preview-trigger .video-thumbnail{display:block;width:auto;max-width:100%;height:auto;border-radius:inherit;transition:filter .18s ease,transform .18s ease}.md .video-preview-trigger:hover .video-thumbnail{filter:brightness(.9);transform:scale(1.01)}.video-preview-hint{position:absolute;right:10px;bottom:10px;display:grid;width:32px;height:32px;place-items:center;border:1px solid hsl(0 0% 100% / .2);border-radius:10px;background:#131316b3;color:#fff;opacity:0;transform:translateY(4px);transition:opacity .16s ease,transform .16s ease;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.video-preview-hint svg{width:16px;height:16px}.video-preview-trigger:hover .video-preview-hint,.video-preview-trigger:focus-visible .video-preview-hint{opacity:1;transform:translateY(0)}.md .video-inline{max-width:100%;border-radius:12px;margin:0 0 .7em;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border))}.video-viewer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:grid;place-items:center;padding:28px;background:#131316c7;-webkit-backdrop-filter:blur(16px) saturate(.85);backdrop-filter:blur(16px) saturate(.85)}.video-viewer{display:flex;flex-direction:column;width:min(1080px,94vw);max-height:min(880px,90vh);overflow:hidden;border:1px solid hsl(var(--foreground) / .15);border-radius:18px;background:hsl(var(--background));box-shadow:0 32px 100px #07070885}.video-viewer-header{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:10px 16px;background:hsl(var(--muted) / .3);border-bottom:1px solid hsl(var(--border))}.video-viewer-title{font-weight:500;color:hsl(var(--foreground));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:70%}.video-viewer-nav{display:flex;gap:6px}.video-viewer-download,.video-viewer-close{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.video-viewer-download:hover,.video-viewer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.video-viewer-download svg,.video-viewer-close svg{width:17px;height:17px}.video-viewer-body{flex:1;min-height:0;display:grid;place-items:center;padding:20px;overflow:hidden;background:#161618}.video-viewer-body .video-fullscreen{max-width:100%;max-height:calc(90vh - 96px);border-radius:12px;background:#000;box-shadow:0 4px 20px #0006}@media (max-width: 640px){.md .video-preview-trigger{max-width:100%}.video-viewer-backdrop{padding:0}.video-viewer{width:100vw;max-height:100vh;border:none;border-radius:0}.video-viewer-body .video-fullscreen{max-height:calc(100vh - 96px);border-radius:0}}.turn--user .md code,.turn--user .md pre{background:hsl(var(--background) / .55)}.block-thinking,.block-tool{width:100%}.think-head,.tool-head{display:inline-flex;align-items:center;border:none;background:none;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.think-head{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.think-icon{width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center}.think-icon>svg{width:18px;height:18px}.spark{color:hsl(var(--muted-foreground))}.spark.pulse{animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{0%,to{opacity:.45;transform:scale(.92)}50%{opacity:1;transform:scale(1.08)}}.chev{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.chev.open{transform:rotate(90deg)}.think-label{font-size:13.5px;font-weight:400;line-height:1.35}.think-label--done{color:hsl(var(--muted-foreground))}.tool-head{color:hsl(var(--muted-foreground));transition:color .12s}.tool-head:hover{color:hsl(var(--foreground))}.tool-head--generic{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.tool-name{color:inherit;font-size:13.5px;font-weight:400;line-height:1.35}.tool-icon{width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center}.tool-icon>svg{width:18px;height:18px}.tool-icon--generic{color:hsl(var(--muted-foreground))}.tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.tool-chevron.is-open{transform:rotate(90deg)}.tool-detail{display:flex;flex-direction:column;gap:8px;margin:6px 0 4px;padding-left:3px}.tool-section-label{margin-bottom:4px;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:hsl(var(--muted-foreground))}.tool-result{max-height:240px;overflow:auto}.think-collapse{display:grid;grid-template-rows:0fr;transition:grid-template-rows .28s ease}.think-collapse.open{grid-template-rows:1fr}.think-collapse-inner{overflow:hidden}.think-body{margin:8px 0 4px;padding:10px 14px;border-left:2px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:13px;line-height:1.7;white-space:pre-wrap;max-height:220px;overflow-y:auto}.tool-args{margin:0;padding:8px 10px;background:hsl(var(--muted));border-radius:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5;overflow-x:auto;white-space:pre-wrap}.turn-meta{display:flex;align-items:center;gap:10px;margin-top:2px;font-size:12px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s}.turn-empty{margin-top:2px;font-size:13px;font-style:italic;color:hsl(var(--muted-foreground))}.auth-card{width:100%;max-width:640px;margin:2px 0;padding:18px 20px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.auth-card-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}.auth-card-icon{width:18px;height:18px;color:#f59f0a}.auth-card-icon--done{color:#1eae53}.auth-card-collapsed{display:inline-flex;align-items:center;gap:7px;margin:2px 0;padding:6px 12px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--card));font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.auth-card-code{padding:1px 6px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}.auth-card-title{font-size:14px;font-weight:600}.auth-card-desc{margin:0 0 14px;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.auth-card-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;border:none;border-radius:9px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:opacity .12s}.auth-card-btn:hover:not(:disabled){opacity:.88}.auth-card-btn:disabled{opacity:.55;cursor:default}.auth-card-btn .cw-i{width:15px;height:15px}.auth-card-done{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:#1eae53}.auth-card-done .cw-i{width:16px;height:16px}.auth-card-err{margin-top:8px;font-size:12px;color:hsl(var(--destructive))}.turn-actions{display:inline-flex;align-items:center;gap:2px}.turn-actions--right{align-self:flex-end;margin-top:2px;opacity:0;transition:opacity .15s}.turn--assistant:hover .turn-meta,.turn--user:hover .turn-actions--right{opacity:1}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:6px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.icon-btn:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.icon-btn:disabled{opacity:.35;cursor:default}.icon-btn:disabled:hover{background:none;color:hsl(var(--muted-foreground))}.icon-btn .icon{width:15px;height:15px}.meta-text{white-space:nowrap;font-size:12px;color:hsl(var(--muted-foreground))}.turn-actions--right{gap:6px}.drawer-scrim{position:fixed;top:0;right:0;bottom:0;left:0;background:hsl(var(--foreground) / .2);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fade .2s ease;z-index:40}@keyframes fade{0%{opacity:0}to{opacity:1}}.drawer{position:fixed;top:0;right:0;bottom:0;width:min(560px,92vw);background:hsl(var(--background));border-left:1px solid hsl(var(--border));box-shadow:-12px 0 40px hsl(var(--foreground) / .14);display:flex;flex-direction:column;z-index:41;animation:slidein .24s cubic-bezier(.22,1,.36,1)}@keyframes slidein{0%{transform:translate(100%)}to{transform:translate(0)}}.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas))}.drawer-title{font-weight:650;font-size:15px;letter-spacing:-.01em}.drawer-sub{font-size:12px;color:hsl(var(--muted-foreground));margin-top:3px;font-variant-numeric:tabular-nums}.drawer-close{display:flex;padding:6px;border:none;background:none;cursor:pointer;color:hsl(var(--muted-foreground));border-radius:6px}.drawer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.drawer-body{flex:1;overflow:auto;padding:16px 18px}.drawer-loading,.drawer-empty{display:flex;align-items:center;gap:8px;color:hsl(var(--muted-foreground));font-size:14px;padding:20px 0}.drawer--trace{width:min(1080px,96vw)}.trace-split{flex:1;min-height:0;display:flex}.trace-tree{flex:1.25;min-width:0;overflow:auto;padding:8px 6px;border-right:1px solid hsl(var(--border))}.trace-row{display:flex;align-items:center;gap:10px;width:100%;padding:5px 8px;border:none;background:none;border-radius:6px;cursor:pointer;font:inherit;text-align:left;transition:background .1s}.trace-row:hover{background:hsl(var(--foreground) / .04)}.trace-row.active{background:hsl(var(--primary) / .07);box-shadow:inset 2px 0 hsl(var(--primary) / .55)}.trace-label{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.trace-caret{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:hsl(var(--muted-foreground))}.trace-caret.hidden{visibility:hidden}.trace-caret .chev{width:13px;height:13px;transition:transform .18s}.trace-caret.open .chev{transform:rotate(90deg)}.trace-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.trace-name{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.trace-dur{flex-shrink:0;width:66px;text-align:right;font-size:11px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}.trace-track{position:relative;flex:0 0 34%;height:16px;border-radius:5px;background:hsl(var(--foreground) / .05)}.trace-bar{position:absolute;top:4px;height:8px;min-width:3px;border-radius:4px;opacity:.9}.trace-detail{flex:1;min-width:0;overflow:auto;padding:18px 20px}.td-title{font-size:15px;font-weight:600;letter-spacing:-.01em;word-break:break-all}.td-dur{display:flex;align-items:center;gap:7px;margin-top:4px;font-size:12px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}.td-dot{width:8px;height:8px;border-radius:50%}.td-section{margin:22px 0 9px;font-size:12px;font-weight:650;letter-spacing:.01em;color:hsl(var(--foreground))}.td-props{display:flex;flex-direction:column}.td-prop{display:flex;gap:16px;padding:7px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.td-key{flex-shrink:0;color:hsl(var(--muted-foreground));min-width:140px}.td-val{flex:1;min-width:0;text-align:right;word-break:break-word;font-variant-numeric:tabular-nums}.td-pre{margin:0;padding:11px 13px;background:hsl(var(--canvas));border:1px solid hsl(var(--border));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:320px;overflow:auto}.composer{max-width:768px;width:100%;margin:0 auto;padding:6px 16px 18px}.composer-box{position:relative;display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 8px;border:1px solid hsl(var(--border));border-radius:26px;background:hsl(var(--background))}.composer--new-chat .composer-box{display:block;min-height:136px;padding:10px;border-radius:16px}.composer-input-stack{display:flex;flex:1;min-width:0;flex-direction:column}.composer-input-stack .comp-input{width:100%}.composer--new-chat .composer-input-stack{min-height:114px}.composer--new-chat .comp-input{min-height:76px;padding:4px 10px}.composer--new-chat .composer-menu-wrap{position:absolute;bottom:10px;left:10px;height:36px}.composer--new-chat .new-chat-mode{position:absolute;right:52px;bottom:10px;display:flex;align-items:center;min-height:36px}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.composer-meta{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;padding:7px 12px 0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4}.composer-session-line{display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap}.composer-session-id{max-width:300px;overflow:hidden;text-overflow:ellipsis;font-family:inherit}.composer-session-copy{display:inline-grid;flex:0 0 18px;width:18px;height:18px;padding:0;place-items:center;border:0;border-radius:4px;background:transparent;color:inherit;cursor:pointer;opacity:.72;transition:background .12s ease,color .12s ease,opacity .12s ease}.composer-session-copy:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground));opacity:1}.composer-session-copy svg{width:11px;height:11px}.composer-meta-separator{opacity:.55}.comp-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 4px;max-height:200px;overflow-y:auto}.comp-input::placeholder{color:hsl(var(--muted-foreground))}.comp-icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.comp-icon:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.comp-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.comp-send:hover:not(:disabled){opacity:.85}.comp-send:active:not(:disabled){transform:scale(.94)}.comp-send:disabled{opacity:.3;cursor:default}.invocation-chips{display:flex;flex-wrap:wrap;gap:6px;min-width:0}.composer>.invocation-chips{padding:0 8px 8px}.turn--user>.invocation-chips{justify-content:flex-end;margin-bottom:6px}.invocation-chip{display:inline-flex;align-items:center;gap:5px;max-width:260px;min-height:28px;padding:4px 8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .025);font-size:12px;font-weight:560;line-height:1.2}.invocation-chip--skill{color:#267848}.invocation-chip--agent{color:#2762b0}.invocation-chip>svg{width:13px;height:13px;flex:0 0 auto}.invocation-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.invocation-chip button{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;margin:-1px -3px -1px 1px;padding:0;border:none;border-radius:5px;background:transparent;color:currentColor;cursor:pointer;opacity:.55}.invocation-chip button:hover{background:hsl(var(--accent));opacity:1}.invocation-chip button svg{width:11px;height:11px}.composer-command-menu{position:absolute;z-index:34;bottom:calc(100% + 10px);left:0;width:min(500px,calc(100vw - 48px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));box-shadow:0 2px 7px hsl(var(--foreground) / .08),0 22px 60px -24px hsl(var(--foreground) / .28);transform-origin:bottom left;animation:command-menu-in .13s ease-out}@keyframes command-menu-in{0%{opacity:0;transform:translateY(5px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}.composer-command-head{display:flex;align-items:center;gap:7px;height:38px;padding:0 10px 0 12px;border-bottom:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11px;font-weight:650;letter-spacing:.02em}.composer-command-head>svg{width:13px;height:13px}.composer-command-head>span{flex:1}.composer-command-menu kbd{min-width:22px;padding:2px 5px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--canvas));color:hsl(var(--muted-foreground));font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.composer-command-list{display:grid;max-height:min(330px,42vh);overflow-y:auto;padding:5px}.composer-command-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;width:100%;min-height:52px;padding:6px 8px;border:none;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.composer-command-item.is-active{background:hsl(var(--accent))}.composer-command-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:9px}.composer-command-icon--skill{background:#e7f8ee;color:#218349}.composer-command-icon--agent{background:#e9f1fc;color:#2664b5}.composer-command-icon svg{width:16px;height:16px}.composer-command-copy{display:grid;min-width:0;gap:3px}.composer-command-copy strong{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.composer-command-copy>span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.composer-command-empty{display:flex;align-items:center;justify-content:center;gap:7px;min-height:68px;padding:14px;color:hsl(var(--muted-foreground));font-size:12px}.composer-command-empty svg{width:14px;height:14px}.composer-menu-wrap{position:relative;flex-shrink:0}.composer-menu{position:absolute;bottom:100%;left:0;z-index:31;min-width:168px;margin-bottom:6px;padding:4px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 6px 20px hsl(var(--foreground) / .12)}.media-grid{display:flex;flex-wrap:wrap;gap:8px;max-width:min(620px,100%)}.turn--user .media-grid{justify-content:flex-end}.composer>.media-grid{padding:0 8px 9px;justify-content:flex-start}.media-card{position:relative;width:272px;min-width:0;overflow:visible;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .025);transition:border-color .16s,box-shadow .16s,transform .16s}.media-card:hover{border-color:hsl(var(--foreground) / .2);box-shadow:0 8px 28px -20px hsl(var(--foreground) / .28);transform:translateY(-1px)}.media-card--image{width:176px}.media-grid--compact .media-card{width:224px}.media-grid--compact .media-card--image{width:92px}.media-card-main{display:flex;align-items:center;gap:11px;width:100%;min-width:0;height:68px;padding:10px 12px;border:none;border-radius:inherit;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.media-card-main:disabled{cursor:default}.media-card--image .media-card-main{display:block;height:132px;padding:4px}.media-grid--compact .media-card-main{height:58px;padding:8px 10px}.media-grid--compact .media-card--image .media-card-main{height:72px;padding:3px}.media-card-image{width:100%;height:100%;object-fit:cover;border-radius:10px;display:block;background:hsl(var(--muted))}.media-card--image .media-card-copy,.media-card--image .media-card-open{display:none}.media-card-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:44px;flex:0 0 auto;border-radius:9px;color:hsl(var(--muted-foreground));background:hsl(var(--muted))}.media-card--pdf .media-card-icon{color:#db2a24;background:#fdeded}.media-card--video .media-card-icon{color:#226cd3;background:#edf3fd}.media-card--markdown .media-card-icon{color:#259353;background:#ebfaf1}.media-card-icon svg{width:21px;height:21px}.media-card-video-container{position:relative;display:grid;place-items:center;width:100%;height:100%;overflow:hidden;background:#131316}.media-card-video{width:100%;height:100%;object-fit:cover;opacity:.85}.media-card-video-play{position:absolute;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#0000008c;color:#fff;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transform:scale(1);transition:transform .18s ease,background .18s ease}.media-card-video-play svg{width:20px;height:20px;margin-left:3px}.media-card-main:hover .media-card-video-play{transform:scale(1.08);background:#000000b3}.media-card-copy{min-width:0;flex:1;display:grid;gap:5px}.media-card-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:1.2;font-weight:560}.media-card-meta{display:flex;align-items:center;gap:5px;min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.2}.media-card-type{font-size:9px;font-weight:700;letter-spacing:.06em}.media-card-open{width:14px;height:14px;flex:0 0 auto;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s}.media-card:hover .media-card-open{opacity:1}.media-card-spinner{width:12px;height:12px;animation:spin .85s linear infinite}.media-card--error{border-color:hsl(var(--destructive) / .42)}.media-card--error .media-card-meta{color:hsl(var(--destructive))}.media-card-remove{position:absolute;z-index:2;top:-7px;right:-7px;display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;padding:0;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));box-shadow:0 2px 8px hsl(var(--foreground) / .12);cursor:pointer}.media-card-remove:hover{color:hsl(var(--foreground))}.media-card-remove svg{width:12px;height:12px}.media-viewer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:grid;place-items:center;padding:28px;background:#131316b8;-webkit-backdrop-filter:blur(12px) saturate(.8);backdrop-filter:blur(12px) saturate(.8)}.media-viewer{display:flex;flex-direction:column;width:min(1080px,94vw);height:min(820px,90vh);overflow:hidden;border:1px solid hsl(var(--foreground) / .13);border-radius:18px;background:hsl(var(--background));box-shadow:0 32px 100px #07070875}.media-viewer-header{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:58px;padding:9px 12px 9px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background) / .94)}.media-viewer-header>div{min-width:0;display:grid;gap:2px}.media-viewer-header strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:620}.media-viewer-header span{color:hsl(var(--muted-foreground));font-size:11px}.media-viewer-header nav{display:flex;gap:4px}.media-viewer-header a,.media-viewer-header button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.media-viewer-header a:hover,.media-viewer-header button:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.media-viewer-header svg{width:17px;height:17px}.media-viewer-body{flex:1;min-height:0;overflow:auto;background:hsl(var(--canvas))}.media-viewer-body--image,.media-viewer-body--video{display:grid;place-items:center;padding:24px;background:#161618}.media-viewer-body--image img,.media-viewer-body--video video{max-width:100%;max-height:100%;object-fit:contain;border-radius:8px}.media-viewer-video-wrapper{width:100%;display:grid;place-items:center}.media-viewer-video{max-width:100%;max-height:calc(90vh - 140px);border-radius:12px;background:#000;box-shadow:0 4px 20px #0006}.media-viewer-body--pdf iframe{display:block;width:100%;height:100%;border:none;background:#fff}.media-document{width:min(820px,calc(100% - 48px));margin:24px auto;padding:34px 40px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 38px -30px hsl(var(--foreground) / .3)}.media-document--plain{min-height:calc(100% - 48px);white-space:pre-wrap;word-break:break-word;font:13px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace}.media-viewer-loading{display:flex;align-items:center;justify-content:center;gap:8px;height:100%;color:hsl(var(--muted-foreground));font-size:13px}.media-viewer-loading svg{width:17px;height:17px;animation:spin .85s linear infinite}@media (max-width: 640px){.composer-command-menu{right:0;width:auto}.media-card{width:min(272px,82vw)}.media-viewer-backdrop{padding:0}.media-viewer{width:100vw;height:100vh;border:none;border-radius:0}.media-document{width:calc(100% - 24px);margin:12px auto;padding:22px 18px}.md .image-preview-trigger{max-width:100%}}.a2ui-surface{max-width:360px;width:100%;font-size:14px}.a2ui-card{background:hsl(var(--card));border:1px solid hsl(var(--border));border-radius:8px;padding:18px;box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .18)}.a2ui-column,.a2ui-row{gap:10px}.a2ui-text{margin:0;line-height:1.5;color:hsl(var(--foreground))}.a2ui-text--h1{font-size:19px;font-weight:650;letter-spacing:0}.a2ui-text--h2{font-size:16px;font-weight:650;letter-spacing:0}.a2ui-text--h3{font-size:14px;font-weight:600}.a2ui-text--h4{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));text-transform:uppercase;letter-spacing:0}.a2ui-text--caption{font-size:12px;color:hsl(var(--muted-foreground))}.a2ui-text--body{font-size:14px}.a2ui-icon{display:inline-flex;align-items:center;justify-content:center;font-size:15px;line-height:1;color:hsl(var(--muted-foreground))}.a2ui-divider--h{height:1px;background:hsl(var(--border));margin:4px 0;width:100%}.a2ui-divider--v{width:1px;background:hsl(var(--border));align-self:stretch}.a2ui-button{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));border:1px solid transparent;border-radius:10px;padding:8px 14px;cursor:pointer;font:inherit;font-size:13px;font-weight:500;transition:background .15s,opacity .15s}.a2ui-button:hover{background:hsl(var(--accent))}.a2ui-button--primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.a2ui-button--primary:hover{background:hsl(var(--primary));opacity:.88}.a2ui-button--borderless{background:transparent;color:hsl(var(--foreground))}.a2ui-button--borderless:hover{background:hsl(var(--accent))}.a2ui-surface[data-a2ui-surface^=flight-]{max-width:520px}.a2ui-surface[data-a2ui-surface^=flight-] .a2ui-card{padding:0;overflow:hidden;background:linear-gradient(180deg,#f6fbfe,hsl(var(--card)) 42%),hsl(var(--card));border-color:#d7e0ea;box-shadow:0 1px 2px hsl(var(--foreground) / .05),0 18px 48px -28px #283d5359}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-content]{gap:16px;padding:18px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-top]{gap:12px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-brand]{min-width:0}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-brand-icon]{width:28px;height:28px;border-radius:999px;background:#006fe61a;color:#004fa3}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-title]{font-size:13px;color:#41454e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip]{flex-shrink:0;gap:6px;padding:5px 9px;border-radius:999px;background:#e3f8ed;border:1px solid hsl(151 48% 82%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip] .a2ui-icon,.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-text]{color:#126e41}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-hero]{position:relative;gap:16px;padding:18px;border-radius:8px;background:hsl(var(--background) / .88);border:1px solid hsl(210 32% 90%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination]{flex:1 1 0;min-width:0;gap:2px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{font-size:34px;line-height:1;font-weight:760;color:#191d24}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-label],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-label]{font-size:11px;font-weight:700;color:#717784}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-city],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-city]{font-size:13px;color:#545964}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{flex:0 0 auto;gap:3px;padding:0 4px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-icon]{width:34px;height:34px;border-radius:999px;background:#006fe61f;color:#0054ad}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-duration],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-aircraft]{font-size:11px;white-space:nowrap}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-times],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-details]{gap:10px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-time],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-time],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding]{flex:1 1 0;min-width:0;gap:2px;padding:11px 12px;border-radius:8px;background:#f3f4f6;border:1px solid hsl(220 13% 91%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-value]{font-size:14px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-airport],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-airport]{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding-value]{font-size:20px;line-height:1.15}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-footer]{gap:10px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-divider]{margin:0;background:#d9e0e8}@media (max-width: 520px){.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-content]{padding:14px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-hero],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-times],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-details]{flex-wrap:wrap}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{order:3;width:100%}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding]{min-width:120px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{font-size:34px}}.a2ui-fallback{background:hsl(var(--muted));border:1px solid hsl(var(--border));border-radius:10px;padding:8px 10px;font-size:12px;color:hsl(var(--muted-foreground))}.a2ui-fallback pre{overflow-x:auto;margin:6px 0 0}.boot{height:100vh;background:hsl(var(--background))}.boot-error{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:hsl(var(--foreground));font-size:14px}.boot-error p{margin:0}.boot-error button,.login-provider-error button{padding:7px 18px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--card));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer}.boot-error button:hover,.login-provider-error button:hover{background:hsl(var(--accent))}.navbar{flex:0 0 54px;min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 10px;background:transparent}.navbar-left,.navbar-right,.navbar-default,.navbar-portal-slot,.navbar-portal-actions{display:flex;align-items:center}.navbar-left{flex:1;min-width:0}.navbar-default{min-width:0}.navbar-right{flex:0 0 auto;min-width:0;gap:10px}.navbar-portal-slot,.navbar-portal-actions{min-width:0}.navbar-portal-slot:empty,.navbar-portal-actions:empty{display:none}.navbar-left:has(.navbar-portal-slot:not(:empty))>.navbar-default{display:none}.global-deploy-center{position:relative;z-index:38}.global-deploy-task{max-width:300px;min-height:32px;display:flex;align-items:center;gap:7px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background) / .82);color:hsl(var(--muted-foreground));font:inherit;font-size:12px;outline:none;white-space:nowrap;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}.global-deploy-task:hover{background:hsl(var(--background))}.global-deploy-task:focus-visible{border-color:hsl(var(--ring) / .32);box-shadow:0 0 0 2px hsl(var(--ring) / .07)}.global-deploy-task.is-idle{color:hsl(var(--muted-foreground))}.global-deploy-task.is-running{border-color:#0c77e93d;color:#1863b4}.global-deploy-task.is-success{border-color:#279b5138;color:#277c46}.global-deploy-task.is-error{border-color:hsl(var(--destructive) / .24);color:hsl(var(--destructive))}.global-deploy-task.is-cancelled{color:hsl(var(--muted-foreground))}.global-deploy-task-icon{width:14px;height:14px;flex:0 0 auto}.global-deploy-task-detail{overflow:hidden;text-overflow:ellipsis}.global-deploy-task-chevron{width:13px;height:13px;flex:0 0 auto;transition:transform .14s ease}.global-deploy-task-chevron.is-open{transform:rotate(180deg)}.global-deploy-task-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;padding:0;border:0;background:transparent}.global-deploy-popover{position:absolute;top:40px;right:0;z-index:2;width:390px;max-width:calc(100vw - 32px);overflow:hidden;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--background));box-shadow:0 14px 36px hsl(var(--foreground) / .14)}.global-deploy-popover-head{height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground));font-size:13px;font-weight:650}.global-deploy-popover-head span:last-child{min-width:20px;padding:1px 6px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.global-deploy-list{max-height:min(520px,calc(100vh - 82px));overflow-y:auto;padding:8px}.global-deploy-empty{padding:34px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.global-deploy-item{padding:12px;border:1px solid hsl(var(--border) / .8);border-radius:8px;background:hsl(var(--canvas) / .42)}.global-deploy-item+.global-deploy-item{margin-top:7px}.global-deploy-item-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.global-deploy-runtime-name{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.global-deploy-status{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:11.5px}.global-deploy-item.is-running .global-deploy-status{color:#1863b4}.global-deploy-item.is-success .global-deploy-status{color:#277c46}.global-deploy-item.is-error .global-deploy-status{color:hsl(var(--destructive))}.global-deploy-item.is-cancelled .global-deploy-status{color:hsl(var(--muted-foreground))}.global-deploy-meta{display:grid;grid-template-columns:1fr 1fr;gap:9px 14px;margin:11px 0 0}.global-deploy-meta>div{min-width:0}.global-deploy-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:10.5px}.global-deploy-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.global-deploy-message{margin:10px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.global-deploy-error{margin-top:10px;color:hsl(var(--muted-foreground));font-size:11.5px}.deploy-error-message-text{display:-webkit-box;margin:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-height:1.5;overflow-wrap:anywhere;white-space:pre-wrap}.deploy-error-message.is-expanded .deploy-error-message-text{display:block;max-height:280px;overflow:auto;-webkit-line-clamp:unset}.deploy-error-message-actions{display:flex;justify-content:flex-end;gap:2px;margin-top:6px}.deploy-error-message-actions button{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:inherit;cursor:pointer;opacity:.72}.deploy-error-message-actions button:hover{background:hsl(var(--foreground) / .07);opacity:1}.deploy-error-message-actions button:disabled{cursor:default;opacity:.5}.deploy-error-message-actions .deploy-error-retry{width:auto;gap:5px;margin-right:auto;padding:0 8px;font:inherit;font-size:11.5px;font-weight:600}.deploy-error-message-actions svg{width:14px;height:14px}.global-deploy-progress{height:3px;margin-top:10px;overflow:hidden;border-radius:999px;background:hsl(var(--foreground) / .08)}.global-deploy-progress span{display:block;height:100%;border-radius:inherit;background:#2581e4;transition:width .18s ease}.global-deploy-item-actions{display:flex;justify-content:flex-end;margin-top:9px}.global-deploy-item-actions button{min-height:27px;padding:0 9px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;cursor:pointer}.global-deploy-item-actions button:hover:not(:disabled){border-color:hsl(var(--destructive) / .3);background:hsl(var(--destructive) / .05);color:hsl(var(--destructive))}.global-deploy-item-actions button:disabled{opacity:.55;cursor:default}.navbar-title{padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.agent-dd{position:relative}.agent-dd-trigger{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:16px;font-weight:650;letter-spacing:-.01em;cursor:pointer;transition:background .12s}.agent-dd-trigger:hover{background:hsl(var(--foreground) / .05)}.agent-dd-current{max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-dd-chev{width:16px;height:16px;opacity:.6;transition:transform .2s ease}.agent-dd-chev.open{transform:rotate(180deg)}.agent-dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;min-width:240px;max-width:360px;max-height:min(560px,calc(100dvh - 84px));padding:6px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);display:flex;flex-direction:column;gap:2px;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;animation:ddpop .14s ease}@keyframes ddpop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.agent-dd-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;text-align:left;cursor:pointer;transition:background .12s}.agent-dd-row{position:relative}.agent-dd-item{width:100%}.agent-dd-item:hover{background:hsl(var(--foreground) / .05)}.agent-dd-item.active{background:hsl(var(--foreground) / .04)}.agent-dd-item-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-dd-item-dot{width:8px;height:8px;flex-shrink:0;border-radius:50%;background:#21c45d;box-shadow:0 0 0 3px #21c45d2e}.agent-dd-flyout{position:absolute;left:248px;z-index:32;width:280px;padding:12px 14px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);animation:ddpop .12s ease}.agent-dd-flyout:before{content:"";position:absolute;top:0;bottom:0;left:-12px;width:14px}.agent-dd-fly-loading{display:flex;align-items:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground))}.agent-dd-fly-name{font-size:14px;font-weight:650;letter-spacing:-.01em}.agent-dd-fly-desc{margin-top:3px;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.agent-dd-fly-field{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12.5px;color:hsl(var(--foreground))}.agent-dd-fly-field .icon{width:14px;height:14px;flex-shrink:0;color:hsl(var(--muted-foreground))}.agent-dd-fly-field--tools{align-items:flex-start}.agent-dd-fly-field--tools .icon{margin-top:3px}.agent-dd-fly-label{color:hsl(var(--muted-foreground))}.agent-dd-fly-model{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}.agent-dd-fly-chips{display:flex;flex-wrap:wrap;gap:5px}.agent-dd-chip{padding:2px 8px;border-radius:999px;background:hsl(var(--foreground) / .06);font-size:11.5px;white-space:nowrap}.account{position:relative}.account-avatar{width:32px;height:32px;flex-shrink:0;position:relative;isolation:isolate;overflow:hidden;border:none;border-radius:9px;background:radial-gradient(circle at var(--avatar-x, 32%) var(--avatar-y, 30%),hsl(var(--avatar-hue-a, 202) 100% 92%) 0 12%,hsl(var(--avatar-hue-a, 202) 95% 75% / .76) 34%,transparent 62%),radial-gradient(ellipse at 82% 78%,hsl(var(--avatar-hue-c, 185) 86% 49% / .88) 0 18%,transparent 58%),linear-gradient(142deg,hsl(var(--avatar-hue-b, 222) 94% 83%),hsl(var(--avatar-hue-b, 222) 95% 54%) 52%,hsl(var(--avatar-hue-c, 185) 74% 62%));background-size:180% 180%,160% 160%,100% 100%;background-position:20% 12%,80% 80%,center;color:#152747e0;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;cursor:pointer;text-shadow:0 1px 2px hsl(0 0% 100% / .62);box-shadow:none;animation:avatar-smoke-drift 9s ease-in-out infinite alternate;transition:filter .16s,transform .16s}.account-avatar:hover{filter:saturate(1.12) brightness(1.03);transform:scale(1.035)}.account-avatar.has-image{animation:none;text-shadow:none}.account-avatar-image{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;border-radius:inherit;object-fit:cover}@keyframes avatar-smoke-drift{0%{background-position:18% 12%,82% 84%,center}50%{background-position:58% 42%,54% 62%,center}to{background-position:82% 70%,26% 24%,center}}.account-avatar--lg{width:40px;height:40px;border-radius:11px;font-size:16px;cursor:default}.account-pop{position:absolute;top:calc(100% + 8px);right:0;z-index:31;min-width:220px;padding:12px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);animation:ddpop .12s ease}.account-head{display:flex;align-items:center;gap:10px}.account-id{min-width:0;flex:1}.account-name-row{display:flex;align-items:center;gap:6px;min-width:0}.account-name{min-width:0;flex:1;font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-sub{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-logout{display:flex;align-items:center;gap:8px;width:100%;margin-top:10px;padding:9px 10px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s}.account-logout:hover{background:hsl(var(--foreground) / .05)}.account-logout .icon{width:16px;height:16px;color:hsl(var(--muted-foreground))}.sidebar-user{position:relative;flex-shrink:0;margin-top:auto;padding:8px 10px 12px}.sidebar-user-btn{display:flex;align-items:center;gap:9px;width:100%;padding:7px 8px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;cursor:pointer;transition:background .12s}.sidebar-user-btn:hover{background:hsl(var(--foreground) / .05)}.sidebar-user-identity{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.sidebar-user-primary{min-width:0;display:flex;align-items:center;gap:6px}.sidebar-user-name{min-width:0;flex:1;text-align:left;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-user-email{min-width:0;text-align:left;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.studio-role-badge{flex-shrink:0;padding:2px 5px;border:1px solid transparent;border-radius:999px;font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap}.studio-role-badge--admin{color:#7027b4;background:#8f37e11c;border-color:#7d2cc93d}.studio-role-badge--developer{color:#976507;background:#fac70f2e;border-color:#ce9b0d4d}.studio-role-badge--user{color:#1b7e43;background:#25b15f1f;border-color:#2994543d}.sidebar.is-collapsed .sidebar-user-btn{width:36px;height:36px;justify-content:center;gap:0;padding:2px;overflow:hidden}.sidebar.is-collapsed .sidebar-user-identity{display:none}.sidebar.is-collapsed .sidebar-user-pop{left:8px;right:auto;width:220px}@media (prefers-reduced-motion: reduce){.sidebar{transition:none}}.sidebar-user-pop{position:absolute;bottom:calc(100% - 4px);top:auto;left:10px;right:10px}.skillcenter{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;padding:0}.skillcenter-regions{display:grid;padding:2px;border:1px solid hsl(var(--border));background:hsl(var(--canvas) / .62)}.skillcenter-regions button{border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.skillcenter-regions button.active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.skillcenter-regions button:focus-visible,.skillcenter-pager button:focus-visible,.skill-detail-close:focus-visible{outline:2px solid hsl(var(--ring) / .28);outline-offset:1px}.skillcenter-space-item:focus-visible,.skillcenter-skill-item:focus-visible{outline:none;border-color:transparent;background:hsl(var(--muted) / .62)}.skillcenter-regions{grid-template-columns:repeat(2,58px);border-radius:7px}.skillcenter-regions button{height:27px;border-radius:5px;font-size:11.5px}.skillcenter-browser{flex:1;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(270px,.9fr) minmax(360px,1.35fr);gap:0}.skillcenter-panel{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.skillcenter-panel+.skillcenter-panel{border-left:1px solid hsl(var(--border))}.skillcenter-panel-head{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.skillcenter-panel-head>div{min-width:0;display:flex;align-items:center;gap:8px}.skillcenter-panel-head .icon{width:17px;height:17px;color:hsl(var(--muted-foreground))}.skillcenter-panel-head h2{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:13.5px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.skillcenter-panel-head>span{flex-shrink:0;color:hsl(var(--muted-foreground));font-size:11.5px}.skillcenter-count-badge{min-width:25px;height:21px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:11px;font-weight:600;line-height:1}.skillcenter-listwrap{position:relative;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}.skillcenter-list{display:flex;flex-direction:column;gap:6px;padding:8px}.skillcenter-space-item,.skillcenter-skill-item{width:100%;min-width:0;display:flex;align-items:flex-start;gap:10px;padding:10px;border:1px solid transparent;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:background-color .12s ease,border-color .12s ease}.skillcenter-space-item:hover,.skillcenter-skill-item:hover,.skillcenter-space-item.active{border-color:transparent;background:hsl(var(--muted) / .62)}.skillcenter-symbol{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground) / .78)}.skillcenter-symbol .icon{width:18px;height:18px}.skillcenter-symbol--skill{color:#2764b4;background:#f2f7fd;border-color:#ccdbf0}.skillcenter-item-body{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}.skillcenter-item-title{min-width:0;overflow:hidden;font-size:13px;font-weight:600;line-height:18px;text-overflow:ellipsis;white-space:nowrap}.skillcenter-item-description{display:-webkit-box;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:17px;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skillcenter-item-meta{min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px;margin-top:2px}.skillcenter-status{flex-shrink:0;padding:2px 6px;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10.5px;line-height:16px}.skillcenter-status.is-positive{color:#1d7742;background:#e7f8ee}.skillcenter-status.is-progress{color:#8d5911;background:#fdf5e3}.skillcenter-status.is-danger{color:hsl(var(--destructive));background:hsl(var(--destructive) / .09)}.skillcenter-meta-text{min-width:0;max-width:170px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}.skillcenter-pager{height:44px;flex:0 0 44px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11.5px}.skillcenter-pager-actions{display:flex;align-items:center;gap:7px}.skillcenter-pager-actions>span{min-width:38px;text-align:center}.skillcenter-pager button,.skill-detail-close{display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.skillcenter-pager button{width:26px;height:26px;padding:0}.skillcenter-pager button:hover:not(:disabled),.skill-detail-close:hover{color:hsl(var(--foreground));background:hsl(var(--accent))}.skillcenter-pager button:disabled{opacity:.35;cursor:default}.skillcenter-pager button .icon{width:17px;height:17px}.skillcenter-empty,.skillcenter-loading,.skillcenter-error{min-height:130px;display:flex;align-items:center;justify-content:center;gap:8px;padding:24px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55;text-align:center;overflow-wrap:anywhere}.skillcenter-error{color:hsl(var(--destructive))}.skillcenter-loading--overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;min-height:0;background:hsl(var(--background) / .82);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.skillcenter-loading-mark{width:14px;height:14px;flex-shrink:0;border:1.5px solid hsl(var(--foreground) / .16);border-top-color:hsl(var(--foreground) / .62);border-radius:50%;animation:spin .8s linear infinite}.skill-detail-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;display:grid;place-items:center;padding:16px;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.skill-detail-dialog{width:min(760px,100%);height:min(760px,100%);min-height:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 18px 48px hsl(var(--foreground) / .16)}.skill-detail-head{flex-shrink:0;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 18px 14px;border-bottom:1px solid hsl(var(--border))}.skill-detail-heading{min-width:0;display:flex;align-items:flex-start;gap:11px}.skill-detail-heading>div{min-width:0}.skill-detail-heading h2{margin:1px 0 4px;overflow:hidden;font-size:16px;font-weight:650;line-height:22px;text-overflow:ellipsis;white-space:nowrap}.skill-detail-heading p{display:-webkit-box;margin:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:17px;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skill-detail-close{width:30px;height:30px;flex:0 0 30px;padding:0}.skill-detail-meta{flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 18px;margin:0;padding:14px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas) / .45)}.skill-detail-meta>div{min-width:0}.skill-detail-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:10.5px}.skill-detail-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;line-height:17px;text-overflow:ellipsis;white-space:nowrap}.skill-detail-content{flex:1;min-height:0;display:flex;flex-direction:column}.skill-detail-content-title{height:40px;flex:0 0 40px;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid hsl(var(--border));font-size:12px;font-weight:600}.skill-detail-content>.skillcenter-loading,.skill-detail-content>.skillcenter-error,.skill-detail-content>.skillcenter-empty{flex:1;min-height:0}.skill-detail-markdown{flex:1;min-height:0;overflow-y:auto;padding:18px 22px 28px;overflow-wrap:anywhere}@media (max-width: 760px){.skillcenter-browser{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr))}.skillcenter-panel+.skillcenter-panel{border-top:1px solid hsl(var(--border));border-left:0}.skill-detail-meta{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 560px){.skillcenter-regions{grid-template-columns:repeat(2,46px)}.skillcenter-browser{gap:8px}.skillcenter-item-meta{gap:4px 6px}.skillcenter-meta-text{max-width:132px}.skill-detail-backdrop{padding:8px}.skill-detail-dialog{border-radius:10px}.skill-detail-meta{grid-template-columns:minmax(0,1fr);gap:8px;max-height:180px;overflow-y:auto}}.addagent{flex:1;min-height:0;overflow-y:auto;display:flex;justify-content:center;align-items:flex-start;padding:8vh 16px 16px}.addagent-card{width:100%;max-width:480px}.addagent-title{margin:0 0 6px;font-size:20px;font-weight:650;letter-spacing:-.01em}.addagent-sub{margin:0 0 22px;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.addagent-field{display:block;margin-bottom:14px}.addagent-label{display:block;margin-bottom:6px;font-size:12.5px;font-weight:500;color:hsl(var(--muted-foreground))}.addagent-input{width:100%;border:1px solid hsl(var(--border));border-radius:10px;padding:10px 12px;font:inherit;font-size:14px;background:hsl(var(--background));color:hsl(var(--foreground))}.addagent-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.addagent-error{margin:4px 0 14px;padding:9px 12px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.addagent-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.addagent-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:14px;font-weight:500;cursor:pointer;transition:background .12s,opacity .12s}.addagent-btn--ghost{background:none;border-color:hsl(var(--border));color:hsl(var(--foreground))}.addagent-btn--ghost:hover{background:hsl(var(--foreground) / .05)}.addagent-btn--primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.addagent-btn--primary:hover:not(:disabled){opacity:.88}.addagent-btn:disabled{opacity:.4;cursor:default}.addagent-btn .icon{width:15px;height:15px}.search{flex:1;min-height:0;display:flex;flex-direction:column;width:100%;max-width:720px;margin:0 auto;padding:28px 16px 16px}.search-box{position:relative;display:flex;align-items:center;gap:0;padding:5px 6px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));transition:border-color .16s,box-shadow .16s}.search-box:focus-within{border-color:hsl(var(--foreground) / .3);box-shadow:0 0 0 3px hsl(var(--foreground) / .035)}.search-source-picker-wrap{position:relative;flex:0 0 auto}.search-source-picker{display:inline-flex;align-items:center;gap:5px;max-width:176px;height:34px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;cursor:pointer}.search-source-picker:hover,.search-source-picker[aria-expanded=true]{background:hsl(var(--foreground) / .045)}.search-source-picker>span{flex:0 0 auto;font-size:13px;font-weight:550}.search-source-picker>small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.search-source-chevron{width:12px;height:12px;flex:0 0 auto;color:hsl(var(--muted-foreground));transition:transform .15s ease}.search-source-chevron.open{transform:rotate(180deg)}.search-source-menu{position:absolute;z-index:30;top:calc(100% + 9px);left:-6px;display:flex;width:224px;padding:5px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .1);flex-direction:column}.search-source-menu>button{display:flex;min-width:0;padding:8px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;flex-direction:column;gap:2px}.search-source-menu>button:hover:not(:disabled),.search-source-menu>button[aria-selected=true]{background:hsl(var(--foreground) / .055)}.search-source-menu>button:disabled{color:hsl(var(--muted-foreground));cursor:default}.search-source-menu>button>span{font-size:12.5px;font-weight:550}.search-source-menu>button>small{overflow:hidden;max-width:100%;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.search-box-divider{width:1px;height:18px;margin:0 11px 0 5px;background:hsl(var(--border))}.search-input{flex:1;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px}.search-input::placeholder{color:hsl(var(--muted-foreground))}.search-input:disabled{cursor:default}.search-go{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.search-go:hover:not(:disabled){opacity:.85}.search-go:active:not(:disabled){transform:scale(.94)}.search-go:disabled{opacity:.3;cursor:default}.search-go .icon{width:17px;height:17px}.search-results{flex:1;min-height:0;overflow-y:auto;margin-top:12px;display:flex;flex-direction:column;gap:4px}.search-empty{padding:40px 8px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.search-result{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:12px 14px;border:none;border-radius:12px;background:none;color:hsl(var(--foreground));font:inherit;cursor:pointer;transition:background .12s}.search-result:hover{background:hsl(var(--foreground) / .05)}.search-result-static{cursor:default;border:1px solid transparent}.search-result-static:hover{border-color:hsl(var(--border));background:hsl(var(--foreground) / .025)}a.search-result{text-decoration:none;color:inherit}.search-result-ext{width:12px;height:12px;margin-left:4px;vertical-align:-1px;opacity:.6}.search-result-icon{width:16px;height:16px;flex-shrink:0;margin-top:2px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.search-result-body{min-width:0;flex:1}.search-result-head{display:flex;align-items:baseline;gap:10px;justify-content:space-between}.search-result-title{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-result-meta{flex-shrink:0;font-size:11.5px;color:hsl(var(--muted-foreground))}.search-result-snippet{margin-top:3px;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground));display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.search-result-snippet-expanded{-webkit-line-clamp:4;white-space:pre-wrap;overflow-wrap:anywhere}.login{position:fixed;top:10px;right:10px;bottom:10px;left:10px;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;display:flex;flex-direction:column;background:hsl(var(--panel));color:hsl(var(--foreground))}.login-top{padding:18px 24px}.login-brand{display:inline-flex;align-items:center;gap:9px;font-weight:600;font-size:15px;letter-spacing:-.01em}.login-main{flex:1;display:flex;align-items:center;justify-content:center;padding:0 24px}.login-card{width:100%;max-width:420px}.login-title{margin:0 0 14px;font-size:28px;font-weight:700;line-height:1.2;letter-spacing:-.02em}.login-sub{margin:0 0 28px;color:hsl(var(--muted-foreground));font-size:15px}.login-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:14px 18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer;transition:background .15s,border-color .15s,transform .1s}.login-btn:hover{background:hsl(var(--accent));border-color:hsl(var(--ring) / .3)}.login-btn:active{transform:scale(.99)}.login-btn .icon{width:18px;height:18px}.login-powered{margin:18px 0 0;font-size:12px;color:hsl(var(--muted-foreground))}.login-legal{margin:6px 0 0;font-size:12px;color:hsl(var(--muted-foreground))}.login-legal a{color:inherit;font-weight:600;text-decoration:underline;text-decoration-color:hsl(var(--muted-foreground) / .45);text-underline-offset:2px}.login-legal a:hover{color:hsl(var(--foreground))}.login-footer{padding:18px 24px;text-align:center;font-size:12px;color:hsl(var(--muted-foreground))}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}.login-providers{display:flex;flex-direction:column;gap:10px}.login-provider-error{display:flex;flex-direction:column;align-items:flex-start;gap:12px;color:hsl(var(--destructive));font-size:13px}.login-provider-error p{margin:0}.login-name{display:flex;align-items:center;gap:8px}.login-name-input{flex:1;border:1px solid hsl(var(--border));border-radius:14px;padding:13px 16px;font:inherit;font-size:15px;background:hsl(var(--background));color:hsl(var(--foreground))}.login-name-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.login-name-go{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s}.login-name-go .icon{width:18px;height:18px}.login-name-go:disabled{opacity:.35;cursor:default}.login-hint{margin:8px 0 0;min-height:16px;line-height:16px;font-size:12px;color:hsl(var(--destructive))}.session-loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .6);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.main{position:relative}.topo{position:absolute;top:68px;right:18px;width:220px;max-height:calc(100% - 150px);overflow-y:auto;padding:12px;background:hsl(var(--canvas));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 4px 16px #0000000a;z-index:2}.topo-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}.topo-head-title{font-size:12px;font-weight:650;letter-spacing:.02em}.topo-head-sub{font-size:11px;color:hsl(var(--muted-foreground))}.topo-tree{display:flex;flex-direction:column;gap:4px}.topo-children{display:flex;flex-direction:column;gap:4px;margin-top:4px;margin-left:10px;padding-left:8px;border-left:1px solid hsl(var(--border))}.topo-node{display:flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));font-size:12px;transition:border-color .15s ease,background .15s ease,opacity .15s ease}.topo-icon{width:14px;height:14px;flex-shrink:0;opacity:.8}.topo-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.topo-badge{flex-shrink:0;font-size:10px;padding:1px 5px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.topo-node.is-active{border-color:hsl(var(--primary));background:hsl(var(--primary) / .08);animation:topo-pulse 1.4s ease-in-out infinite}.topo-node.is-active .topo-icon{opacity:1}.topo-node.is-onpath{border-color:hsl(var(--primary) / .4);background:hsl(var(--primary) / .04)}.topo-node.is-done{opacity:.55}.topo-remote{margin:3px 0 2px 22px;font-size:10.5px;color:hsl(var(--primary));animation:topo-blink 1.2s ease-in-out infinite}@keyframes topo-blink{0%,to{opacity:1}50%{opacity:.45}}.topo-path{display:flex;flex-wrap:wrap;align-items:center;gap:1px;margin-bottom:9px;padding:6px 8px;border-radius:7px;background:hsl(var(--primary) / .05);font-size:11px;line-height:1.4}.topo-path-seg{display:inline-flex;align-items:center;min-width:0}.topo-path-sep{width:12px;height:12px;flex-shrink:0;color:hsl(var(--muted-foreground))}.topo-path-name{color:hsl(var(--muted-foreground))}.topo-path-name.is-current{color:hsl(var(--primary));font-weight:600}@keyframes topo-pulse{0%,to{box-shadow:0 0 hsl(var(--primary) / .28)}50%{box-shadow:0 0 0 4px hsl(var(--primary) / 0)}}@media (max-width: 1200px){.topo{display:none}}.quick-create{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.qc-head{text-align:center;margin-bottom:28px}.qc-title{margin:0;font-size:26px;font-weight:650;letter-spacing:-.02em}.qc-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.qc-cards{display:grid;grid-template-columns:repeat(4,220px);justify-content:center;gap:16px}@media (max-width: 1240px){.qc-cards{grid-template-columns:repeat(2,220px)}}@media (max-width: 560px){.qc-cards{grid-template-columns:minmax(0,320px)}}.qc-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:20px;text-align:left;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--card));cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s}.qc-card:hover{border-color:hsl(var(--ring) / .35);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.qc-card-arrow{position:absolute;top:18px;right:18px;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.qc-card:hover .qc-card-arrow{opacity:1;transform:translate(0)}.qc-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;margin-bottom:6px;border-radius:12px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.qc-icon svg{width:20px;height:20px}.qc-card-title{font-size:15px;font-weight:600}.qc-card-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.navbar-title{min-width:0;max-width:min(60vw,640px);overflow:hidden;padding:0;font-size:15px;font-weight:600;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.create-stub{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:hsl(var(--muted-foreground))}.create-back{align-self:flex-start;margin:12px;border:none;background:none;font:inherit;font-size:13px;color:hsl(var(--muted-foreground));cursor:pointer}.create-back:hover{color:hsl(var(--foreground))}.navbar-crumbs{display:flex;align-items:center;gap:4px;min-width:0}.navbar-crumbs>.crumb:first-child{padding-left:0}.crumb{font-size:15px;font-weight:600;letter-spacing:-.01em;padding:2px 4px;border-radius:6px;white-space:nowrap}.crumb-link{border:none;background:none;font:inherit;font-weight:500;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.crumb-link:hover{color:hsl(var(--foreground));background:hsl(var(--foreground) / .05)}.crumb-current{color:hsl(var(--foreground))}.crumb-sep{width:15px;height:15px;color:hsl(var(--muted-foreground));flex-shrink:0}.confirm-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;display:flex;align-items:center;justify-content:center;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.confirm-box{width:340px;max-width:calc(100vw - 32px);padding:20px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 16px 48px -16px hsl(var(--foreground) / .3)}.confirm-title{font-size:15px;font-weight:600;margin-bottom:6px}.confirm-text{font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground));margin-bottom:18px}.confirm-actions{display:flex;justify-content:flex-end;gap:8px}.confirm-btn{padding:7px 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s}.confirm-btn:hover{background:hsl(var(--foreground) / .05)}.confirm-btn--danger{border-color:transparent;background:hsl(var(--destructive));color:#fff}.confirm-btn--danger:hover{background:hsl(var(--destructive) / .9)} diff --git a/veadk/webui/assets/index-BXS3Zyyl.css b/veadk/webui/assets/index-BXS3Zyyl.css deleted file mode 100644 index 0dcb7a36..00000000 --- a/veadk/webui/assets/index-BXS3Zyyl.css +++ /dev/null @@ -1,10 +0,0 @@ -pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! - Theme: GitHub - Description: Light theme as seen on github.com - Author: github.com - Maintainer: @Hirse - Updated: 2021-05-15 - - Outdated base version: https://github.com/primer/github-syntax-light - Current colors taken from GitHub's CSS -*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.manage{max-width:760px;margin:0 auto;padding:28px 24px 16px;width:100%;overflow-y:auto}.manage-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}.manage-title{margin:0 0 4px;font-size:20px;font-weight:650;color:hsl(var(--foreground))}.manage-sub{margin:0;font-size:13px;color:hsl(var(--muted-foreground))}.manage-head-actions{display:flex;align-items:center;gap:8px}.manage-region-picker{position:relative}.manage-region{display:inline-flex;align-items:center;justify-content:space-between;gap:10px;min-width:88px;height:34px;padding:0 10px;font-size:13px;font-weight:550;color:hsl(var(--foreground));background:hsl(var(--card));border:1px solid hsl(var(--border));border-radius:var(--radius);cursor:pointer;transition:background .12s ease,border-color .12s ease,box-shadow .12s ease}.manage-region:hover,.manage-region[aria-expanded=true]{background:hsl(var(--foreground) / .04);border-color:hsl(var(--foreground) / .2)}.manage-region:focus-visible{outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 3px hsl(var(--ring) / .14)}.manage-region-chevron{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .16s ease}.manage-region-chevron.is-open{transform:rotate(180deg)}.manage-region-menu{position:absolute;top:calc(100% + 6px);right:0;z-index:31;width:128px;padding:6px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 12px 32px hsl(var(--foreground) / .14),0 2px 8px hsl(var(--foreground) / .06);animation:manage-region-pop .14s ease-out}.manage-region-option{display:flex;align-items:center;justify-content:space-between;width:100%;height:36px;padding:0 9px;border:0;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px;text-align:left;cursor:pointer;transition:background .1s ease}.manage-region-option:hover,.manage-region-option:focus-visible{outline:none;background:hsl(var(--foreground) / .06)}.manage-region-option.is-selected{font-weight:600;background:hsl(var(--foreground) / .04)}.manage-region-option svg{width:15px;height:15px;color:hsl(var(--primary))}@keyframes manage-region-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.manage-refresh{display:inline-flex;align-items:center;gap:6px;flex:none;padding:7px 12px;font-size:13px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--card));color:hsl(var(--foreground));cursor:pointer}.manage-refresh:hover:not(:disabled){background:hsl(var(--foreground) / .05)}.manage-refresh:disabled{opacity:.6;cursor:default}.manage-error{padding:10px 12px;margin-bottom:16px;font-size:13px;color:hsl(var(--destructive));background:hsl(var(--destructive) / .08);border:1px solid hsl(var(--destructive) / .3);border-radius:var(--radius)}.manage-empty{display:flex;align-items:center;gap:8px;padding:40px 0;justify-content:center;font-size:14px;color:hsl(var(--muted-foreground))}.manage-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.manage-item{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--card))}.manage-item-row{display:flex;align-items:center;gap:8px}.manage-item-actions{flex:none;display:flex;align-items:center;gap:6px}.manage-item-toggle{display:flex;align-items:center;gap:8px;flex:1;min-width:0;padding:0;border:0;background:transparent;cursor:pointer;color:inherit;text-align:left}.manage-item-toggle .icon{flex:none;color:hsl(var(--muted-foreground))}.manage-item-main{display:flex;align-items:center;gap:10px;min-width:0}.manage-item-name{font-size:15px;font-weight:600;color:hsl(var(--foreground));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.manage-badge{flex:none;padding:2px 8px;font-size:11px;font-weight:500;border-radius:999px;border:1px solid transparent}.manage-badge.is-ok{color:#15803d;background:#15803d1a;border-color:#15803d40}.manage-badge.is-warn{color:#b45309;background:#b453091a;border-color:#b4530940}.manage-badge.is-bad{color:hsl(var(--destructive));background:hsl(var(--destructive) / .1);border-color:hsl(var(--destructive) / .35)}.manage-badge.is-muted{color:hsl(var(--muted-foreground));background:hsl(var(--foreground) / .05);border-color:hsl(var(--border))}.manage-item-meta{display:flex;align-items:center;gap:6px;padding-left:24px;font-size:12px;color:hsl(var(--muted-foreground));min-width:0}.manage-item-id{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.manage-item-dot{opacity:.5}.manage-del{flex:none;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--card));color:hsl(var(--muted-foreground));cursor:pointer}.manage-connect{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--card));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:550;cursor:pointer;transition:background .12s,border-color .12s,color .12s}.manage-connect:hover:not(:disabled){border-color:hsl(var(--foreground) / .28);background:hsl(var(--foreground) / .05)}.manage-connect:disabled{color:hsl(var(--muted-foreground));background:hsl(var(--foreground) / .035);cursor:default}@media (max-width: 700px){.manage-item-row{flex-wrap:wrap}.manage-item-toggle{flex-basis:100%}.manage-item-actions{width:100%;justify-content:flex-end;padding-left:24px}}.manage-del:hover:not(:disabled){color:hsl(var(--destructive));border-color:hsl(var(--destructive) / .4);background:hsl(var(--destructive) / .06)}.manage-del:disabled{opacity:.6;cursor:default}.manage-detail{margin-top:8px;padding:12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background))}.manage-detail-loading{display:flex;align-items:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground))}.manage-detail-card{margin-bottom:12px}.manage-kv{margin:0;display:grid;gap:4px}.manage-kv-row{display:grid;grid-template-columns:96px 1fr;gap:8px;font-size:13px}.manage-kv-row dt{color:hsl(var(--muted-foreground))}.manage-kv-row dd{margin:0;color:hsl(var(--foreground));word-break:break-word}.manage-envs{margin-top:10px}.manage-envs-head,.manage-tree-head{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));margin-bottom:6px}.manage-tree-head{margin-top:4px}.manage-env{display:flex;gap:8px;font-size:12px;padding:2px 0}.manage-env-k{color:hsl(var(--muted-foreground));flex:none}.manage-env-v{color:hsl(var(--foreground));word-break:break-all}.manage-env-masked{padding:0;border:0;background:none;color:hsl(var(--muted-foreground));font:inherit;letter-spacing:2px;cursor:pointer;-webkit-user-select:none;user-select:none}.manage-tree-note{font-size:12px;color:hsl(var(--muted-foreground));padding:4px 0}.manage-tree{padding:3px 0}.manage-tree-node{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.manage-tree-name{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.manage-tree-type{font-size:10px;font-weight:600;padding:1px 6px;border-radius:999px;color:hsl(var(--primary));background:hsl(var(--primary) / .1);border:1px solid hsl(var(--primary) / .3)}.manage-tree-model{font-size:11px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.manage-tree-tools{display:flex;flex-wrap:wrap;gap:4px;margin:3px 0 0 2px}.manage-tree-tool{font-size:10px;padding:1px 6px;border-radius:4px;color:hsl(var(--muted-foreground));background:hsl(var(--foreground) / .05);border:1px solid hsl(var(--border))}.text-shimmer.text-shimmer{color:transparent;background-size:200% auto;background-position:200% center;background-clip:text;-webkit-background-clip:text;animation:text-shimmer 4s linear infinite}@keyframes text-shimmer{to{background-position:-200% center}}@media (prefers-reduced-motion: reduce){.text-shimmer.text-shimmer{animation:none;background-position:50% center}}.builtin-tool-head{--builtin-tool-accent: 215 18% 42%;display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:3px 7px 3px 3px;border:0;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;transition:color .12s ease}.builtin-tool-head[data-tool-tone=search]{--builtin-tool-accent: 211 62% 42%}.builtin-tool-head[data-tool-tone=image]{--builtin-tool-accent: 28 67% 42%}.builtin-tool-head[data-tool-tone=video]{--builtin-tool-accent: 260 38% 48%}.builtin-tool-head[data-tool-tone=memory]{--builtin-tool-accent: 174 52% 34%}.builtin-tool-head[data-tool-tone=knowledge]{--builtin-tool-accent: 225 48% 45%}.builtin-tool-head:hover{color:hsl(var(--foreground))}.builtin-tool-icon{position:relative;width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center;color:hsl(var(--builtin-tool-accent))}.builtin-tool-icon>svg{width:18px;height:18px}.builtin-tool-label{font-size:13.5px;font-weight:400;line-height:1.35}.builtin-tool-head.is-done .builtin-tool-label{color:hsl(var(--muted-foreground))}.builtin-tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.builtin-tool-chevron.is-open{transform:rotate(90deg)}.new-chat-mode{position:relative;align-self:flex-start}.new-chat-mode__trigger{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:2px 7px 2px 5px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer;transition:color .12s ease,background .12s ease}.composer--new-chat .new-chat-mode__trigger{min-height:36px;font-size:15px}.new-chat-mode__trigger:hover,.new-chat-mode__trigger[aria-expanded=true]{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-mode__current{max-width:min(180px,42vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__trigger:focus-visible,.new-chat-mode__option:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:1px}.new-chat-mode__icon,.new-chat-mode__option-icon{display:inline-grid;place-items:center;flex:0 0 auto}.new-chat-mode__icon svg{width:15px;height:15px}.new-chat-mode__option-icon svg{width:18px;height:18px}.new-chat-mode svg{fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}.new-chat-mode__skill-icon path:first-child{fill:currentColor;stroke:none}.new-chat-mode__chevron{width:12px;height:12px;transition:transform .14s ease}.new-chat-mode__trigger[aria-expanded=true] .new-chat-mode__chevron{transform:rotate(180deg)}.new-chat-mode__menu{position:absolute;z-index:42;top:calc(100% + 7px);right:0;width:286px;padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-mode__option{display:grid;grid-template-columns:24px minmax(0,1fr) 18px;align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.new-chat-mode__option.is-active{background:hsl(var(--accent))}.new-chat-mode__option:disabled{cursor:not-allowed;opacity:.48}.new-chat-mode__copy{display:flex;min-width:0;flex-direction:column;gap:2px}.new-chat-mode__copy>span:last-child{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.new-chat-mode__label{display:flex;align-items:center;gap:7px;font-size:13px;line-height:1.3}.new-chat-mode__beta{padding:1px 5px;border:1px solid hsl(var(--border));border-radius:999px;color:hsl(var(--muted-foreground));font-size:9px;font-weight:500;line-height:1.2}.new-chat-mode__check{width:16px;height:16px;color:hsl(var(--primary))}@media (prefers-reduced-motion: reduce){.new-chat-mode__trigger,.new-chat-mode__chevron{transition:none}}.stk{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.stk-head{text-align:center;margin-bottom:26px}.stk-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em}.stk-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.stk-list{display:flex;flex-direction:column;gap:12px;width:100%;max-width:520px}.stk-card{display:flex;align-items:center;gap:14px;width:100%;padding:18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));cursor:pointer;font:inherit;text-align:left;transition:border-color .15s,box-shadow .15s,background .12s}.stk-card:hover{border-color:hsl(var(--ring) / .35);background:hsl(var(--foreground) / .02);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.stk-card-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.stk-card-icon svg{width:21px;height:21px}.stk-card-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.stk-card-title{font-size:15px;font-weight:600}.stk-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.stk-card-arrow{flex-shrink:0;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.stk-card:hover .stk-card-arrow{opacity:1;transform:translate(0)}.stk-card-disabled{opacity:.5;cursor:not-allowed}.stk-card-disabled:hover{border-color:hsl(var(--border));background:hsl(var(--card));box-shadow:none}.stk-card-disabled .stk-card-arrow{display:none}.stk-footer{margin-top:18px;width:100%;max-width:520px;display:flex;justify-content:center}.stk-import{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border:1px dashed hsl(var(--border));border-radius:9px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.stk-import:hover{color:hsl(var(--foreground));border-color:hsl(var(--ring) / .4);background:hsl(var(--foreground) / .03)}.stk-import svg{width:15px;height:15px}.code-browser-trigger{min-height:26px;display:inline-flex;align-items:center;gap:5px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:color .12s ease,background-color .12s ease}.code-browser-trigger svg{width:13px;height:13px}.code-browser-trigger:hover{background:hsl(var(--foreground) / .04);color:hsl(var(--foreground))}.code-browser-trigger:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:1px}.code-browser-backdrop{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:code-browser-fade-in .14s ease-out}.code-browser-dialog{width:min(1040px,92vw);height:min(720px,84vh);min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .16);animation:code-browser-rise-in .18s cubic-bezier(.2,.8,.2,1)}.code-browser-head{flex:0 0 58px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 16px 0 18px;border-bottom:1px solid hsl(var(--border))}.code-browser-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.code-browser-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-title-icon svg,.code-browser-close svg{width:16px;height:16px}.code-browser-title-wrap h2,.code-browser-title-wrap p{margin:0}.code-browser-title-wrap h2{color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.code-browser-title-wrap p{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.code-browser-close{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.code-browser-close:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-workspace{flex:1;min-height:0;display:flex}.code-browser-sidebar{flex:0 0 220px;min-width:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .22)}.code-browser-sidebar-head,.code-browser-path{flex:0 0 38px;min-height:38px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.code-browser-sidebar-head{justify-content:space-between;padding:0 12px;color:hsl(var(--muted-foreground));font-size:11px;font-weight:650}.code-browser-sidebar-head span{font-variant-numeric:tabular-nums;font-weight:500}.code-browser-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.code-browser-file,.code-browser-folder{width:100%;min-height:30px;display:flex;align-items:center;gap:6px;padding-top:4px;padding-right:10px;padding-bottom:4px;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;text-align:left;cursor:pointer}.code-browser-file:hover,.code-browser-folder:hover{background:hsl(var(--foreground) / .045);color:hsl(var(--foreground))}.code-browser-file.is-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.code-browser-file svg,.code-browser-folder svg{width:14px;height:14px;flex:0 0 auto}.code-browser-folder>svg:first-child{width:12px;height:12px;transition:transform .12s ease}.code-browser-folder>svg:first-child.is-open{transform:rotate(90deg)}.code-browser-file span,.code-browser-folder span,.code-browser-path span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-browser-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.code-browser-path{gap:7px;padding:0 13px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px}.code-browser-path svg{width:13px;height:13px;flex:0 0 auto}.code-browser-editor{flex:1;min-height:0;overflow:hidden}.code-browser-editor>div,.code-browser-editor .cm-theme,.code-browser-editor .cm-editor{height:100%}.code-browser-editor .cm-scroller{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12.5px}.code-browser-empty{height:100%;display:grid;place-items:center;padding:20px;color:hsl(var(--muted-foreground));font-size:12px}@keyframes code-browser-fade-in{0%{opacity:0}to{opacity:1}}@keyframes code-browser-rise-in{0%{opacity:0;transform:translateY(8px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 720px){.code-browser-backdrop{padding:12px}.code-browser-dialog{width:100%;height:min(760px,92vh)}.code-browser-sidebar{flex-basis:168px}}@media (prefers-reduced-motion: reduce){.code-browser-backdrop,.code-browser-dialog{animation:none}}.pp-root{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.pp-toolbar{flex:0 0 auto;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:10px 24px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-toolbar-left,.pp-toolbar-actions,.pp-actions{display:flex;align-items:center}.pp-toolbar-left{min-width:0;gap:18px}.pp-toolbar-actions{flex:0 0 auto;gap:8px}.pp-toolbar-back{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer}.pp-toolbar-back:hover{color:hsl(var(--foreground))}.pp-toolbar-title{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-secondary,.pp-deploy{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border-radius:6px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.pp-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.pp-secondary:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--accent))}.pp-deploy{min-width:82px;border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-deploy:hover:not(:disabled){background:hsl(var(--primary) / .9)}.pp-deploy:disabled,.pp-secondary:disabled{opacity:.55;cursor:default}.pp-body{flex:1;min-height:0;min-width:0;display:flex}.pp-files-area{flex:1 1 auto;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.pp-sidebar{flex:0 0 218px;width:218px;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .24)}.pp-sidebar-head,.pp-main-head{flex:0 0 42px;min-height:42px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.pp-sidebar-head{gap:8px;padding:0 9px 0 14px}.pp-project-name{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:650;letter-spacing:.04em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.pp-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.pp-row{width:100%;min-height:29px;display:flex;align-items:center;gap:6px;padding:4px 8px;border:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.pp-row:hover{background:hsl(var(--foreground) / .045)}.pp-file.pp-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.pp-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-folder .pp-label{color:hsl(var(--muted-foreground))}.pp-ic{width:15px;height:15px;flex:0 0 auto}.pp-chevron{color:hsl(var(--muted-foreground));transition:transform .12s ease}.pp-chevron.pp-open{transform:rotate(90deg)}.pp-icon-btn{width:28px;height:28px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-icon-btn:hover:not(:disabled){background:hsl(var(--foreground) / .07);color:hsl(var(--foreground))}.pp-icon-btn:disabled{opacity:.45;cursor:default}.pp-danger:hover:not(:disabled){color:hsl(var(--destructive))}.pp-new-input{width:calc(100% - 16px);height:30px;margin:2px 8px 6px;padding:0 8px;border:1px solid hsl(var(--ring) / .55);border-radius:4px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.pp-empty,.pp-placeholder{width:100%;padding:28px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.pp-main{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.pp-main-head{gap:12px;padding:0 10px 0 14px;background:hsl(var(--background))}.pp-path{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-actions{gap:2px}.pp-content{flex:1;min-height:0;min-width:0;display:flex;overflow:hidden}.pp-codemirror,.pp-codemirror>div,.pp-codemirror .cm-editor{width:100%;height:100%;min-height:0}.pp-codemirror .cm-editor{overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground));font-size:12.5px}.pp-codemirror .cm-scroller{overflow:auto;overscroll-behavior:none;scroll-padding-block:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.58}.pp-codemirror .cm-content{padding:10px 0 0}.pp-codemirror .cm-line{padding:0 14px 0 8px}.pp-codemirror .cm-content>.cm-line:last-child:has(>br:only-child){display:none}.pp-codemirror .cm-gutters{border-right:1px solid hsl(var(--border) / .7);background:hsl(var(--secondary) / .2);color:hsl(var(--muted-foreground) / .65)}.pp-codemirror .cm-activeLine,.pp-codemirror .cm-activeLineGutter{background:hsl(var(--foreground) / .035)}.pp-codemirror .cm-focused{outline:none}.pp-editor-loading{height:100%;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12px}.pp-pre{flex:1;width:100%;height:100%;box-sizing:border-box;margin:0;padding:14px 16px 0;overflow:auto;background:hsl(var(--background));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px;font-style:normal;font-variant-ligatures:none;font-weight:400;line-height:1.58;-moz-tab-size:2;tab-size:2;white-space:pre}.pp-root.is-deploy .pp-body{display:grid;grid-template-columns:minmax(260px,3fr) minmax(520px,7fr)}.pp-root.is-deploy .pp-files-area{display:none}.pp-topology-pane{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-topology-head{flex:0 0 58px;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;border-bottom:1px solid hsl(var(--border))}.pp-topology-title{color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-topology-count{margin-top:2px;color:hsl(var(--muted-foreground));font-size:10.5px}.pp-topology-scroll{flex:1;min-height:0;overflow-y:auto;padding:12px 12px 16px}.pp-topology-tree{padding-bottom:12px}.pp-topology-branch{position:relative}.pp-topology-children{position:relative;display:flex;flex-direction:column;gap:2px;margin-top:2px}.pp-topology-children:before{content:"";position:absolute;top:0;bottom:6px;left:8px;width:1px;background:hsl(var(--border))}.pp-agent-node{position:relative;width:100%;min-height:49px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:7px 9px;border:1px solid transparent;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:default;transition:border-color .12s ease,background-color .12s ease}.pp-agent-node:hover,.pp-agent-node:focus-visible,.pp-agent-node.is-inspected{border-color:hsl(var(--primary) / .16);outline:none;background:hsl(var(--primary) / .04)}.pp-agent-node-icon,.pp-agent-inspector-icon{display:inline-flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground))}.pp-agent-node-icon{width:24px;height:24px;flex:0 0 24px}.pp-agent-node-icon svg,.pp-agent-inspector-icon svg{width:15px;height:15px}.pp-agent-node-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.pp-agent-node-name{overflow:hidden;color:hsl(var(--foreground));font-size:12.5px;font-weight:550;text-overflow:ellipsis;white-space:nowrap}.pp-agent-node-type{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.pp-agent-child-count{flex:0 0 auto;min-width:18px;padding:1px 5px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:9.5px;text-align:center}.pp-agent-inspector{padding:13px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .22)}.pp-agent-inspector-head{display:flex;align-items:center;gap:9px}.pp-agent-inspector-icon{width:28px;height:28px;flex:0 0 28px;border-radius:7px;background:hsl(var(--background))}.pp-agent-inspector-head>div{min-width:0;display:flex;flex-direction:column;gap:1px}.pp-agent-inspector-head strong{overflow:hidden;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-agent-inspector-head span,.pp-agent-inspector p{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-agent-inspector p{margin:10px 0 0;line-height:1.5}.pp-agent-config-grid{display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 12px;margin:12px 0 0;padding-top:11px;border-top:1px solid hsl(var(--border) / .72);font-size:10.5px}.pp-agent-config-grid dt{color:hsl(var(--muted-foreground))}.pp-agent-config-grid dd{min-width:0;margin:0;overflow-wrap:anywhere;color:hsl(var(--foreground));text-align:right}.pp-topology-actions{flex:0 0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px 12px;border-top:1px solid hsl(var(--border))}.pp-topology-actions .pp-secondary{width:100%;padding-inline:8px}.pp-config{min-width:0;width:auto;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.pp-config-head{flex:0 0 58px;height:58px;box-sizing:border-box;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid hsl(var(--border))}.pp-config-title{color:hsl(var(--foreground));font-size:17px;font-weight:650;letter-spacing:-.01em}.pp-env-sub{margin-top:4px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.pp-config-scroll{flex:1;min-height:0;overflow-y:auto}.pp-config-actions{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:6px;padding:10px 14px;border-top:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-config-actions .pp-deploy{min-width:108px}.pp-config-section{padding:16px 18px 18px}.pp-config-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650;letter-spacing:-.01em}.pp-config-select,.pp-channel-fields input,.pp-network-fields input,.pp-env-row input{width:100%;min-width:0;height:34px;box-sizing:border-box;padding:0 10px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;transition:border-color .12s ease,box-shadow .12s ease}.pp-config-select:focus,.pp-channel-fields input:focus,.pp-network-fields input:focus,.pp-env-row input:focus{border-color:hsl(var(--ring) / .55);box-shadow:0 0 0 2px hsl(var(--ring) / .08)}.pp-config-select:disabled,.pp-channel-fields input:disabled,.pp-network-fields input:disabled,.pp-env-row input:disabled{opacity:.55}.pp-channel{width:auto;display:inline-flex;align-items:center;justify-content:flex-start;gap:10px;padding:2px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.pp-channel:disabled{cursor:default}.pp-channel-title{color:hsl(var(--foreground));font-size:13px;font-weight:560}.pp-switch{position:relative;flex:0 0 34px;width:34px;height:19px;border-radius:999px;background:hsl(var(--foreground) / .16);transition:background-color .15s ease}.pp-switch span{position:absolute;top:3px;left:3px;width:13px;height:13px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .18);transition:transform .15s ease}.pp-channel.is-on .pp-switch{background:hsl(var(--primary))}.pp-channel.is-on .pp-switch span{transform:translate(15px)}.pp-channel-fields{display:flex;flex-direction:column;gap:12px;margin-top:14px}.pp-channel-fields label{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-channel-fields label>span{color:hsl(var(--foreground));font-weight:560}.pp-channel-fields small{margin-left:5px;color:hsl(var(--destructive));font-size:10px;font-weight:500}.pp-channel-fields code{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-channel-fields input{grid-column:1 / -1}.pp-network-modes{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;padding:3px;border:1px solid hsl(var(--border) / .8);border-radius:6px;background:hsl(var(--secondary) / .42)}.pp-network-modes button{min-height:29px;padding:0 7px;border:0;border-radius:4px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer}.pp-network-modes button.is-on{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .08)}.pp-network-modes button:disabled{cursor:default}.pp-network-fields{display:flex;flex-direction:column;gap:12px;margin-top:14px}.pp-network-fields label:not(.pp-network-check){display:flex;flex-direction:column;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-network-fields small{font-size:10.5px;font-weight:400}.pp-network-check{display:flex;align-items:center;gap:8px;color:hsl(var(--foreground));font-size:12.5px;cursor:pointer}.pp-network-check input{width:14px;height:14px;margin:0}.pp-env-section{padding-bottom:16px}.pp-env-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.pp-env-head .pp-config-label{display:flex;align-items:center;gap:7px;margin-bottom:0}.pp-env-count{display:inline-flex;align-items:center}.pp-env-table{display:flex;flex-direction:column;margin-top:10px}.pp-env-group{padding:4px 7px 0;border:1px solid hsl(var(--border) / .75);border-radius:6px;background:hsl(var(--secondary) / .16)}.pp-env-group-head{display:flex;align-items:center;justify-content:space-between;padding:5px 1px 3px;color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.pp-env-group-head small{color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:450}.pp-env-group-head-custom{margin-top:12px}.pp-env-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px;align-items:center;gap:7px;padding:7px 0;border-bottom:1px solid hsl(var(--border) / .65)}.pp-env-row input:first-child{font-family:inherit;font-size:13px}.pp-env-row-derived:last-child{border-bottom:0}.pp-env-key-fixed{background:hsl(var(--secondary) / .32)!important;cursor:default}.pp-env-source{color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.pp-env-remove{width:28px;height:28px}.pp-env-add{width:100%;min-height:52px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer}.pp-env-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025);color:hsl(var(--foreground))}.pp-env-add:disabled{opacity:.5}.pp-steps{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none}.pp-step{position:relative;min-height:34px;display:flex;align-items:flex-start;gap:9px}.pp-step:not(:last-child):after{content:"";position:absolute;top:20px;bottom:-2px;left:9px;width:1px;background:hsl(var(--border))}.pp-step-dot{z-index:1;width:19px;height:19px;flex:0 0 19px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10px}.pp-step-body{min-width:0;display:flex;flex-direction:column;padding-top:1px}.pp-step-label{color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560}.pp-step-msg{max-width:300px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-step.is-active .pp-step-dot{border-color:hsl(var(--primary));color:hsl(var(--primary))}.pp-step.is-done .pp-step-dot{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-step.is-failed .pp-step-dot{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.pp-error{margin:14px 18px;padding:10px 11px;border:1px solid hsl(var(--destructive) / .22);border-radius:5px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.pp-deploy-result{margin:14px 18px 18px;padding:14px;border:1px solid hsl(var(--primary) / .2);border-radius:6px;background:hsl(var(--primary) / .035)}.pp-deploy-result-header{margin-bottom:12px;color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-deploy-result-body{display:flex;flex-direction:column;gap:10px}.pp-deploy-result-field{display:flex;flex-direction:column;gap:4px}.pp-deploy-result-field label{color:hsl(var(--muted-foreground));font-size:12.5px}.pp-deploy-result-field code{overflow-wrap:anywhere;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px}.pp-deploy-result-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.pp-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;min-height:0}.pp-confirm-head{flex-basis:60px}.pp-confirm-icon{background:#f59f0a1f;color:#ba6708}.pp-confirm-body{padding:24px 20px}.pp-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.pp-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.pp-confirm-actions button{min-width:76px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.pp-confirm-actions button:hover{background:hsl(var(--secondary))}.pp-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.pp-confirm-actions .is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-confirm-actions .is-primary:hover{background:hsl(var(--primary) / .9)}.pp-deploy-result-btn,.pp-console-link-btn{min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border-radius:5px;font-size:12.5px;font-weight:600;text-decoration:none;cursor:pointer}.pp-deploy-result-btn{border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-console-link-btn{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.spin{animation:pp-spin .85s linear infinite}@keyframes pp-spin{to{transform:rotate(360deg)}}@media (max-width: 1120px){.pp-root.is-deploy .pp-body{grid-template-columns:minmax(235px,3fr) minmax(470px,7fr)}.pp-sidebar{flex-basis:190px;width:190px}}@media (max-width: 860px){.pp-toolbar{align-items:flex-start;flex-direction:column;gap:8px}.pp-toolbar-actions{width:100%}.pp-body{overflow-y:auto;flex-direction:column}.pp-root.is-deploy .pp-body{display:flex}.pp-topology-pane{flex:0 0 auto;min-height:420px;border-right:0;border-bottom:1px solid hsl(var(--border))}.pp-files-area{min-height:520px}.pp-config{width:100%;min-height:520px;border-top:1px solid hsl(var(--border));border-left:0}}.ic-root{display:flex;flex-direction:column;height:100%;min-height:0}.ic-body{flex:1;min-height:0;display:flex}.ic-chat{flex:0 0 380px;width:380px;min-width:0;display:flex;flex-direction:column;min-height:0;border-right:1px solid hsl(var(--border))}.ic-transcript{flex:1;min-height:0;overflow-y:auto;padding:24px 20px 12px}.ic-turn{display:flex;gap:10px;max-width:760px;margin:0 auto 16px}.ic-turn:last-child{margin-bottom:0}.ic-turn--assistant{justify-content:flex-start}.ic-turn--user{justify-content:flex-end}.ic-avatar{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:hsl(var(--secondary));color:#7c48f4}.ic-avatar-icon{width:17px;height:17px}.ic-bubble{max-width:78%;padding:11px 15px;border-radius:16px;font-size:14px;line-height:1.6;word-break:break-word}.ic-turn--user .ic-bubble{white-space:pre-wrap}.ic-turn--assistant .ic-bubble{background:hsl(var(--secondary));color:hsl(var(--foreground));border-top-left-radius:5px}.ic-turn--user .ic-bubble{background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-top-right-radius:5px}.ic-bubble .md>:first-child{margin-top:0}.ic-bubble .md>:last-child{margin-bottom:0}.ic-bubble--typing{display:inline-flex;align-items:center;gap:4px;padding:14px 16px}.ic-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground));animation:ic-bounce 1.2s ease-in-out infinite}.ic-dot:nth-child(2){animation-delay:.16s}.ic-dot:nth-child(3){animation-delay:.32s}@keyframes ic-bounce{0%,60%,to{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.ic-error{flex-shrink:0;display:flex;align-items:center;gap:8px;max-width:760px;width:100%;margin:0 auto;padding:9px 14px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px;line-height:1.45}.ic-error-icon{width:15px;height:15px;flex-shrink:0}.ic-composer{flex-shrink:0;max-width:760px;width:100%;margin:0 auto;padding:8px 20px 18px}.ic-composer-box{display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 12px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background));transition:border-color .15s,box-shadow .15s}.ic-composer-box:focus-within{border-color:hsl(var(--ring) / .4);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.ic-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 2px;max-height:160px;overflow-y:auto}.ic-input::placeholder{color:hsl(var(--muted-foreground))}.ic-input:disabled{opacity:.6}.ic-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.ic-send-icon{width:17px;height:17px}.ic-send:hover:not(:disabled){opacity:.85}.ic-send:active:not(:disabled){transform:scale(.94)}.ic-send:disabled{opacity:.3;cursor:default}.ic-composer-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.ic-composer-hint{flex:1;text-align:center;font-size:11px;color:hsl(var(--muted-foreground))}.ic-ab-toggle{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;cursor:pointer;-webkit-user-select:none;user-select:none}.ic-ab-checkbox{position:absolute;opacity:0;width:0;height:0}.ic-ab-track{position:relative;display:inline-block;width:30px;height:17px;border-radius:999px;background:hsl(var(--muted-foreground) / .35);transition:background .15s}.ic-ab-thumb{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0003;transition:transform .15s}.ic-ab-checkbox:checked+.ic-ab-track{background:hsl(var(--primary))}.ic-ab-checkbox:checked+.ic-ab-track .ic-ab-thumb{transform:translate(13px)}.ic-ab-checkbox:disabled+.ic-ab-track{opacity:.5}.ic-ab-checkbox:focus-visible+.ic-ab-track{box-shadow:0 0 0 3px hsl(var(--ring) / .25)}.ic-ab-label{font-size:12px;font-weight:600;color:hsl(var(--foreground))}.ic-compare{flex:1;min-height:0;display:flex}.ic-compare-divider{flex:0 0 1px;background:hsl(var(--border))}.ic-pane{flex:1 1 0;min-width:0;min-height:0;display:flex;flex-direction:column}.ic-pane-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background))}.ic-pane-title{display:flex;align-items:center;gap:8px;min-width:0}.ic-pane-tag{flex-shrink:0;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;color:#fff}.ic-pane-tag--a{background:#7c48f4}.ic-pane-tag--b{background:#0da2e7}.ic-pane-model{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ic-adopt{flex-shrink:0;padding:6px 12px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font-size:12px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.ic-adopt:hover:not(:disabled){opacity:.85}.ic-adopt:active:not(:disabled){transform:scale(.96)}.ic-adopt:disabled{opacity:.4;cursor:default}.ic-pane-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.ic-pane-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-size:13px;color:hsl(var(--muted-foreground))}.ic-pane-spinner{width:22px;height:22px;color:#7c48f4;animation:ic-spin .9s linear infinite}@keyframes ic-spin{to{transform:rotate(360deg)}}.ic-pane-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.ic-preview{flex:1 1 0;min-width:0;display:flex;flex-direction:column;min-height:0;background:hsl(var(--muted) / .35)}.ic-preview-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px;text-align:center}.ic-preview-empty-icon{position:relative;display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:18px;background:#7c48f414;color:#7c48f4;margin-bottom:4px}.ic-preview-empty-glyph{width:30px;height:30px}.ic-preview-empty-spark{position:absolute;top:9px;right:9px;width:14px;height:14px}.ic-preview-empty-title{font-size:15px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.ic-preview-empty-sub{font-size:13px;line-height:1.55;color:hsl(var(--muted-foreground));max-width:240px}@media (max-width: 920px){.ic-body{flex-direction:column}.ic-preview{width:100%;border-left:none;border-top:1px solid hsl(var(--border));min-height:320px}}.cw-root{--cw-workbench-toolbar-height: 64px;flex:1;min-height:0;display:flex;flex-direction:column;height:100%;color:hsl(var(--foreground))}.cw-editor{flex:1;min-height:0;display:flex;align-items:stretch}.cw-tree{flex-shrink:0;width:248px;overflow-y:auto;padding:16px 14px;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.cw-tree-head{font-size:12px;font-weight:650;letter-spacing:.02em;color:hsl(var(--muted-foreground));padding:0 6px;margin-bottom:10px}.cw-tree-branch{display:flex;flex-direction:column}.cw-tree-node{position:relative;display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:8px;cursor:pointer;font-size:13px;border:1px solid transparent;transition:background .12s ease,border-color .12s ease}.cw-tree-node:hover{background:hsl(var(--accent))}.cw-tree-node.is-selected{background:hsl(var(--primary) / .04);border-color:hsl(var(--primary) / .16)}.cw-tree-node.is-invalid{background:hsl(var(--destructive) / .07);border-color:hsl(var(--destructive) / .5)}.cw-tree-node.is-invalid.is-selected{background:hsl(var(--destructive) / .1);border-color:hsl(var(--destructive) / .6)}.cw-tree-node.is-draggable{cursor:grab}.cw-tree-node.is-draggable:active{cursor:grabbing}.cw-tree-node.is-dragover{background:hsl(var(--primary) / .1);border-color:hsl(var(--primary) / .45)}.cw-tree-icon{width:15px;height:15px;flex-shrink:0;opacity:.8}.cw-tree-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.cw-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.cw-tree-type{font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:hsl(var(--muted-foreground))}.cw-tree-actions{display:flex;align-items:center;gap:1px;flex-shrink:0;opacity:0;pointer-events:none;transition:opacity .12s ease}.cw-tree-node:hover .cw-tree-actions,.cw-tree-node.is-selected .cw-tree-actions{opacity:1;pointer-events:auto}.cw-tree-children{display:flex;flex-direction:column;gap:2px;margin-top:2px;margin-left:8px;padding-left:8px;border-left:1px solid hsl(var(--border))}.cw-detail{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-typebar{position:relative;z-index:5;flex-shrink:0;height:var(--cw-workbench-toolbar-height);background:hsl(var(--panel));border-bottom:1px solid hsl(var(--border));padding:10px 16px}.cw-typebar-inner{height:100%;display:flex;align-items:center;max-width:1080px;margin:0 auto}.cw-detail-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;padding:24px 16px 48px}.cw-detail-inner{max-width:780px;margin:0 auto}.cw-lower{display:flex;gap:8px;align-items:flex-start}.cw-detail .cw-form-col{flex:1;min-width:0;max-width:720px;margin:0}.cw-debug{flex-shrink:0;width:380px;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid hsl(var(--border));background:hsl(var(--panel));transition:width .22s cubic-bezier(.22,1,.36,1),min-width .22s cubic-bezier(.22,1,.36,1),height .22s cubic-bezier(.22,1,.36,1),min-height .22s cubic-bezier(.22,1,.36,1),flex-basis .22s cubic-bezier(.22,1,.36,1),padding .18s ease}.cw-debug:not(.is-collapsed)>*{animation:cw-debug-content-in .18s ease-out both}.cw-debug.is-collapsed .cw-debug-expand{animation:cw-debug-control-in .18s .06s ease-out both}@keyframes cw-debug-content-in{0%{opacity:0;transform:scale(.985)}}@keyframes cw-debug-control-in{0%{opacity:0;transform:scale(.9)}}@media (prefers-reduced-motion: reduce){.cw-debug{transition:none}.cw-debug:not(.is-collapsed)>*,.cw-debug.is-collapsed .cw-debug-expand{animation:none}}.cw-debug-head{flex-shrink:0;height:var(--cw-workbench-toolbar-height);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid hsl(var(--border))}.cw-debug-head-actions{display:flex;align-items:center;gap:6px}.cw-debug-collapse,.cw-debug-expand{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s,background .12s,transform .12s}.cw-debug-collapse{width:24px;height:24px}.cw-debug-collapse:hover,.cw-debug-expand:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.cw-debug-expand:hover{transform:scale(1.06)}.cw-debug.is-collapsed{width:48px;min-width:48px;height:100%;min-height:0;align-items:center;padding-top:14px}.cw-debug-expand{width:34px;height:34px;min-height:34px}.cw-debug-title{display:inline-flex;align-items:center;gap:7px;font-size:17px;font-weight:650;color:hsl(var(--foreground))}.cw-debug-deploy,.cw-debug-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:6px 10px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:opacity .12s,transform .1s}.cw-debug-deploy{gap:4px;font-size:13px}.cw-debug-deploy .cw-i{width:13px;height:13px;transition:transform .18s ease}.cw-debug-deploy:hover:not(:disabled) .cw-i:not(.cw-spin){transform:translate(2px)}@media (prefers-reduced-motion: reduce){.cw-debug-deploy .cw-i{transition:none}.cw-debug-deploy:hover:not(:disabled) .cw-i:not(.cw-spin){transform:none}}.cw-debug-deploy:hover:not(:disabled),.cw-debug-start:hover:not(:disabled){opacity:.86}.cw-debug-deploy:active:not(:disabled),.cw-debug-start:active:not(:disabled){transform:scale(.96)}.cw-debug-deploy:disabled,.cw-debug-start:disabled{opacity:.45;cursor:default}.cw-debug-sub{flex-shrink:0;display:flex;flex-direction:column;gap:3px;padding:10px 16px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.cw-debug-deploy-error{margin:0 16px 12px;padding:8px 10px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px;line-height:1.45}.cw-debug-stage{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.cw-debug-body{flex:1;min-height:0;overflow-y:auto;padding:10px 16px 18px}.cw-debug-empty{min-height:120px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:14px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-start{color:hsl(var(--primary-foreground))}.cw-debug-run-icon{width:17px;height:17px;transition:transform .16s cubic-bezier(.22,1,.36,1)}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:translate(1.5px)}@media (prefers-reduced-motion: reduce){.cw-debug-run-icon{transition:none}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:none}}.cw-debug-progress{display:flex;flex-direction:column;gap:8px}.cw-debug-logline{display:flex;align-items:center;gap:8px;min-height:28px;padding:7px 9px;border-radius:9px;background:hsl(var(--foreground) / .04);color:hsl(var(--muted-foreground));font-size:12.5px}.cw-debug-logline .cw-i{color:hsl(var(--foreground))}.cw-debug-error{display:flex;flex-direction:column;gap:12px;color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-debug-error-detail,.cw-debug-msg-error{width:100%;min-width:0;color:hsl(var(--destructive));text-align:left}.cw-debug-error-detail .deploy-error-message-text,.cw-debug-msg-error .deploy-error-message-text{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px}.cw-debug-chat{min-height:100%;display:flex;flex-direction:column;gap:18px}.cw-debug-chat-empty{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-msg{display:flex;flex-direction:column;gap:6px;max-width:100%}.cw-debug-msg-user{align-items:flex-end}.cw-debug-msg-assistant{align-items:flex-start}.cw-debug-role{display:none}.cw-debug-content{max-width:100%;color:hsl(var(--foreground));font-size:14px;line-height:1.65;word-break:break-word}.cw-debug-msg-user .cw-debug-content{max-width:88%;padding:9px 14px;border-radius:18px;background:hsl(var(--secondary))}.cw-debug-msg-assistant .cw-debug-content{width:100%}.cw-debug-composer{flex-shrink:0;padding:10px 14px 14px;background:hsl(var(--panel))}.cw-debug-composerbox{display:flex;align-items:center;gap:6px;padding:6px 6px 6px 10px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background))}.cw-debug-input{flex:1;min-width:0;max-height:120px;padding:8px 4px;border:none;outline:none;resize:none;overflow-y:auto;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.5}.cw-debug-input::placeholder{color:hsl(var(--muted-foreground))}.cw-debug-send{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:50%;cursor:pointer;transition:opacity .15s,transform .1s,background .12s,color .12s}.cw-debug-send{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-debug-send:hover:not(:disabled){opacity:.85}.cw-debug-send:active:not(:disabled){transform:scale(.94)}.cw-debug-send:disabled{opacity:.3;cursor:default}.cw-debug-overlay{position:absolute;z-index:5;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:22px;background:hsl(var(--panel) / .5);backdrop-filter:blur(9px) saturate(.9);-webkit-backdrop-filter:blur(9px) saturate(.9)}.cw-debug-overlay-content{width:min(100%,290px);display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px;border:1px solid hsl(var(--border) / .72);border-radius:12px;background:hsl(var(--background) / .82);box-shadow:0 10px 30px hsl(var(--foreground) / .08);text-align:center}.cw-debug-overlay-title{color:hsl(var(--foreground));font-size:14px;font-weight:650}.cw-debug-overlay-copy{color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55}.cw-debug-overlay-progress{width:100%;display:flex;flex-direction:column;gap:8px}.cw-debug-overlay-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:2px}.cw-debug-ignore{min-height:30px;padding:6px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background) / .72);color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s,transform .1s}.cw-debug-ignore:hover:not(:disabled){border-color:hsl(var(--foreground) / .2);background:hsl(var(--background))}.cw-debug-ignore:active:not(:disabled){transform:scale(.96)}.cw-debug-ignore:disabled{opacity:.45;cursor:default}.cw-header{flex-shrink:0;display:flex;align-items:flex-start;gap:16px;padding:18px 24px 16px;border-bottom:1px solid hsl(var(--border))}.cw-header-title{flex:1;min-width:0}.cw-header-mode{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:hsl(var(--muted-foreground))}.cw-title{margin:5px 0 2px;font-size:21px;font-weight:650;letter-spacing:-.02em}.cw-subtitle{margin:0;font-size:13px;color:hsl(var(--muted-foreground))}.cw-progress-pill{flex-shrink:0;margin-top:2px;padding:5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}.cw-body{flex:1;min-height:0;overflow-y:auto}.cw-center{display:flex;align-items:flex-start;justify-content:center;gap:32px;max-width:960px;margin:0 auto;padding:32px 24px 80px}.cw-form-col{flex:1 1 auto;min-width:0;max-width:640px;display:flex;flex-direction:column;gap:44px}.cw-section{scroll-margin-top:24px}.cw-sec-head{margin-bottom:18px}.cw-sec-title{display:flex;align-items:center;gap:8px;margin:0 0 4px;font-size:17px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.cw-sec-required{padding:1px 7px;border-radius:999px;background:hsl(var(--foreground) / .08);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600;letter-spacing:.02em}.cw-sec-hint{margin:0;font-size:13px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-rail{position:sticky;top:12px;align-self:flex-start;flex-shrink:0;width:32px;margin-left:auto;padding:0;z-index:4}.cw-steps{position:relative;list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.cw-rail-track{position:absolute;left:15px;top:18px;bottom:18px;width:2px;border-radius:2px;background:hsl(var(--border));z-index:0}.cw-rail-fill{position:absolute;left:0;top:0;width:100%;border-radius:2px;background:hsl(var(--foreground) / .55)}.cw-step{position:relative;display:flex;align-items:center;justify-content:center;width:32px;min-height:36px;padding:0;border:none;border-radius:9px;background:none;text-align:left;cursor:pointer;font:inherit;transition:background .12s}.cw-step:hover{background:hsl(var(--foreground) / .05)}.cw-step.is-active{background:hsl(var(--foreground) / .06)}.cw-step:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-step-marker{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:32px;height:36px}.cw-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--foreground) / .25);transition:background .15s,width .15s,height .15s}.cw-step.is-active .cw-dot{width:10px;height:10px;background:hsl(var(--foreground));box-shadow:0 0 0 3px hsl(var(--panel))}.cw-step-check{width:14px;height:14px;padding:1px;border-radius:50%;background:hsl(var(--panel));color:hsl(var(--foreground) / .68)}.cw-step-tooltip{position:absolute;z-index:5;top:50%;right:calc(100% + 8px);padding:5px 8px;border-radius:6px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 4px 12px hsl(var(--foreground) / .12);font-size:11.5px;font-weight:550;white-space:nowrap;opacity:0;pointer-events:none;transform:translate(4px,-50%);transition:opacity .12s,transform .12s}.cw-step:hover .cw-step-tooltip,.cw-step:focus-visible .cw-step-tooltip{opacity:1;transform:translateY(-50%)}.cw-form{display:flex;flex-direction:column;gap:20px}.cw-section-desc{margin:0;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.cw-field{display:flex;flex-direction:column;gap:7px}.cw-more-options{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;margin-top:-4px;padding:4px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer;transition:color .14s ease}.cw-more-options:hover,.cw-more-options:focus-visible{color:hsl(var(--foreground))}.cw-more-options:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:3px;border-radius:4px}.cw-more-options-chevron{width:14px;height:14px;transition:transform .18s ease}.cw-more-options-chevron.is-open{transform:rotate(90deg)}.cw-more-options-count{margin-left:2px;padding:2px 7px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:10.5px;font-weight:600}.cw-model-advanced{display:flex;flex-direction:column;gap:20px;overflow:hidden}.cw-label{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-req{margin-left:2px;color:hsl(var(--destructive))}.cw-help{font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-remote-center-head{display:flex;flex-direction:column;gap:6px}.cw-remote-center-description{display:block;max-width:560px;margin:0;line-height:1.6}.cw-a2a-space-picker{display:flex;flex-direction:column;gap:8px}.cw-a2a-space-row{display:flex;align-items:center;gap:8px}.cw-a2a-space-select-wrap{position:relative;flex:1;min-width:0}.cw-a2a-space-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:34px;min-height:34px;gap:8px;padding:0 8px 0 10px;border:0;border-radius:6px;background-color:hsl(var(--muted) / .38);color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;letter-spacing:0}.cw-a2a-space-trigger[aria-expanded=true]{border-bottom-right-radius:0;border-bottom-left-radius:0;background-color:hsl(var(--background));filter:drop-shadow(0 2px 2px hsl(var(--foreground) / .2))}.cw-a2a-space-trigger:disabled{cursor:not-allowed;opacity:.5}.cw-a2a-space-trigger.is-error{box-shadow:0 0 0 1px hsl(var(--destructive) / .55)}.cw-a2a-space-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-trigger-icon{width:14px;height:14px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .14s ease}.cw-a2a-space-trigger[aria-expanded=true] .cw-a2a-space-trigger-icon{transform:rotate(90deg)}.cw-a2a-space-menu{position:absolute;z-index:30;top:100%;left:0;width:100%;max-height:238px;overflow-y:auto;padding:0;border-bottom-right-radius:6px;border-bottom-left-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));filter:drop-shadow(0 2px 2px hsl(var(--foreground) / .2));font-size:12px}.cw-a2a-space-option{display:flex;align-items:center;width:100%;min-height:32px;padding:8px;border:0;background:transparent;color:hsl(var(--foreground));cursor:default;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left}.cw-a2a-space-option:hover,.cw-a2a-space-option:focus-visible{outline:none;background:hsl(var(--muted) / .55)}.cw-a2a-space-option.is-selected{background:hsl(var(--muted) / .55);color:hsl(var(--foreground))}.cw-a2a-space-option:last-child{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.cw-a2a-space-refresh{flex-shrink:0;width:34px;height:34px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--muted) / .38);color:hsl(var(--foreground))}.cw-a2a-space-status{display:inline-flex;align-items:center;gap:6px}.cw-a2a-space-error{align-items:flex-start;padding:9px 11px;font-size:12.5px}.cw-error-text{font-size:12px;color:hsl(var(--destructive))}.cw-env-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:12px;margin-top:5px}.cw-env-field{display:flex;min-width:0;flex-direction:column;gap:6px}.cw-env-field-head{display:grid;min-width:0;gap:3px;color:hsl(var(--foreground));font-size:12px;font-weight:560}.cw-env-field-label{min-width:0;line-height:1.4;overflow-wrap:anywhere}.cw-env-field-head code{display:block;max-width:100%;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.cw-env-empty{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12px}.cw-input{min-width:0;width:100%;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .12s,box-shadow .12s}.cw-input::placeholder{color:hsl(var(--muted-foreground))}.cw-input:focus{outline:none;border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-input.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-textarea{width:100%;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.6;resize:vertical;transition:border-color .12s,box-shadow .12s}.cw-textarea::placeholder{color:hsl(var(--muted-foreground))}.cw-textarea:focus{outline:none;border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-textarea.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}@keyframes cw-error-shake-a{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}@keyframes cw-error-shake-b{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}.cw-error-shake-0{animation:cw-error-shake-a .28s ease-in-out}.cw-error-shake-1{animation:cw-error-shake-b .28s ease-in-out}@media (prefers-reduced-motion: reduce){.cw-error-shake-0,.cw-error-shake-1{animation:none}}.cw-textarea-sm{min-height:80px;max-height:160px;overflow-y:auto}.cw-textarea-lg{min-height:340px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.cw-markdown-loading,.cw-markdown-editor:not(.mdxeditor-popup-container){min-height:340px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background))}.cw-markdown-loading{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px}.cw-markdown-editor:not(.mdxeditor-popup-container){display:flex;flex-direction:column;max-height:420px;overflow:hidden;color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.cw-markdown-editor:not(.mdxeditor-popup-container):focus-within{border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-markdown-editor:not(.mdxeditor-popup-container).is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-markdown-toolbar{flex-shrink:0;min-height:40px;padding:5px 8px;border:0;border-bottom:1px solid hsl(var(--border));border-radius:0;background:hsl(var(--muted) / .38)}.cw-markdown-toolbar button,.cw-markdown-toolbar [role=combobox]{color:hsl(var(--foreground))}.cw-markdown-content{min-height:298px;max-height:360px;overflow-y:auto;padding:18px 20px 28px;color:hsl(var(--foreground));font-size:14px;line-height:1.7}.cw-markdown-content:focus{outline:none}.cw-markdown-content h1,.cw-markdown-content h2,.cw-markdown-content h3{margin:1.1em 0 .45em;color:hsl(var(--foreground));font-weight:650;line-height:1.3}.cw-markdown-content h1:first-child,.cw-markdown-content h2:first-child,.cw-markdown-content h3:first-child{margin-top:0}.cw-markdown-content h1{font-size:20px}.cw-markdown-content h2{font-size:17px}.cw-markdown-content h3{font-size:15px}.cw-markdown-content p{margin:0 0 .8em}.cw-markdown-content ul,.cw-markdown-content ol{margin:.5em 0 .9em;padding-left:1.5em}.cw-markdown-content blockquote{margin:.8em 0;padding-left:12px;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.cw-markdown-error{display:block;margin-top:6px;color:hsl(var(--destructive));font-size:12px}.cw-tag-editor{display:flex;flex-direction:column;gap:12px}.cw-tag-inputrow{display:flex;gap:8px}.cw-tag-inputrow .cw-input{flex:1}.cw-presets{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.cw-presets-label{font-size:11.5px;color:hsl(var(--muted-foreground));margin-right:2px}.cw-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12.5px;white-space:nowrap}.cw-chip-ghost{border:1px dashed hsl(var(--border));background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;transition:background .12s,color .12s,border-color .12s}.cw-chip-ghost:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-chip-sub{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-pills{display:flex;flex-wrap:wrap;gap:8px}.cw-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 6px 5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:13px}.cw-pill-x{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:none;border-radius:50%;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-pill-x:hover{background:hsl(var(--destructive) / .12);color:hsl(var(--destructive))}.cw-empty-line{margin:0;font-size:12.5px;color:hsl(var(--muted-foreground))}.cw-check-inline{display:flex;align-items:center;gap:8px;margin-top:2px;font-size:13px;color:hsl(var(--foreground));cursor:pointer;-webkit-user-select:none;user-select:none}.cw-check-inline input[type=checkbox]{width:16px;height:16px;margin:0;flex-shrink:0;accent-color:hsl(var(--primary));cursor:pointer}.cw-checklist{display:flex;flex-direction:column;gap:8px}.cw-tools-list-shell{min-width:0;container-type:inline-size}.cw-checklist-tools{--cw-checklist-row-height: 65px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(var(--cw-checklist-row-height),auto);max-height:var(--cw-checklist-max-height);padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-checklist-tools .cw-check{min-height:var(--cw-checklist-row-height)}.cw-checklist-tools .cw-check-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}@container (max-width: 575px){.cw-checklist-tools{grid-template-columns:minmax(0,1fr)}}.cw-check{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-check:hover{background:hsl(var(--foreground) / .05)}.cw-check.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-check-box{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background));color:hsl(var(--background));transition:background .12s,border-color .12s,color .12s}.cw-check.is-on .cw-check-box{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-check-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-check-title{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.cw-check-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-segmented{display:flex;flex-wrap:wrap;gap:8px}.cw-seg{flex:1 1 160px;display:flex;flex-direction:column;gap:2px;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-seg:hover{background:hsl(var(--foreground) / .05)}.cw-seg.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-seg-title{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-seg-desc{font-size:11.5px;line-height:1.45;color:hsl(var(--muted-foreground))}.cw-ctool{display:flex;flex-direction:column;gap:12px}.cw-ctool-inputs{display:flex;flex-wrap:wrap;gap:8px}.cw-ctool-inputs .cw-input{flex:1 1 180px}.cw-ctool-list{display:flex;flex-direction:column;gap:8px}.cw-ctool-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--card))}.cw-ctool-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}.cw-ctool-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ctool-name{font-size:13.5px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--foreground));word-break:break-word}.cw-ctool-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp,.cw-mcp-list{display:flex;flex-direction:column;gap:12px}.cw-mcp-row{display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.cw-mcp-rowhead{display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-mcp-transport{display:inline-flex;gap:6px}.cw-seg-sm{flex:0 0 auto;min-width:72px;flex-direction:row;align-items:center;justify-content:center;text-align:center;padding:6px 16px;border-radius:9px}.cw-seg-sm .cw-seg-title{font-size:12.5px}.cw-mcp-note{margin:0;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp .cw-add-sub{margin-top:0}.cw-subfield{margin:-2px 0 2px;padding:14px 16px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .02)}.cw-toggle-stack{gap:14px}.cw-toggle{display:flex;align-items:center;gap:14px;width:100%;padding:16px 18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));text-align:left;cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s,background .15s}.cw-toggle:hover{border-color:hsl(var(--ring) / .25)}.cw-toggle.is-on{border-color:hsl(var(--primary) / .4);box-shadow:0 1px 2px hsl(var(--foreground) / .04)}.cw-toggle-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));transition:background .15s,color .15s}.cw-toggle.is-on .cw-toggle-icon{background:hsl(var(--primary) / .1);color:hsl(var(--primary))}.cw-toggle-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-toggle-title{font-size:14px;font-weight:600}.cw-toggle-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-switch{flex-shrink:0;display:flex;align-items:center;width:42px;height:24px;padding:2px;border-radius:999px;background:hsl(var(--border));transition:background .18s}.cw-toggle.is-on .cw-switch{background:hsl(var(--primary));justify-content:flex-end}.cw-switch-knob{display:block;width:20px;height:20px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .2)}.cw-sub-list{display:flex;flex-direction:column;gap:14px}.cw-sub{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .03)}.cw-sub-head{display:flex;align-items:center;justify-content:space-between}.cw-sub-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.cw-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-icon-btn:not(:disabled):hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-icon-btn:disabled{opacity:.35;cursor:not-allowed}.cw-icon-danger:not(:disabled):hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.cw-sub-head-actions{display:inline-flex;align-items:center;gap:2px}.cw-sub-list-wrap{display:flex;flex-direction:column}.cw-typeradio{display:flex}.cw-typeradio--row{position:relative;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:var(--cw-agent-type-gap);height:44px;width:100%;max-width:100%;padding:4px;overflow:visible;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-typeradio-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-agent-type-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-type-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-typeradio-item{position:relative;z-index:1;flex:1 1 0;min-width:0;min-height:34px;display:flex;align-items:center;justify-content:center;padding:7px 10px;border:none;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .16s,background .16s}.cw-typeradio-item:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-typeradio-item.is-disabled{color:hsl(var(--muted-foreground) / .45);cursor:not-allowed}.cw-typeradio-item.is-disabled:hover{background:transparent;color:hsl(var(--muted-foreground) / .45)}.cw-typeradio-disabled-hint{position:absolute;top:calc(100% + 17px);right:0;width:max-content;max-width:220px;padding:7px 10px;border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--popover));box-shadow:0 8px 24px hsl(var(--foreground) / .1);color:hsl(var(--popover-foreground));font-size:12px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-2px);transition:opacity .14s ease,transform .14s ease}.cw-typeradio-item.is-disabled:hover .cw-typeradio-disabled-hint,.cw-typeradio-item.is-disabled:focus .cw-typeradio-disabled-hint,.cw-typeradio-item.is-disabled:focus-visible .cw-typeradio-disabled-hint{opacity:1;transform:translateY(0)}.cw-typeradio-item.is-on{background:transparent;color:hsl(var(--foreground))}.cw-typeradio-item:has(.cw-typeradio-input:focus-visible){box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-typeradio-input{position:absolute;opacity:0;width:0;height:0}.cw-typeradio-title{min-width:0;white-space:normal;word-break:keep-all;font-size:clamp(11px,1.1vw,13px);font-weight:600;line-height:1.12;text-align:center}.cw-add-sub{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:14px;padding:12px;width:100%;border:1px dashed hsl(var(--border));border-radius:12px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13.5px;font-weight:500;cursor:pointer;transition:background .12s,color .12s,border-color .12s}.cw-add-sub:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-banner{display:flex;align-items:center;gap:8px;padding:11px 14px;border-radius:var(--radius);background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-review{display:flex;flex-direction:column;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;background:hsl(var(--card))}.cw-review-row{display:flex;gap:18px;padding:13px 16px;border-bottom:1px solid hsl(var(--border))}.cw-review-row:last-child{border-bottom:none}.cw-review-key{flex-shrink:0;width:110px;font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.cw-review-val{flex:1;min-width:0;font-size:13.5px}.cw-review-strong{font-weight:600}.cw-review-muted{color:hsl(var(--muted-foreground))}.cw-review-pre{margin:0;padding:10px 12px;background:hsl(var(--muted));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:200px;overflow-y:auto}.cw-review-chips,.cw-review-subs{display:flex;flex-wrap:wrap;gap:6px}.cw-tag{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:500}.cw-tag-on{background:#22c35d24;color:#1c7d3f}.cw-tag-off{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.cw-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:13.5px;font-weight:550;cursor:pointer;transition:background .13s,opacity .13s,border-color .13s,transform .1s}.cw-btn:active{transform:scale(.98)}.cw-btn-primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-btn-primary:hover:not(:disabled){opacity:.88}.cw-btn-primary:disabled{opacity:.4;cursor:default}.cw-btn-ghost{background:hsl(var(--background));border-color:hsl(var(--border));color:hsl(var(--foreground))}.cw-btn-ghost:hover{background:hsl(var(--accent))}.cw-btn-soft{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));flex-shrink:0}.cw-btn-soft:hover:not(:disabled){background:hsl(var(--accent))}.cw-btn-soft:disabled{opacity:.45;cursor:default}.cw-i{width:16px;height:16px;flex-shrink:0}.cw-i-sm{width:14px;height:14px}.cw-root-preview{height:100%}.cw-preview-body{flex:1;min-height:0;display:flex}.cw-preview-body>*{flex:1;min-height:0}.cw-skillhub{display:flex;flex-direction:column;gap:14px}.cw-skill-searchrow{display:flex;gap:8px}.cw-skill-searchbox{position:relative;flex:1;min-width:0;display:flex;align-items:center}.cw-skill-searchicon{position:absolute;left:11px;color:hsl(var(--muted-foreground));pointer-events:none}.cw-skill-input{padding-left:36px}.cw-skill-selected{display:flex;flex-direction:column;gap:8px}.cw-skill-selected-label{font-size:11.5px;font-weight:600;color:hsl(var(--muted-foreground))}.cw-skill-results{display:flex;flex-direction:column;gap:8px;max-height:472px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-skill-result{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s;min-height:72px;max-height:72px;overflow:hidden}.cw-skill-result:hover{background:hsl(var(--foreground) / .05)}.cw-skill-result.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-skill-result-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--muted-foreground));transition:background .12s,border-color .12s,color .12s}.cw-skill-result.is-on .cw-skill-result-icon{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-skill-result-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-skill-result-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground));word-break:break-word}.cw-skill-result-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-skill-result-repo{font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--muted-foreground));word-break:break-all}.cw-spin{animation:cw-spin .8s linear infinite}@keyframes cw-spin{to{transform:rotate(360deg)}}.cw-skillspane{display:flex;flex-direction:column;gap:10px}.cw-skill-add{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:600;transition:border-color .15s,background .15s,color .15s}.cw-skill-add:hover{border-color:hsl(var(--foreground) / .34);background:transparent;color:hsl(var(--foreground))}.cw-skill-add:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-skill-add-icon{flex-shrink:0;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}.cw-skill-dialog-backdrop{position:fixed;z-index:80;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:20px;background:#15181e47;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.cw-skill-dialog{width:min(680px,calc(100vw - 32px));height:min(640px,calc(100dvh - 40px));min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 72px #10131933}.cw-skill-dialog-head{flex-shrink:0;min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px 0 20px;border-bottom:1px solid hsl(var(--border))}.cw-skill-dialog-head h3{margin:0;font-size:16px;font-weight:650;letter-spacing:-.01em}.cw-skill-dialog-close{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-skill-dialog-close:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-skill-dialog-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px;padding:18px 20px 20px}.cw-skill-sourcetabs{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;height:44px;padding:4px;overflow:hidden;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-skill-tab-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-skill-tab-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-skill-tab-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-skill-pickertab{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:7px 10px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background .16s,color .16s}.cw-skill-pickertab:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-skill-pickertab.is-on{background:transparent;color:hsl(var(--foreground))}.cw-skill-pickertab:focus-visible{outline:none;box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-skill-tabbody{flex:1;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}.cw-selected-skill-list{display:flex;flex-direction:column;gap:7px;max-height:347px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-selected-skill-row{display:flex;align-items:center;gap:10px;min-width:0;min-height:52px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--card))}.cw-selected-skill-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-selected-skill-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-selected-skill-name{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-detail{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-remove{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-selected-skill-remove:hover{background:hsl(var(--destructive) / .09);color:hsl(var(--destructive))}.cw-advanced-section{overflow:hidden}.cw-advanced-disclosure{width:100%;display:flex;align-items:center;gap:10px;padding:0;border:0;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.cw-advanced-disclosure-title{font-size:17px;font-weight:650;letter-spacing:-.01em}.cw-advanced-disclosure-chevron{width:18px;height:18px;color:hsl(var(--muted-foreground));transition:transform .18s ease}.cw-advanced-disclosure-chevron.is-open{transform:rotate(90deg)}.cw-advanced-content{overflow:hidden}.cw-advanced-group{padding-top:20px}.cw-advanced-group+.cw-advanced-group{margin-top:22px}.cw-advanced-group-head{display:flex;align-items:center;margin-bottom:12px;color:hsl(var(--foreground));font-size:15px;font-weight:600}.cw-local-dropzone{display:flex;flex-direction:column;align-items:center;gap:9px;padding:18px 14px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .15s,color .15s}.cw-local-drop-icon{width:20px;height:20px;color:hsl(var(--muted-foreground))}.cw-local-dropzone.is-dragging{border-color:hsl(var(--foreground) / .48);color:hsl(var(--foreground))}.cw-local-drop-hint{margin:0;color:hsl(var(--muted-foreground));font-size:11.5px}.cw-local-dropzone.is-dragging .cw-local-drop-hint,.cw-local-dropzone.is-dragging .cw-local-drop-icon{color:hsl(var(--foreground))}.cw-local-hint{margin:0 0 8px;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-skillspace-header{display:flex;gap:8px;align-items:flex-start;margin-bottom:10px}.cw-skillspace-select{width:100%;flex:1;min-width:0}.cw-skillspace-console-link{flex-shrink:0;padding:9px 12px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-color:hsl(var(--primary))}.cw-skillspace-console-link .cw-i{display:block}.cw-skill-result-version{color:hsl(var(--muted-foreground));font-weight:400;font-size:11px;margin-left:4px}.cw-skill-result-repo .cw-i{vertical-align:-2px;margin-right:2px}@media (max-width: 1280px){.cw-debug{width:280px}.cw-tree{width:208px}}@media (max-width: 1080px){.cw-editor{flex-wrap:wrap;overflow-y:auto}.cw-tree{height:260px}.cw-detail{height:min(720px,calc(100dvh - 120px));min-height:560px}.cw-debug{flex:0 0 100%;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px;border-left:none;border-top:1px solid hsl(var(--border))}.cw-debug.is-collapsed{flex:0 0 48px;width:100%;min-width:0;height:48px;min-height:48px;align-items:flex-end;padding:7px 12px}.cw-debug.is-collapsed .cw-debug-expand{width:34px;min-height:34px}.cw-rail{display:none}.cw-lower{gap:0}.cw-detail .cw-form-col{max-width:100%}}@media (max-width: 860px){.cw-editor{flex-direction:column;flex-wrap:nowrap;overflow-x:hidden;overflow-y:auto}.cw-tree{width:100%;height:auto;max-height:220px;border-right:0;border-bottom:1px solid hsl(var(--border))}.cw-detail{flex:none;width:100%;height:min(720px,calc(100dvh - 120px));min-height:560px}.cw-typebar{padding-inline:12px}.cw-detail-scroll{padding:20px 12px 40px}.cw-debug{flex:none;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px}.cw-debug.is-collapsed{width:100%;height:48px;min-height:48px}.cw-center{gap:0;padding:24px 16px 64px}.cw-form-col{max-width:100%}}@media (max-width: 700px){.cw-typeradio-item{padding-inline:6px}.cw-typeradio-title{font-size:12.5px}}.tpl-root{flex:1;min-height:0;display:flex;flex-direction:column}.tpl-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 18px;padding:6px 10px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,color .12s}.tpl-back:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.tpl-back .icon{width:15px;height:15px}.tpl-scroll{flex:1;min-height:0;overflow-y:auto;padding:24px 28px 40px}.tpl-scroll--detail{padding-left:14px;padding-right:14px}.tpl-head{max-width:720px;margin:8px auto 28px;text-align:center}.tpl-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;max-width:1100px;margin:0 auto}.tpl-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;height:100%;padding:16px 16px 18px;text-align:left;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;transition:background .14s,border-color .14s}.tpl-card:hover{background:hsl(var(--foreground) / .05)}.tpl-card:active{background:hsl(var(--foreground) / .08)}.tpl-card-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;color:hsl(var(--muted-foreground))}.tpl-card-icon .icon{width:20px;height:20px}.tpl-card-name{font-size:14px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground))}.tpl-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.tpl-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.tpl-tags--detail{margin-top:0}.tpl-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border:1px solid hsl(var(--border));border-radius:999px;background:none;color:hsl(var(--muted-foreground));font-size:11.5px;white-space:nowrap}.tpl-tag-icon{width:12px;height:12px;flex-shrink:0}.tpl-detail{max-width:720px;margin:0 auto;display:flex;flex-direction:column;gap:20px}.tpl-detail-head{display:flex;align-items:flex-start;gap:14px}.tpl-detail-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;border:1px solid hsl(var(--border));border-radius:12px;background:none;color:hsl(var(--muted-foreground))}.tpl-detail-icon .icon{width:22px;height:22px}.tpl-detail-headtext{min-width:0}.tpl-detail-name{font-size:20px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-detail-desc{margin-top:4px;font-size:13.5px;line-height:1.6;color:hsl(var(--muted-foreground))}.tpl-field{display:flex;flex-direction:column;gap:8px}.tpl-field-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.tpl-input{width:100%;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .15s}.tpl-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.tpl-instruction{margin:0;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .03);color:hsl(var(--foreground));font-size:13px;line-height:1.7;white-space:pre-wrap}.tpl-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px}.tpl-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.tpl-meta-key{flex-shrink:0;color:hsl(var(--muted-foreground))}.tpl-meta-val{text-align:right;word-break:break-word;color:hsl(var(--foreground))}.tpl-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.tpl-subagents{display:flex;flex-direction:column;gap:10px}.tpl-subagent{padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background))}.tpl-subagent-top{display:flex;align-items:center;gap:8px}.tpl-subagent-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.tpl-subagent-tools{margin-left:auto;font-size:11px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.tpl-subagent-desc{margin-top:5px;font-size:12.5px;line-height:1.55;color:hsl(var(--muted-foreground))}.tpl-create{display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:flex-start;margin-top:4px;padding:11px 20px;border:none;border-radius:12px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.tpl-create:hover{opacity:.88}.tpl-create:active{transform:scale(.98)}.tpl-create .icon{width:17px;height:17px}@media (max-width: 560px){.tpl-meta-grid{grid-template-columns:1fr}.tpl-scroll{padding:20px 16px 32px}}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}.wfb{flex:1;min-height:0;display:flex;flex-direction:column;height:100%}.wfb-create{position:absolute;top:14px;right:14px;z-index:5;display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border:1px solid transparent;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:550;cursor:pointer;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .4);transition:opacity .15s,transform .1s}.wfb-create:hover:not(:disabled){opacity:.88}.wfb-create:active:not(:disabled){transform:scale(.97)}.wfb-create:disabled{opacity:.4;cursor:default}.wfb-grid{flex:1;min-height:0;display:grid;grid-template-columns:248px minmax(0,1fr) 288px}.wfb-section-label{margin:4px 0 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.wfb-field{display:flex;flex-direction:column;gap:5px}.wfb-field-label{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-input{width:100%;border:1px solid hsl(var(--border));border-radius:var(--radius);padding:8px 10px;font:inherit;font-size:13px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.wfb-input::placeholder{color:hsl(var(--muted-foreground) / .7)}.wfb-input:focus{outline:none;border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.wfb-input--error,.wfb-input--error:focus{border-color:hsl(var(--destructive));box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.wfb-field-error,.wfb-field-help{font-size:11px;line-height:1.4}.wfb-field-error{color:hsl(var(--destructive))}.wfb-field-help{color:hsl(var(--muted-foreground))}.wfb-textarea{resize:vertical;min-height:52px;line-height:1.5}.wfb-palette{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-right:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-types{display:flex;flex-direction:column;gap:6px}.wfb-type{display:flex;align-items:center;gap:10px;width:100%;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:border-color .12s,background .12s}.wfb-type:hover{border-color:hsl(var(--ring) / .3)}.wfb-type .icon{color:hsl(var(--muted-foreground))}.wfb-type--active{border-color:hsl(var(--ring) / .55);background:hsl(var(--accent))}.wfb-type--active .icon{color:#7c48f4}.wfb-type-text{display:flex;flex-direction:column;gap:1px;min-width:0}.wfb-type-name{font-size:13px;font-weight:550}.wfb-type-desc{font-size:11px;color:hsl(var(--muted-foreground))}.wfb-palette-item{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));cursor:grab;transition:border-color .12s,background .12s}.wfb-palette-item:hover{border-color:hsl(var(--ring) / .4);background:hsl(var(--accent))}.wfb-palette-item:active{cursor:grabbing}.wfb-grip{color:hsl(var(--muted-foreground) / .7)}.wfb-palette-item-text{font-size:13px;font-weight:500}.wfb-add{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;padding:9px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background .12s}.wfb-add:hover{background:hsl(var(--accent))}.wfb-hint{margin-top:auto;padding-top:10px;font-size:11.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.wfb-canvas{position:relative;min-width:0;height:100%;background:hsl(var(--canvas))}.wfb-canvas .react-flow{background:transparent}.wfb-node{display:flex;align-items:center;gap:10px;width:188px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .2);transition:border-color .12s,box-shadow .12s}.wfb-node--selected{border-color:hsl(var(--ring) / .6);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.wfb-node-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:9px;background:hsl(var(--secondary));color:#7c48f4}.wfb-node-icon--sm{width:24px;height:24px;border-radius:7px}.wfb-node-body{min-width:0;display:flex;flex-direction:column;gap:2px}.wfb-node-name{font-size:13px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-node-desc{font-size:11px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-handle{width:9px!important;height:9px!important;background:hsl(var(--background))!important;border:2px solid hsl(258 89% 62%)!important}.wfb-handle:hover{background:#7c48f4!important}.wfb-canvas .react-flow__controls{border-radius:10px;overflow:hidden;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .25);border:1px solid hsl(var(--border))}.wfb-canvas .react-flow__controls-button{background:hsl(var(--background));border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground))}.wfb-canvas .react-flow__controls-button:hover{background:hsl(var(--accent))}.wfb-canvas .react-flow__controls-button svg{fill:hsl(var(--foreground))}.wfb-canvas .react-flow__edge-path{stroke:hsl(var(--muted-foreground) / .55);stroke-width:1.5}.wfb-canvas .react-flow__edge.selected .react-flow__edge-path,.wfb-canvas .react-flow__edge:hover .react-flow__edge-path{stroke:#7c48f4}.wfb-canvas .react-flow__arrowhead *{fill:hsl(var(--muted-foreground) / .55)}.wfb-minimap{border:1px solid hsl(var(--border));border-radius:10px;overflow:hidden}.wfb-inspector{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-left:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-inspector-head{display:flex;align-items:center;justify-content:space-between}.wfb-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:7px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.wfb-icon-btn:hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.wfb-inspector-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;padding-top:12px;border-top:1px solid hsl(var(--border))}.wfb-meta-key{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-meta-val{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;padding:2px 7px;border-radius:6px;background:hsl(var(--muted));color:hsl(var(--foreground))}.wfb-inspector-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:hsl(var(--muted-foreground));font-size:13px}.wfb-empty-icon{width:32px;height:32px;opacity:.4;margin-bottom:4px}.wfb-inspector-empty p{margin:0}.wfb-empty-sub{font-size:12px;color:hsl(var(--muted-foreground) / .8)}@media (max-width: 900px){.wfb-grid{grid-template-columns:220px minmax(0,1fr)}.wfb-inspector{display:none}}.skill-workspace{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:34px clamp(18px,4vw,54px) 44px;background:hsl(var(--panel))}.skill-workspace__intro{width:min(1180px,100%);margin:0 auto 32px}.skill-workspace__intro h1{margin:0;font-size:22px;font-weight:620;letter-spacing:-.025em}.skill-workspace__poll-error{width:min(1180px,100%);margin:0 auto 14px;padding:9px 11px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px}.skill-workspace__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1;min-height:0;gap:clamp(36px,5vw,72px);width:min(1180px,100%);margin:0 auto}.skill-candidate{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;background:transparent}.skill-candidate:nth-child(2):before{position:absolute;top:0;bottom:0;left:calc(clamp(36px,5vw,72px)/-2);width:1px;background:hsl(var(--border));content:""}.skill-candidate__header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:0 0 12px;border-bottom:1px solid hsl(var(--border))}.skill-candidate__header h2{margin:0;font-family:inherit;font-size:13px;font-weight:500;line-height:1.4;letter-spacing:0}.skill-candidate__selected{padding:3px 7px;border-radius:999px;background:hsl(var(--primary) / .1);color:hsl(var(--primary));font-size:10px}.skill-candidate__view{min-height:0;overflow-y:auto;padding-right:8px;scrollbar-gutter:stable;animation:skill-view-in .18s ease-out}.skill-candidate__status{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:46px;padding:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.4;text-align:left}.skill-candidate--succeeded .skill-candidate__status{color:#2a844f}.skill-candidate--failed .skill-candidate__status{color:hsl(var(--destructive))}.skill-candidate__status-icon{display:inline-grid;place-items:center;width:18px;height:18px}.skill-candidate__status-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__spinner{animation:skill-spin .9s linear infinite}.skill-candidate__spinner circle{opacity:.2}.skill-candidate__duration{margin-left:auto;font-size:10px;color:hsl(var(--muted-foreground))}.skill-conversation{min-height:220px;margin:0 0 16px;padding:8px 0 18px}.skill-conversation .bubble{font-size:13px;line-height:1.65}.skill-conversation .think-head,.skill-conversation .tool-head,.skill-conversation .builtin-tool-head{display:grid;grid-template-columns:20px minmax(0,1fr) 13px;align-items:center;gap:8px;width:100%;min-height:38px;padding:4px 0;text-align:left}.skill-conversation .think-label,.skill-conversation .tool-name,.skill-conversation .builtin-tool-label{min-width:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere;text-align:left}.skill-conversation .think-icon,.skill-conversation .tool-icon,.skill-conversation .builtin-tool-icon{width:20px;height:26px}.skill-conversation .chev,.skill-conversation .tool-chevron,.skill-conversation .builtin-tool-chevron{justify-self:end}.skill-candidate__error{margin:0 0 14px;padding:9px 10px;border-radius:7px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:11px;line-height:1.5}.skill-candidate__view-actions{display:flex;justify-content:flex-start;padding:4px 0 20px}.skill-candidate__preview-nav{display:flex;align-items:center;min-height:46px}.skill-candidate__back{display:inline-flex;align-items:center;gap:6px;padding:5px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer}.skill-candidate__back:hover{color:hsl(var(--foreground))}.skill-candidate__back svg,.skill-action--preview svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__result{padding:0 0 20px}.skill-candidate__summary{display:grid;grid-template-columns:1fr .55fr .7fr;gap:8px;margin-bottom:13px}.skill-candidate__summary>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:9px 10px;border-radius:8px;background:hsl(var(--muted) / .55)}.skill-candidate__summary span{color:hsl(var(--muted-foreground));font-size:9px;text-transform:uppercase;letter-spacing:.05em}.skill-candidate__summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:560}.skill-candidate__summary .is-valid{color:#2a844f}.skill-candidate__summary .is-invalid{color:hsl(var(--destructive))}.skill-candidate__description{margin:0 0 13px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.skill-validation{margin-bottom:12px;font-size:11px;color:hsl(var(--muted-foreground))}.skill-validation summary{margin-bottom:6px;cursor:pointer;color:hsl(var(--foreground))}.skill-files{overflow:hidden;margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:9px}.skill-files__tabs{display:flex;gap:2px;overflow-x:auto;padding:5px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--muted) / .34)}.skill-files__tabs button{flex:0 0 auto;max-width:180px;overflow:hidden;text-overflow:ellipsis;padding:4px 7px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:10px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer}.skill-files__tabs button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 3px hsl(var(--foreground) / .08)}.skill-files__content{margin:0;overflow-x:auto;padding:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:10.5px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-word}.skill-files__truncated{margin:0;padding:8px 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:10px}.skill-files__unavailable{padding:20px 12px;color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.skill-candidate__actions{display:flex;flex-wrap:wrap;gap:7px}.skill-action{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px;text-decoration:none;cursor:pointer}.skill-action:hover:not(:disabled){background:hsl(var(--accent))}.skill-action:disabled{cursor:default;opacity:.42}.skill-action--select{border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-action--select[aria-pressed=true]{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.skill-action--preview{gap:7px;border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-publish-form{display:flex;flex-direction:column;gap:9px;margin-top:12px;padding:11px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--muted) / .28)}.skill-publish-form label{display:flex;flex-direction:column;gap:4px;color:hsl(var(--muted-foreground));font-size:10px}.skill-publish-form input{min-width:0;height:31px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px}.skill-publish-form input:focus{border-color:hsl(var(--primary) / .55)}.skill-publish-form__optional{display:grid;grid-template-columns:1fr 1fr;gap:8px}@keyframes skill-spin{to{transform:rotate(360deg)}}@keyframes skill-view-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 780px){.skill-workspace{overflow-y:auto;padding:24px 12px 32px}.skill-workspace__grid{flex:none;grid-template-columns:1fr;gap:32px}.skill-candidate{display:block}.skill-candidate__view{overflow:visible;padding-right:0}.skill-candidate:nth-child(2){padding-top:32px;border-top:1px solid hsl(var(--border))}.skill-candidate:nth-child(2):before{display:none}.skill-workspace__intro h1{font-size:20px}.skill-publish-form__optional{grid-template-columns:1fr}.skill-action{min-height:44px}}@media (prefers-reduced-motion: reduce){.skill-candidate__view,.skill-candidate__spinner{animation:none}}.sandbox-entry{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid hsl(268 58% 58% / .34);background:#f4eefb;color:#5b318c;font:inherit;font-weight:600;cursor:pointer;transition:background-color .14s ease-out,border-color .14s ease-out}.sandbox-entry svg{width:15px;height:15px;flex:0 0 auto}.sandbox-entry:hover:not(:disabled){border-color:#803ecc85;background:#ece2f9}.sandbox-entry:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-entry:disabled{cursor:default;opacity:.72}.sandbox-entry--composer{min-height:30px;padding:0 13px;border-radius:999px;font-size:12px}.sandbox-entry--header{min-height:32px;padding:0 10px;border-radius:7px;font-size:12px}.sandbox-entry.is-active{border-style:dashed}.sandbox-new-chat-entry{display:flex;justify-content:center;min-height:30px}.composer-slot{width:100%;min-width:0}.sandbox-composer-wrap{position:relative;z-index:2}.sandbox-session-warning{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;width:calc(100% - 32px);max-width:736px;min-height:24px;margin:0 auto 6px;color:#c7840f;font-size:12px}.sandbox-session-warning-dot{display:none}.sandbox-session-warning-copy{grid-column:2;white-space:nowrap;text-align:center}.sandbox-session-warning button{grid-column:3;justify-self:end;padding:3px 5px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-weight:580;cursor:pointer}.sandbox-session-warning button:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.sandbox-composer-wrap .composer-box{display:grid;grid-template-columns:1fr auto;grid-template-rows:minmax(44px,auto) 36px;align-items:center;gap:2px 8px;min-height:104px;padding:10px 8px 8px;border-radius:24px}.sandbox-composer-wrap .comp-input{grid-row:1;grid-column:1 / -1;align-self:stretch;width:100%;min-height:44px;padding:8px 10px 4px}.sandbox-composer-wrap .composer-menu-wrap{grid-row:2;grid-column:1;justify-self:start}.sandbox-composer-wrap .comp-send{grid-row:2;grid-column:2}.main.is-sandbox-session{position:relative;isolation:isolate;background:linear-gradient(to bottom,#f4edfd,#f8f3fc,#fbf8fc 48%,hsl(var(--panel)) 76%)}.main.is-sandbox-session:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;background:radial-gradient(ellipse 78% 40% at 18% 0%,hsl(244 82% 84% / .24),transparent 70%),radial-gradient(ellipse 70% 36% at 52% 0%,hsl(284 70% 86% / .2),transparent 72%),radial-gradient(ellipse 64% 38% at 88% 2%,hsl(324 66% 88% / .16),transparent 72%),linear-gradient(to bottom,hsl(var(--panel) / 0),hsl(var(--panel) / .18) 42%,hsl(var(--panel)) 76%);filter:blur(24px);opacity:1;animation:sandbox-smoke-enter .42s ease-out both}.main.is-sandbox-session>*{position:relative;z-index:1}.sandbox-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .24);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.sandbox-dialog{width:min(440px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 20px 56px hsl(var(--foreground) / .2);animation:sandbox-dialog-enter .18s ease-out both}.sandbox-dialog-visual{position:relative;display:grid;height:112px;place-items:center;overflow:hidden;border-bottom:1px solid hsl(var(--border));background:radial-gradient(circle at 35% 70%,hsl(256 68% 78% / .34),transparent 40%),radial-gradient(circle at 68% 30%,hsl(276 66% 72% / .28),transparent 42%),#f9f8fc}.sandbox-dialog-orbit{position:absolute;width:104px;height:44px;border:1px solid hsl(268 52% 54% / .22);border-radius:50%;transform:rotate(-12deg)}.sandbox-dialog-icon{display:grid;width:46px;height:46px;place-items:center;border:1px solid hsl(268 58% 58% / .3);border-radius:14px;background:hsl(var(--panel) / .9);color:#68389f;box-shadow:0 8px 24px #6c38a824}.sandbox-dialog-icon svg{width:23px;height:23px}.sandbox-spinner{width:21px;height:21px;border:2px solid hsl(268 48% 42% / .2);border-top-color:currentColor;border-radius:50%;animation:sandbox-spin .8s linear infinite}.sandbox-dialog-copy{padding:22px 24px 20px;text-align:center}.sandbox-dialog-copy h2{margin:0 0 8px;color:hsl(var(--foreground));font-size:17px;font-weight:650}.sandbox-dialog-copy p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.65}.sandbox-dialog-copy .sandbox-dialog-error{color:hsl(var(--destructive))}.sandbox-dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.sandbox-dialog-actions button{min-width:80px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.sandbox-dialog-actions button:hover{background:hsl(var(--secondary))}.sandbox-dialog-actions button:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-dialog-actions .is-primary{border-color:#68389f;background:#68389f;color:hsl(var(--primary-foreground))}.sandbox-dialog-actions .is-primary:hover{background:#5b318c}@keyframes sandbox-spin{to{transform:rotate(360deg)}}@keyframes sandbox-dialog-enter{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sandbox-smoke-enter{0%{opacity:0}to{opacity:1}}@media (max-width: 700px){.sandbox-entry--header span{display:none}.sandbox-entry--header{width:32px;padding:0}.sandbox-session-warning{grid-template-columns:1fr auto;width:calc(100% - 16px)}.sandbox-session-warning-copy{grid-column:1;white-space:normal;text-align:left}.sandbox-session-warning button{grid-column:2}}@media (prefers-reduced-motion: reduce){.sandbox-entry,.sandbox-dialog,.main.is-sandbox-session:before{animation:none;transition:none}}.PhotoView-Portal{direction:ltr;height:100%;left:0;overflow:hidden;position:fixed;top:0;touch-action:none;width:100%;z-index:2000}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes PhotoView__delayIn{0%,50%{opacity:0}to{opacity:1}}.PhotoView__Spinner{animation:PhotoView__delayIn .4s linear both}.PhotoView__Spinner svg{animation:PhotoView__rotate .6s linear infinite}.PhotoView__Photo{cursor:grab;max-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.PhotoView__Photo:active{cursor:grabbing}.PhotoView__icon{display:inline-block;left:0;position:absolute;top:0;transform:translate(-50%,-50%)}.PhotoView__PhotoBox,.PhotoView__PhotoWrap{bottom:0;direction:ltr;left:0;position:absolute;right:0;top:0;touch-action:none;width:100%}.PhotoView__PhotoWrap{overflow:hidden;z-index:10}.PhotoView__PhotoBox{transform-origin:left top}@keyframes PhotoView__fade{0%{opacity:0}to{opacity:1}}.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,.PhotoView-Slider__clean .PhotoView-Slider__Overlay,.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover{opacity:0}.PhotoView-Slider__Backdrop{background:#000;height:100%;left:0;position:absolute;top:0;transition-property:background-color;width:100%;z-index:-1}.PhotoView-Slider__fadeIn{animation:PhotoView__fade linear both;opacity:0}.PhotoView-Slider__fadeOut{animation:PhotoView__fade linear reverse both;opacity:0}.PhotoView-Slider__BannerWrap{align-items:center;background-color:#00000080;color:#fff;display:flex;height:44px;justify-content:space-between;left:0;position:absolute;top:0;transition:opacity .2s ease-out;width:100%;z-index:20}.PhotoView-Slider__BannerWrap:hover{opacity:1}.PhotoView-Slider__Counter{font-size:14px;opacity:.75;padding:0 10px}.PhotoView-Slider__BannerRight{align-items:center;display:flex;height:100%}.PhotoView-Slider__toolbarIcon{fill:#fff;box-sizing:border-box;cursor:pointer;opacity:.75;padding:10px;transition:opacity .2s linear}.PhotoView-Slider__toolbarIcon:hover{opacity:1}.PhotoView-Slider__ArrowLeft,.PhotoView-Slider__ArrowRight{align-items:center;bottom:0;cursor:pointer;display:flex;height:100px;justify-content:center;margin:auto;opacity:.75;position:absolute;top:0;transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;z-index:20}.PhotoView-Slider__ArrowLeft:hover,.PhotoView-Slider__ArrowRight:hover{opacity:1}.PhotoView-Slider__ArrowLeft svg,.PhotoView-Slider__ArrowRight svg{fill:#fff;background:#0000004d;box-sizing:content-box;height:24px;padding:10px;width:24px}.PhotoView-Slider__ArrowLeft{left:0}.PhotoView-Slider__ArrowRight{right:0}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--destructive: 0 72% 51%;--border: 240 5.9% 90%;--ring: 240 5.9% 10%;--radius: .5rem;--canvas: 240 5% 97.3%;--panel: 0 0% 100%;color-scheme:light;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0;overflow:hidden;overscroll-behavior:none}#root{position:fixed;top:0;right:0;bottom:0;left:0}body{background:hsl(var(--canvas));color:hsl(var(--foreground));-webkit-font-smoothing:antialiased}.icon{width:16px;height:16px;flex-shrink:0}.spin{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}*{scrollbar-width:thin;scrollbar-color:hsl(var(--foreground) / .18) transparent}*::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:hsl(var(--foreground) / .18);border-radius:999px;border:2px solid transparent;background-clip:content-box}*::-webkit-scrollbar-thumb:hover{background:hsl(var(--foreground) / .32);background-clip:content-box}*::-webkit-scrollbar-corner{background:transparent}.layout{display:flex;height:100vh;height:100dvh;min-height:0;overflow:hidden}.main-shell{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.sidebar{width:236px;height:100%;min-height:0;flex-shrink:0;display:flex;flex-direction:column;background:transparent;position:relative;transition:width .22s cubic-bezier(.22,1,.36,1)}.sidebar.is-collapsed{width:56px}@media (max-width: 860px){.sidebar{width:204px}}.sidebar-top{display:flex;flex-direction:column;gap:2px;padding:0 10px 8px}.sidebar-brand-row{height:54px;min-height:54px;display:flex;align-items:center;gap:6px;padding:0 0 0 10px}.brand{flex:1;min-width:0;display:flex;align-items:center;gap:9px;font-weight:600;font-size:15px;letter-spacing:-.01em}.brand-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand-logo,.brand-title,.login-brand-logo,.login-brand,.login-title{cursor:text}.sidebar-collapse-toggle{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.sidebar-collapse-toggle:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.sidebar-collapse-toggle .icon{width:17px;height:17px}.sidebar.is-collapsed .sidebar-brand-row{justify-content:center;padding-inline:0}.sidebar.is-collapsed .brand{display:none}.brand-logo,.login-brand-logo{display:block;width:20px;min-width:20px;max-width:20px;height:20px;min-height:20px;max-height:20px;flex:0 0 20px;object-fit:contain}.new-chat{display:flex;align-items:center;gap:10px;padding:10px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;cursor:pointer;transition:background .12s}.new-chat .icon{width:18px;height:18px}.new-chat:hover{background:hsl(var(--foreground) / .05)}.sidebar.is-collapsed .new-chat,.sidebar.is-collapsed .agent-row{align-self:center;width:36px;height:36px;min-height:36px;gap:0;padding:9px;overflow:hidden;white-space:nowrap}.sidebar.is-collapsed .agent-row-name,.sidebar.is-collapsed .agent-row-region,.sidebar.is-collapsed .agent-row-chev,.sidebar.is-collapsed .sidebar-nav-label,.sidebar.is-collapsed .sidebar-history{display:none}.agent-row{display:flex;align-items:center;gap:9px;margin:2px 0 6px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,border-color .12s}.agent-row:hover{background:hsl(var(--foreground) / .04);border-color:hsl(var(--foreground) / .2)}.agent-row--empty{border-color:#e2b3ac;background:#fcf6f5;color:#905047}.agent-row--empty .agent-row-lead{color:#bc6052}.agent-row--empty .agent-row-chev{color:#ac7e77}.agent-row--empty:hover{border-color:#d6998f;background:#faf1ef}.agent-row-lead{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0;transform:translateY(3px)}.agent-row--connected .agent-row-lead{color:#328f54}.agent-row-name{flex:1;min-width:0;text-align:left;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agent-row-region{flex-shrink:0;padding:1px 6px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10px;font-weight:550;line-height:1.5}.agent-row-chev{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .15s;flex-shrink:0;transform:translateY(1px)}.agent-row-chev.open{transform:translateY(1px) rotate(90deg)}.agentsel{--agentsel-available-width: calc(100vw - 250px) ;container-type:inline-size;position:absolute;left:100%;top:8px;z-index:32;display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;align-content:stretch;gap:8px;width:min(320px,var(--agentsel-available-width));background:transparent;border:0;margin-left:6px;overflow:visible;animation:agentsel-in .16s ease-out}.agentsel.has-detail{width:min(688px,var(--agentsel-available-width))}.sidebar.is-collapsed .agentsel{--agentsel-available-width: calc(100vw - 70px) }.agentsel-main{width:320px;height:100%;max-height:100%;min-width:min(240px,100%);flex:1 1 320px;display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 40px hsl(var(--foreground) / .14)}.agentsel-detail{width:360px;height:100%;max-height:100%;min-width:min(280px,100%);flex:1 1 360px;display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 40px hsl(var(--foreground) / .14)}.agentsel-preview{animation:agentsel-preview-in .16s cubic-bezier(.22,1,.36,1)}@container (max-width: 527px){.agentsel.has-detail>.agentsel-main,.agentsel.has-detail>.agentsel-detail{height:calc((100% - 8px)/2);max-height:calc((100% - 8px)/2)}}.agentsel-preview-head{padding:7px 14px}.agentsel-detail-tabs{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;height:36px;padding:3px;overflow:hidden;border:1px solid hsl(var(--border) / .58);border-radius:9px;background:hsl(var(--secondary) / .58)}.agentsel-detail-tabs-slider{position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc(50% - 3px);border:1px solid hsl(var(--border) / .72);border-radius:6px;background:hsl(var(--background));transform:translate(0);transition:transform .24s cubic-bezier(.22,1,.36,1)}.agentsel-detail-tabs.is-runtime .agentsel-detail-tabs-slider{transform:translate(100%)}.agentsel-detail-tabs button{position:relative;z-index:1;min-width:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;font-weight:550;text-align:center;cursor:pointer;transition:color .16s}.agentsel-detail-tabs button:hover,.agentsel-detail-tabs button[aria-selected=true]{color:hsl(var(--foreground))}.agentsel-detail-tabs button:focus-visible{outline:2px solid hsl(var(--ring) / .24);outline-offset:-2px}.agentsel-tab-panel{display:flex;flex:1;min-height:0;min-width:0;flex-direction:column}.agentsel-tab-panel[hidden]{display:none}.agentsel-detail-body{flex:1;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:12px 14px}.agentsel-panel-state{display:flex;align-items:center;justify-content:center;gap:7px;min-height:120px;color:hsl(var(--muted-foreground));font-size:12.5px}.agentsel-panel-state .icon{width:15px;height:15px}.agentsel-panel-empty{display:flex;flex-direction:column;gap:6px;padding:24px 8px;text-align:center;color:hsl(var(--muted-foreground));font-size:12.5px;overflow-wrap:anywhere}.agentsel-panel-empty small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground) / .75);font-size:11px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:3}.agentsel-identity,.agentsel-runtime-identity{display:flex;align-items:flex-start;gap:10px;min-width:0}.agentsel-identity{padding-bottom:12px}.agentsel-identity-icon,.agentsel-runtime-identity>.icon{width:18px;height:18px;margin-top:1px;flex-shrink:0;color:hsl(var(--muted-foreground))}.agentsel-identity-copy,.agentsel-runtime-identity>div{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}.agentsel-identity-copy strong,.agentsel-runtime-identity strong{overflow:hidden;color:hsl(var(--foreground));font-size:13.5px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.agentsel-identity-copy span,.agentsel-runtime-identity span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.agentsel-runtime-identity{margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid hsl(var(--border))}.agentsel-info-section{min-width:0;padding:11px 0;border-top:1px solid hsl(var(--border))}.agentsel-info-section h3{display:flex;align-items:center;gap:6px;margin:0 0 8px;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:600}.agentsel-info-section h3 .icon{width:13px;height:13px}.agentsel-description{max-height:104px;margin:0;overflow-y:auto;white-space:pre-wrap;overflow-wrap:anywhere;color:hsl(var(--foreground));font-size:12.5px;line-height:1.65}.agentsel-chips{display:flex;flex-wrap:wrap;gap:5px;min-width:0}.agentsel-chip{display:block;max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--canvas) / .7);color:hsl(var(--foreground));font-size:11.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.agentsel-info-list{display:flex;min-width:0;flex-direction:column;gap:6px}.agentsel-info-list-item{display:flex;min-width:0;flex-direction:column;gap:2px;padding:7px 8px;border-radius:6px;background:hsl(var(--canvas) / .72)}.agentsel-info-list-item>strong,.agentsel-component-head>strong{overflow:hidden;font-size:12px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.agentsel-info-list-item>span{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:3}.agentsel-component-head{display:flex;align-items:center;gap:8px;min-width:0}.agentsel-component-head>strong{flex:1;min-width:0}.agentsel-component-head>span{flex-shrink:0;padding:1px 5px;border-radius:4px;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));font-size:10px}.agentsel-kv{margin:0;display:flex;flex-direction:column;gap:8px}.agentsel-kv-row{display:grid;grid-template-columns:52px 1fr;gap:8px;font-size:12.5px}.agentsel-kv-row dt{color:hsl(var(--muted-foreground))}.agentsel-kv-row dd{min-width:0;margin:0;color:hsl(var(--foreground));overflow-wrap:anywhere}.agentsel-envs{margin-top:14px}.agentsel-envs-head{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));margin-bottom:6px}.agentsel-env{display:flex;flex-direction:column;gap:1px;margin-bottom:6px}.agentsel-env-k{overflow-wrap:anywhere;font-family:inherit;font-size:11px;color:hsl(var(--muted-foreground))}.agentsel-env-v{overflow-wrap:anywhere;font-family:inherit;font-size:11.5px;color:hsl(var(--foreground))}.agentsel-head-actions{display:flex;align-items:center;gap:2px}.agentsel-pager{display:flex;align-items:center;justify-content:center;gap:14px;flex:0 0 36px;padding:6px 10px 0}.agentsel-pager button{display:flex;border:none;background:none;padding:2px;cursor:pointer;color:hsl(var(--muted-foreground))}.agentsel-pager button:hover:not(:disabled){color:hsl(var(--foreground))}.agentsel-pager button:disabled{opacity:.3;cursor:default}.agentsel-pager button .icon{width:18px;height:18px}.agentsel-pager-label{font-size:13px;color:hsl(var(--muted-foreground));min-width:40px;text-align:center}@keyframes agentsel-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes agentsel-preview-in{0%{opacity:0;transform:translate(-6px)}to{opacity:1;transform:translate(0)}}.agentsel-head{display:flex;align-items:center;justify-content:space-between;height:52px;flex-shrink:0;box-sizing:border-box;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.agentsel-title{display:flex;min-width:0;align-items:center;gap:8px;overflow:hidden;font-weight:600;font-size:14px;text-overflow:ellipsis;white-space:nowrap}.agentsel-title .icon{width:17px;height:17px}.agentsel-refresh{display:flex;border:none;background:none;cursor:pointer;color:hsl(var(--muted-foreground));padding:4px;border-radius:6px}.agentsel-refresh:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.agentsel-refresh .icon{width:16px;height:16px}.agentsel-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:10px}.agentsel-body--cloud{display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}.agentsel-tools{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}.agentsel-search{display:flex;align-items:center;gap:8px;border:1px solid hsl(var(--border));border-radius:8px;padding:7px 10px}.agentsel-search .icon{width:15px;height:15px;color:hsl(var(--muted-foreground))}.agentsel-search input{flex:1;border:none;outline:none;background:none;font:inherit;font-size:13px;color:hsl(var(--foreground))}.agentsel-regions{display:grid;grid-template-columns:repeat(2,1fr);gap:2px;padding:2px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--canvas) / .55)}.agentsel-regions button{height:27px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;outline:none;cursor:pointer}.agentsel-regions button:hover{color:hsl(var(--foreground))}.agentsel-regions button:focus-visible{box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.agentsel-regions button.active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.agentsel-mine{display:flex;align-items:center;gap:7px;font-size:12.5px;color:hsl(var(--muted-foreground));cursor:pointer}.agentsel-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.agentsel-listwrap{position:relative;min-height:220px}.agentsel-body--cloud .agentsel-listwrap{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:auto}.agentsel-loading{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);border-radius:8px}.agentsel-loading .icon{width:16px;height:16px}.agentsel-item{width:100%;display:flex;align-items:center;gap:9px;min-height:46px;padding:4px 0;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13.5px;text-align:left}.agentsel-main button.agentsel-item{min-height:0;padding:9px 10px;cursor:pointer}.agentsel-item:hover{background:hsl(var(--foreground) / .05);box-shadow:none;transform:none}.agentsel-runtime-item:hover{background:none}.agentsel-item.active{background:hsl(var(--foreground) / .08);font-weight:600}.agentsel-item.is-previewed{background:hsl(var(--foreground) / .055)}.agentsel-runtime-item.active,.agentsel-runtime-item.is-previewed{background:none}.agentsel-item .icon{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-item-main{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}.agentsel-item-name{min-width:0;overflow:hidden;font-size:13px;font-weight:550;text-overflow:ellipsis;white-space:nowrap}.agentsel-item-meta{display:flex;align-items:center;gap:4px;min-width:0}.agentsel-item-actions{display:flex;align-items:center;gap:1px;flex-shrink:0}.agentsel-connect,.agentsel-info{border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.agentsel-connect{min-width:38px;height:28px;padding:0 5px;font-size:11.5px;font-weight:550}.agentsel-info{display:grid;width:28px;height:28px;padding:0;place-items:center}.agentsel-connect:hover:not(:disabled),.agentsel-info:hover{background:hsl(var(--foreground) / .07);color:hsl(var(--foreground));box-shadow:none}.agentsel-info.active{background:transparent;color:hsl(var(--foreground));box-shadow:none}.agentsel-connect:disabled{opacity:.55;cursor:default}.agentsel-info .icon{width:15px;height:15px}.agentsel-rt{display:flex;flex-direction:column}.agentsel-rt-row{width:100%;display:flex;align-items:center;gap:7px;padding:9px 8px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13.5px;cursor:pointer;text-align:left}.agentsel-rt-row:hover{background:hsl(var(--foreground) / .05)}.agentsel-rt-row .icon{width:15px;height:15px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-rt-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agentsel-badge{flex-shrink:0;font-size:10px;font-weight:600;padding:1px 6px;border-radius:999px;background:#007bff1f;color:#0b68cb}.agentsel-status{flex-shrink:0;font-size:10px;padding:1px 6px;border-radius:999px}.agentsel-status.is-ok{background:#21c45d24;color:#238b49}.agentsel-status.is-warn{background:#f59f0a29;color:#b86614}.agentsel-status.is-bad{background:#dc282824;color:#ca2b2b}.agentsel-status.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.agentsel-apps{display:flex;flex-direction:column;gap:2px;padding:2px 0 6px 20px}.agentsel-app{width:100%;display:flex;align-items:center;gap:8px;padding:7px 10px;border:none;border-radius:7px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;text-align:left}.agentsel-app:hover{background:hsl(var(--foreground) / .05)}.agentsel-app.active{background:hsl(var(--foreground) / .08);font-weight:600}.agentsel-app .icon{width:14px;height:14px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-apps-note{display:flex;align-items:center;gap:7px;padding:7px 10px;font-size:12.5px;color:hsl(var(--muted-foreground))}.agentsel-apps-note .icon{width:14px;height:14px}.agentsel-apps-note--muted{font-style:italic}.agentsel-empty{padding:24px 10px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.agentsel-error{min-width:0;max-width:100%;margin:4px 0 10px;padding:8px 10px;overflow:hidden;overflow-wrap:anywhere;border-radius:8px;background:#dc282814;color:#bd2828;font-size:12.5px;white-space:pre-wrap}.agentsel-more{width:100%;margin-top:8px;padding:9px;border:1px dashed hsl(var(--border));border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer}.agentsel-more:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}@media (max-width: 860px){.agentsel{--agentsel-available-width: calc(100vw - 218px) }}.sidebar-history{flex:1;min-height:0;display:flex;flex-direction:column}.history-head{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 6px 20px;font-size:12px;font-weight:500;color:hsl(var(--muted-foreground))}.history-refresh{background:none;border:none;cursor:pointer;padding:2px;color:hsl(var(--muted-foreground));display:flex}.history-refresh:hover{color:hsl(var(--foreground))}.history-new-chat{width:24px;height:24px;margin:-4px 0;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s}.history-new-chat .icon{width:15px;height:15px}.history-new-chat:hover{background:transparent;color:hsl(var(--foreground))}.history-list{flex:1;overflow-y:auto;padding:4px 10px 12px;display:flex;flex-direction:column;gap:2px}.history-empty{padding:16px 8px;font-size:13px;color:hsl(var(--muted-foreground));text-align:center}.history-item{position:relative;display:flex;align-items:center;border-radius:8px;transition:background .12s}.history-item:hover{background:hsl(var(--foreground) / .05)}.history-item.active{background:hsl(var(--foreground) / .08)}.history-item-btn{flex:1;min-width:0;display:flex;align-items:center;gap:7px;text-align:left;padding:9px 10px;border:none;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;cursor:pointer}.history-title{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-streaming{flex-shrink:0;width:7px;height:7px;margin-right:4px;border-radius:50%;background:#22c55e;box-shadow:0 0 #22c55e80;animation:history-pulse 1.4s ease-in-out infinite}@keyframes history-pulse{0%,to{box-shadow:0 0 #22c55e80}50%{box-shadow:0 0 0 4px #22c55e00}}.history-more{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:28px;height:28px;margin-right:4px;border:none;border-radius:6px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;opacity:0;transition:opacity .12s,background .12s}.history-item:hover .history-more{opacity:1}.history-more:hover{background:hsl(var(--border));color:hsl(var(--foreground))}.menu-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:30}.history-menu{position:absolute;top:100%;right:4px;z-index:31;min-width:120px;margin-top:2px;padding:4px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:8px;box-shadow:0 6px 20px hsl(var(--foreground) / .12)}.menu-item{display:flex;align-items:center;gap:8px;width:100%;padding:7px 10px;border:none;border-radius:6px;background:none;font:inherit;font-size:13px;cursor:pointer;color:hsl(var(--foreground))}.menu-item:hover{background:hsl(var(--accent))}.menu-item--danger{color:hsl(var(--destructive))}.menu-item .icon{width:15px;height:15px}.main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;margin:0 10px 10px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:12px;overflow:hidden}.error{margin:10px auto 0;max-width:768px;width:calc(100% - 32px);padding:10px 12px;border-radius:var(--radius);background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px}.transcript{flex:1;overflow-y:auto;padding:28px 16px 8px}.welcome{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 16px 6vh;gap:22px}.welcome-title{margin:0;font-size:26px;font-weight:600;letter-spacing:-.02em}.welcome .composer{padding:0}.turn{max-width:768px;margin:0 auto 22px;display:flex;flex-direction:column;gap:8px}.turn:last-child{margin-bottom:0}.turn--user{align-items:flex-end}.turn--assistant{align-items:flex-start}.bubble{line-height:1.65;font-size:14px}.turn--user .bubble{max-width:85%;padding:10px 16px;border-radius:18px;background:hsl(var(--secondary))}.turn--assistant .bubble{max-width:100%}.md{font-size:14px;line-height:1.65}.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}.md p{margin:0 0 .7em}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{margin:1.1em 0 .5em;font-weight:650;line-height:1.3;letter-spacing:-.01em}.md h1{font-size:1.4em}.md h2{font-size:1.25em}.md h3{font-size:1.1em}.md h4,.md h5,.md h6{font-size:1em}.md ul,.md ol{margin:0 0 .7em;padding-left:1.4em}.md li{margin:.15em 0}.md li>ul,.md li>ol{margin:.15em 0}.md a{color:hsl(var(--primary));text-decoration:underline;text-underline-offset:2px}.md a:hover{opacity:.8}.md blockquote{margin:0 0 .7em;padding:.1em .9em;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.md hr{border:none;border-top:1px solid hsl(var(--border));margin:1em 0}.md strong{font-weight:650}.md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.875em;background:hsl(var(--muted));padding:.12em .35em;border-radius:5px}.md pre{margin:0 0 .7em;padding:12px 14px;background:hsl(var(--muted));border-radius:8px;overflow-x:auto;line-height:1.55}.md pre code{background:none;padding:0;border-radius:0;font-size:12.5px}.md table{width:100%;margin:0 0 .7em;border-collapse:collapse;font-size:.95em;border-radius:12px;overflow:hidden;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border))}.md table thead th,.md table th{background:hsl(var(--muted));font-weight:650;border:1px solid hsl(var(--border));padding:12px 16px;text-align:left;font-size:.98em}.md table tbody td,.md table td{border:1px solid hsl(var(--border));padding:12px 16px;text-align:left;vertical-align:top;line-height:1.65}.md table tbody tr:nth-child(2n){background:hsl(var(--muted) / .25)}.md table tbody tr:hover{background:hsl(var(--accent))}.md table caption{caption-side:top;text-align:left;padding:0 0 8px;font-weight:600;color:hsl(var(--muted-foreground));font-size:.9em}.md table colgroup,.md table col{display:table-column}.md table thead,.md table tbody,.md table tfoot{display:table-row-group}.md table tr{display:table-row}.md strong,.md b{font-weight:650}.md em,.md i{font-style:italic}.md del,.md s{text-decoration:line-through}.md ins,.md u{text-decoration:underline}.md mark{background:#fff3c2b3;padding:.1em .3em;border-radius:4px}.md sub{vertical-align:sub;font-size:.8em}.md sup{vertical-align:super;font-size:.8em}.md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.md pre{overflow-x:auto}@media (max-width: 640px){.md table{font-size:.85em}.md table thead th,.md table th,.md table tbody td,.md table td{padding:8px 10px}}.md p{line-height:1.7}.md br{display:block;content:"";margin:.4em 0}.md hr{border:none;border-top:1px solid hsl(var(--border));margin:1.5em 0}.md blockquote{border-left:3px solid hsl(var(--primary) / .4);padding:.6em 1em;margin:.8em 0;background:hsl(var(--muted) / .3);border-radius:0 8px 8px 0}.md ul,.md ol{padding-left:1.6em;margin:.6em 0}.md li{margin:.3em 0;line-height:1.6}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{margin-top:1.2em;margin-bottom:.5em;line-height:1.3}.md h1{font-size:1.6em;font-weight:700}.md h2{font-size:1.4em;font-weight:650}.md h3{font-size:1.2em;font-weight:600}.md h4{font-size:1.1em;font-weight:600}.md h5,.md h6{font-size:1em;font-weight:600}.md .image-preview-trigger{position:relative;display:block;width:fit-content;max-width:40%;margin:0 0 .7em;padding:0;overflow:hidden;border:0;border-radius:10px;background:hsl(var(--muted));box-shadow:0 0 0 1px hsl(var(--border));cursor:zoom-in;line-height:0}.md .image-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .image-preview-trigger img{display:block;width:auto;max-width:100%;height:auto;border-radius:inherit;transition:filter .18s ease,transform .18s ease}.md .image-preview-trigger:hover img{filter:brightness(.92);transform:scale(1.01)}.image-preview-hint{position:absolute;right:8px;bottom:8px;display:grid;width:28px;height:28px;place-items:center;border:1px solid hsl(0 0% 100% / .2);border-radius:8px;background:#131316ad;color:#fff;opacity:0;transform:translateY(3px);transition:opacity .16s ease,transform .16s ease}.image-preview-hint svg{width:14px;height:14px}.image-preview-trigger:hover .image-preview-hint,.image-preview-trigger:focus-visible .image-preview-hint{opacity:1;transform:translateY(0)}.md .video-container{margin:0 0 .7em;display:grid;gap:6px}.md .video-caption{font-size:.9em;color:hsl(var(--muted-foreground))}.md .video-link-text{color:inherit;text-decoration:none;transition:color .15s ease}.md .video-link-text:hover{color:hsl(var(--foreground));text-decoration:underline}.md .video-preview-trigger{position:relative;display:block;width:fit-content;max-width:80%;padding:0;overflow:hidden;border:0;border-radius:12px;background:hsl(var(--muted));box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border));cursor:pointer;line-height:0;transition:box-shadow .18s ease,transform .18s ease}.md .video-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .video-preview-trigger:hover{box-shadow:0 4px 16px hsl(var(--foreground) / .15),0 0 0 1px hsl(var(--border));transform:translateY(-1px)}.md .video-preview-trigger .video-thumbnail{display:block;width:auto;max-width:100%;height:auto;border-radius:inherit;transition:filter .18s ease,transform .18s ease}.md .video-preview-trigger:hover .video-thumbnail{filter:brightness(.9);transform:scale(1.01)}.video-preview-hint{position:absolute;right:10px;bottom:10px;display:grid;width:32px;height:32px;place-items:center;border:1px solid hsl(0 0% 100% / .2);border-radius:10px;background:#131316b3;color:#fff;opacity:0;transform:translateY(4px);transition:opacity .16s ease,transform .16s ease;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.video-preview-hint svg{width:16px;height:16px}.video-preview-trigger:hover .video-preview-hint,.video-preview-trigger:focus-visible .video-preview-hint{opacity:1;transform:translateY(0)}.md .video-inline{max-width:100%;border-radius:12px;margin:0 0 .7em;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border))}.video-viewer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:grid;place-items:center;padding:28px;background:#131316c7;-webkit-backdrop-filter:blur(16px) saturate(.85);backdrop-filter:blur(16px) saturate(.85)}.video-viewer{display:flex;flex-direction:column;width:min(1080px,94vw);max-height:min(880px,90vh);overflow:hidden;border:1px solid hsl(var(--foreground) / .15);border-radius:18px;background:hsl(var(--background));box-shadow:0 32px 100px #07070885}.video-viewer-header{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:10px 16px;background:hsl(var(--muted) / .3);border-bottom:1px solid hsl(var(--border))}.video-viewer-title{font-weight:500;color:hsl(var(--foreground));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:70%}.video-viewer-nav{display:flex;gap:6px}.video-viewer-download,.video-viewer-close{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.video-viewer-download:hover,.video-viewer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.video-viewer-download svg,.video-viewer-close svg{width:17px;height:17px}.video-viewer-body{flex:1;min-height:0;display:grid;place-items:center;padding:20px;overflow:hidden;background:#161618}.video-viewer-body .video-fullscreen{max-width:100%;max-height:calc(90vh - 96px);border-radius:12px;background:#000;box-shadow:0 4px 20px #0006}@media (max-width: 640px){.md .video-preview-trigger{max-width:100%}.video-viewer-backdrop{padding:0}.video-viewer{width:100vw;max-height:100vh;border:none;border-radius:0}.video-viewer-body .video-fullscreen{max-height:calc(100vh - 96px);border-radius:0}}.turn--user .md code,.turn--user .md pre{background:hsl(var(--background) / .55)}.block-thinking,.block-tool{width:100%}.think-head,.tool-head{display:inline-flex;align-items:center;border:none;background:none;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.think-head{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.think-icon{width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center}.think-icon>svg{width:18px;height:18px}.spark{color:hsl(var(--muted-foreground))}.spark.pulse{animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{0%,to{opacity:.45;transform:scale(.92)}50%{opacity:1;transform:scale(1.08)}}.chev{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.chev.open{transform:rotate(90deg)}.think-label{font-size:13.5px;font-weight:400;line-height:1.35}.think-label--done{color:hsl(var(--muted-foreground))}.tool-head{color:hsl(var(--muted-foreground));transition:color .12s}.tool-head:hover{color:hsl(var(--foreground))}.tool-head--generic{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.tool-name{color:inherit;font-size:13.5px;font-weight:400;line-height:1.35}.tool-icon{width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center}.tool-icon>svg{width:18px;height:18px}.tool-icon--generic{color:hsl(var(--muted-foreground))}.tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.tool-chevron.is-open{transform:rotate(90deg)}.tool-detail{display:flex;flex-direction:column;gap:8px;margin:6px 0 4px;padding-left:3px}.tool-section-label{margin-bottom:4px;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:hsl(var(--muted-foreground))}.tool-result{max-height:240px;overflow:auto}.think-collapse{display:grid;grid-template-rows:0fr;transition:grid-template-rows .28s ease}.think-collapse.open{grid-template-rows:1fr}.think-collapse-inner{overflow:hidden}.think-body{margin:8px 0 4px;padding:10px 14px;border-left:2px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:13px;line-height:1.7;white-space:pre-wrap;max-height:220px;overflow-y:auto}.tool-args{margin:0;padding:8px 10px;background:hsl(var(--muted));border-radius:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5;overflow-x:auto;white-space:pre-wrap}.turn-meta{display:flex;align-items:center;gap:10px;margin-top:2px;font-size:12px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s}.turn-empty{margin-top:2px;font-size:13px;font-style:italic;color:hsl(var(--muted-foreground))}.auth-card{width:100%;max-width:640px;margin:2px 0;padding:18px 20px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.auth-card-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}.auth-card-icon{width:18px;height:18px;color:#f59f0a}.auth-card-icon--done{color:#1eae53}.auth-card-collapsed{display:inline-flex;align-items:center;gap:7px;margin:2px 0;padding:6px 12px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--card));font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.auth-card-code{padding:1px 6px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}.auth-card-title{font-size:14px;font-weight:600}.auth-card-desc{margin:0 0 14px;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.auth-card-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;border:none;border-radius:9px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:opacity .12s}.auth-card-btn:hover:not(:disabled){opacity:.88}.auth-card-btn:disabled{opacity:.55;cursor:default}.auth-card-btn .cw-i{width:15px;height:15px}.auth-card-done{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:#1eae53}.auth-card-done .cw-i{width:16px;height:16px}.auth-card-err{margin-top:8px;font-size:12px;color:hsl(var(--destructive))}.turn-actions{display:inline-flex;align-items:center;gap:2px}.turn-actions--right{align-self:flex-end;margin-top:2px;opacity:0;transition:opacity .15s}.turn--assistant:hover .turn-meta,.turn--user:hover .turn-actions--right{opacity:1}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:6px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.icon-btn:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.icon-btn:disabled{opacity:.35;cursor:default}.icon-btn:disabled:hover{background:none;color:hsl(var(--muted-foreground))}.icon-btn .icon{width:15px;height:15px}.meta-text{white-space:nowrap;font-size:12px;color:hsl(var(--muted-foreground))}.turn-actions--right{gap:6px}.drawer-scrim{position:fixed;top:0;right:0;bottom:0;left:0;background:hsl(var(--foreground) / .2);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fade .2s ease;z-index:40}@keyframes fade{0%{opacity:0}to{opacity:1}}.drawer{position:fixed;top:0;right:0;bottom:0;width:min(560px,92vw);background:hsl(var(--background));border-left:1px solid hsl(var(--border));box-shadow:-12px 0 40px hsl(var(--foreground) / .14);display:flex;flex-direction:column;z-index:41;animation:slidein .24s cubic-bezier(.22,1,.36,1)}@keyframes slidein{0%{transform:translate(100%)}to{transform:translate(0)}}.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas))}.drawer-title{font-weight:650;font-size:15px;letter-spacing:-.01em}.drawer-sub{font-size:12px;color:hsl(var(--muted-foreground));margin-top:3px;font-variant-numeric:tabular-nums}.drawer-close{display:flex;padding:6px;border:none;background:none;cursor:pointer;color:hsl(var(--muted-foreground));border-radius:6px}.drawer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.drawer-body{flex:1;overflow:auto;padding:16px 18px}.drawer-loading,.drawer-empty{display:flex;align-items:center;gap:8px;color:hsl(var(--muted-foreground));font-size:14px;padding:20px 0}.drawer--trace{width:min(1080px,96vw)}.trace-split{flex:1;min-height:0;display:flex}.trace-tree{flex:1.25;min-width:0;overflow:auto;padding:8px 6px;border-right:1px solid hsl(var(--border))}.trace-row{display:flex;align-items:center;gap:10px;width:100%;padding:5px 8px;border:none;background:none;border-radius:6px;cursor:pointer;font:inherit;text-align:left;transition:background .1s}.trace-row:hover{background:hsl(var(--foreground) / .04)}.trace-row.active{background:hsl(var(--primary) / .07);box-shadow:inset 2px 0 hsl(var(--primary) / .55)}.trace-label{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.trace-caret{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:hsl(var(--muted-foreground))}.trace-caret.hidden{visibility:hidden}.trace-caret .chev{width:13px;height:13px;transition:transform .18s}.trace-caret.open .chev{transform:rotate(90deg)}.trace-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.trace-name{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.trace-dur{flex-shrink:0;width:66px;text-align:right;font-size:11px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}.trace-track{position:relative;flex:0 0 34%;height:16px;border-radius:5px;background:hsl(var(--foreground) / .05)}.trace-bar{position:absolute;top:4px;height:8px;min-width:3px;border-radius:4px;opacity:.9}.trace-detail{flex:1;min-width:0;overflow:auto;padding:18px 20px}.td-title{font-size:15px;font-weight:600;letter-spacing:-.01em;word-break:break-all}.td-dur{display:flex;align-items:center;gap:7px;margin-top:4px;font-size:12px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}.td-dot{width:8px;height:8px;border-radius:50%}.td-section{margin:22px 0 9px;font-size:12px;font-weight:650;letter-spacing:.01em;color:hsl(var(--foreground))}.td-props{display:flex;flex-direction:column}.td-prop{display:flex;gap:16px;padding:7px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.td-key{flex-shrink:0;color:hsl(var(--muted-foreground));min-width:140px}.td-val{flex:1;min-width:0;text-align:right;word-break:break-word;font-variant-numeric:tabular-nums}.td-pre{margin:0;padding:11px 13px;background:hsl(var(--canvas));border:1px solid hsl(var(--border));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:320px;overflow:auto}.composer{max-width:768px;width:100%;margin:0 auto;padding:6px 16px 18px}.composer-box{position:relative;display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 8px;border:1px solid hsl(var(--border));border-radius:26px;background:hsl(var(--background))}.composer--new-chat .composer-box{display:block;min-height:136px;padding:10px;border-radius:16px}.composer-input-stack{display:flex;flex:1;min-width:0;flex-direction:column}.composer-input-stack .comp-input{width:100%}.composer--new-chat .composer-input-stack{min-height:114px}.composer--new-chat .comp-input{min-height:76px;padding:4px 10px}.composer--new-chat .composer-menu-wrap{position:absolute;bottom:10px;left:10px;height:36px}.composer--new-chat .new-chat-mode{position:absolute;right:52px;bottom:10px;display:flex;align-items:center;min-height:36px}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.composer-meta{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;padding:7px 12px 0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4}.composer-session-line{display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap}.composer-session-id{max-width:300px;overflow:hidden;text-overflow:ellipsis;font-family:inherit}.composer-session-copy{display:inline-grid;flex:0 0 18px;width:18px;height:18px;padding:0;place-items:center;border:0;border-radius:4px;background:transparent;color:inherit;cursor:pointer;opacity:.72;transition:background .12s ease,color .12s ease,opacity .12s ease}.composer-session-copy:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground));opacity:1}.composer-session-copy svg{width:11px;height:11px}.composer-meta-separator{opacity:.55}.comp-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 4px;max-height:200px;overflow-y:auto}.comp-input::placeholder{color:hsl(var(--muted-foreground))}.comp-icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.comp-icon:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.comp-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.comp-send:hover:not(:disabled){opacity:.85}.comp-send:active:not(:disabled){transform:scale(.94)}.comp-send:disabled{opacity:.3;cursor:default}.invocation-chips{display:flex;flex-wrap:wrap;gap:6px;min-width:0}.composer>.invocation-chips{padding:0 8px 8px}.turn--user>.invocation-chips{justify-content:flex-end;margin-bottom:6px}.invocation-chip{display:inline-flex;align-items:center;gap:5px;max-width:260px;min-height:28px;padding:4px 8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .025);font-size:12px;font-weight:560;line-height:1.2}.invocation-chip--skill{color:#267848}.invocation-chip--agent{color:#2762b0}.invocation-chip>svg{width:13px;height:13px;flex:0 0 auto}.invocation-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.invocation-chip button{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;margin:-1px -3px -1px 1px;padding:0;border:none;border-radius:5px;background:transparent;color:currentColor;cursor:pointer;opacity:.55}.invocation-chip button:hover{background:hsl(var(--accent));opacity:1}.invocation-chip button svg{width:11px;height:11px}.composer-command-menu{position:absolute;z-index:34;bottom:calc(100% + 10px);left:0;width:min(500px,calc(100vw - 48px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));box-shadow:0 2px 7px hsl(var(--foreground) / .08),0 22px 60px -24px hsl(var(--foreground) / .28);transform-origin:bottom left;animation:command-menu-in .13s ease-out}@keyframes command-menu-in{0%{opacity:0;transform:translateY(5px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}.composer-command-head{display:flex;align-items:center;gap:7px;height:38px;padding:0 10px 0 12px;border-bottom:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11px;font-weight:650;letter-spacing:.02em}.composer-command-head>svg{width:13px;height:13px}.composer-command-head>span{flex:1}.composer-command-menu kbd{min-width:22px;padding:2px 5px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--canvas));color:hsl(var(--muted-foreground));font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.composer-command-list{display:grid;max-height:min(330px,42vh);overflow-y:auto;padding:5px}.composer-command-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;width:100%;min-height:52px;padding:6px 8px;border:none;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.composer-command-item.is-active{background:hsl(var(--accent))}.composer-command-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:9px}.composer-command-icon--skill{background:#e7f8ee;color:#218349}.composer-command-icon--agent{background:#e9f1fc;color:#2664b5}.composer-command-icon svg{width:16px;height:16px}.composer-command-copy{display:grid;min-width:0;gap:3px}.composer-command-copy strong{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.composer-command-copy>span{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.composer-command-empty{display:flex;align-items:center;justify-content:center;gap:7px;min-height:68px;padding:14px;color:hsl(var(--muted-foreground));font-size:12px}.composer-command-empty svg{width:14px;height:14px}.composer-menu-wrap{position:relative;flex-shrink:0}.composer-menu{position:absolute;bottom:100%;left:0;z-index:31;min-width:168px;margin-bottom:6px;padding:4px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 6px 20px hsl(var(--foreground) / .12)}.media-grid{display:flex;flex-wrap:wrap;gap:8px;max-width:min(620px,100%)}.turn--user .media-grid{justify-content:flex-end}.composer>.media-grid{padding:0 8px 9px;justify-content:flex-start}.media-card{position:relative;width:272px;min-width:0;overflow:visible;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .025);transition:border-color .16s,box-shadow .16s,transform .16s}.media-card:hover{border-color:hsl(var(--foreground) / .2);box-shadow:0 8px 28px -20px hsl(var(--foreground) / .28);transform:translateY(-1px)}.media-card--image{width:176px}.media-grid--compact .media-card{width:224px}.media-grid--compact .media-card--image{width:92px}.media-card-main{display:flex;align-items:center;gap:11px;width:100%;min-width:0;height:68px;padding:10px 12px;border:none;border-radius:inherit;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.media-card-main:disabled{cursor:default}.media-card--image .media-card-main{display:block;height:132px;padding:4px}.media-grid--compact .media-card-main{height:58px;padding:8px 10px}.media-grid--compact .media-card--image .media-card-main{height:72px;padding:3px}.media-card-image{width:100%;height:100%;object-fit:cover;border-radius:10px;display:block;background:hsl(var(--muted))}.media-card--image .media-card-copy,.media-card--image .media-card-open{display:none}.media-card-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:44px;flex:0 0 auto;border-radius:9px;color:hsl(var(--muted-foreground));background:hsl(var(--muted))}.media-card--pdf .media-card-icon{color:#db2a24;background:#fdeded}.media-card--video .media-card-icon{color:#226cd3;background:#edf3fd}.media-card--markdown .media-card-icon{color:#259353;background:#ebfaf1}.media-card-icon svg{width:21px;height:21px}.media-card-video-container{position:relative;display:grid;place-items:center;width:100%;height:100%;overflow:hidden;background:#131316}.media-card-video{width:100%;height:100%;object-fit:cover;opacity:.85}.media-card-video-play{position:absolute;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#0000008c;color:#fff;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transform:scale(1);transition:transform .18s ease,background .18s ease}.media-card-video-play svg{width:20px;height:20px;margin-left:3px}.media-card-main:hover .media-card-video-play{transform:scale(1.08);background:#000000b3}.media-card-copy{min-width:0;flex:1;display:grid;gap:5px}.media-card-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:1.2;font-weight:560}.media-card-meta{display:flex;align-items:center;gap:5px;min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.2}.media-card-type{font-size:9px;font-weight:700;letter-spacing:.06em}.media-card-open{width:14px;height:14px;flex:0 0 auto;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s}.media-card:hover .media-card-open{opacity:1}.media-card-spinner{width:12px;height:12px;animation:spin .85s linear infinite}.media-card--error{border-color:hsl(var(--destructive) / .42)}.media-card--error .media-card-meta{color:hsl(var(--destructive))}.media-card-remove{position:absolute;z-index:2;top:-7px;right:-7px;display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;padding:0;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));box-shadow:0 2px 8px hsl(var(--foreground) / .12);cursor:pointer}.media-card-remove:hover{color:hsl(var(--foreground))}.media-card-remove svg{width:12px;height:12px}.media-viewer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:grid;place-items:center;padding:28px;background:#131316b8;-webkit-backdrop-filter:blur(12px) saturate(.8);backdrop-filter:blur(12px) saturate(.8)}.media-viewer{display:flex;flex-direction:column;width:min(1080px,94vw);height:min(820px,90vh);overflow:hidden;border:1px solid hsl(var(--foreground) / .13);border-radius:18px;background:hsl(var(--background));box-shadow:0 32px 100px #07070875}.media-viewer-header{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:58px;padding:9px 12px 9px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background) / .94)}.media-viewer-header>div{min-width:0;display:grid;gap:2px}.media-viewer-header strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:620}.media-viewer-header span{color:hsl(var(--muted-foreground));font-size:11px}.media-viewer-header nav{display:flex;gap:4px}.media-viewer-header a,.media-viewer-header button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.media-viewer-header a:hover,.media-viewer-header button:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.media-viewer-header svg{width:17px;height:17px}.media-viewer-body{flex:1;min-height:0;overflow:auto;background:hsl(var(--canvas))}.media-viewer-body--image,.media-viewer-body--video{display:grid;place-items:center;padding:24px;background:#161618}.media-viewer-body--image img,.media-viewer-body--video video{max-width:100%;max-height:100%;object-fit:contain;border-radius:8px}.media-viewer-video-wrapper{width:100%;display:grid;place-items:center}.media-viewer-video{max-width:100%;max-height:calc(90vh - 140px);border-radius:12px;background:#000;box-shadow:0 4px 20px #0006}.media-viewer-body--pdf iframe{display:block;width:100%;height:100%;border:none;background:#fff}.media-document{width:min(820px,calc(100% - 48px));margin:24px auto;padding:34px 40px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 12px 38px -30px hsl(var(--foreground) / .3)}.media-document--plain{min-height:calc(100% - 48px);white-space:pre-wrap;word-break:break-word;font:13px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace}.media-viewer-loading{display:flex;align-items:center;justify-content:center;gap:8px;height:100%;color:hsl(var(--muted-foreground));font-size:13px}.media-viewer-loading svg{width:17px;height:17px;animation:spin .85s linear infinite}@media (max-width: 640px){.composer-command-menu{right:0;width:auto}.media-card{width:min(272px,82vw)}.media-viewer-backdrop{padding:0}.media-viewer{width:100vw;height:100vh;border:none;border-radius:0}.media-document{width:calc(100% - 24px);margin:12px auto;padding:22px 18px}.md .image-preview-trigger{max-width:100%}}.a2ui-surface{max-width:360px;width:100%;font-size:14px}.a2ui-card{background:hsl(var(--card));border:1px solid hsl(var(--border));border-radius:8px;padding:18px;box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .18)}.a2ui-column,.a2ui-row{gap:10px}.a2ui-text{margin:0;line-height:1.5;color:hsl(var(--foreground))}.a2ui-text--h1{font-size:19px;font-weight:650;letter-spacing:0}.a2ui-text--h2{font-size:16px;font-weight:650;letter-spacing:0}.a2ui-text--h3{font-size:14px;font-weight:600}.a2ui-text--h4{font-size:12px;font-weight:600;color:hsl(var(--muted-foreground));text-transform:uppercase;letter-spacing:0}.a2ui-text--caption{font-size:12px;color:hsl(var(--muted-foreground))}.a2ui-text--body{font-size:14px}.a2ui-icon{display:inline-flex;align-items:center;justify-content:center;font-size:15px;line-height:1;color:hsl(var(--muted-foreground))}.a2ui-divider--h{height:1px;background:hsl(var(--border));margin:4px 0;width:100%}.a2ui-divider--v{width:1px;background:hsl(var(--border));align-self:stretch}.a2ui-button{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));border:1px solid transparent;border-radius:10px;padding:8px 14px;cursor:pointer;font:inherit;font-size:13px;font-weight:500;transition:background .15s,opacity .15s}.a2ui-button:hover{background:hsl(var(--accent))}.a2ui-button--primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.a2ui-button--primary:hover{background:hsl(var(--primary));opacity:.88}.a2ui-button--borderless{background:transparent;color:hsl(var(--foreground))}.a2ui-button--borderless:hover{background:hsl(var(--accent))}.a2ui-surface[data-a2ui-surface^=flight-]{max-width:520px}.a2ui-surface[data-a2ui-surface^=flight-] .a2ui-card{padding:0;overflow:hidden;background:linear-gradient(180deg,#f6fbfe,hsl(var(--card)) 42%),hsl(var(--card));border-color:#d7e0ea;box-shadow:0 1px 2px hsl(var(--foreground) / .05),0 18px 48px -28px #283d5359}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-content]{gap:16px;padding:18px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-top]{gap:12px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-brand]{min-width:0}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-brand-icon]{width:28px;height:28px;border-radius:999px;background:#006fe61a;color:#004fa3}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-title]{font-size:13px;color:#41454e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip]{flex-shrink:0;gap:6px;padding:5px 9px;border-radius:999px;background:#e3f8ed;border:1px solid hsl(151 48% 82%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip] .a2ui-icon,.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-text]{color:#126e41}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-hero]{position:relative;gap:16px;padding:18px;border-radius:8px;background:hsl(var(--background) / .88);border:1px solid hsl(210 32% 90%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination]{flex:1 1 0;min-width:0;gap:2px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{font-size:34px;line-height:1;font-weight:760;color:#191d24}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-label],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-label]{font-size:11px;font-weight:700;color:#717784}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-city],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-city]{font-size:13px;color:#545964}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{flex:0 0 auto;gap:3px;padding:0 4px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-icon]{width:34px;height:34px;border-radius:999px;background:#006fe61f;color:#0054ad}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-duration],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-aircraft]{font-size:11px;white-space:nowrap}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-times],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-details]{gap:10px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-time],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-time],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding]{flex:1 1 0;min-width:0;gap:2px;padding:11px 12px;border-radius:8px;background:#f3f4f6;border:1px solid hsl(220 13% 91%)}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-value]{font-size:14px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-departure-airport],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-arrival-airport]{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate-value],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding-value]{font-size:20px;line-height:1.15}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-footer]{gap:10px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-divider]{margin:0;background:#d9e0e8}@media (max-width: 520px){.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-content]{padding:14px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-hero],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-times],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-details]{flex-wrap:wrap}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{order:3;width:100%}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-terminal],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-gate],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-boarding]{min-width:120px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{font-size:34px}}.a2ui-fallback{background:hsl(var(--muted));border:1px solid hsl(var(--border));border-radius:10px;padding:8px 10px;font-size:12px;color:hsl(var(--muted-foreground))}.a2ui-fallback pre{overflow-x:auto;margin:6px 0 0}.boot{height:100vh;background:hsl(var(--background))}.boot-error{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:hsl(var(--foreground));font-size:14px}.boot-error p{margin:0}.boot-error button,.login-provider-error button{padding:7px 18px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--card));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer}.boot-error button:hover,.login-provider-error button:hover{background:hsl(var(--accent))}.navbar{flex:0 0 54px;min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 10px;background:transparent}.navbar-left,.navbar-right,.navbar-default,.navbar-portal-slot,.navbar-portal-actions{display:flex;align-items:center}.navbar-left{flex:1;min-width:0}.navbar-default{min-width:0}.navbar-right{flex:0 0 auto;min-width:0;gap:10px}.navbar-portal-slot,.navbar-portal-actions{min-width:0}.navbar-portal-slot:empty,.navbar-portal-actions:empty{display:none}.navbar-left:has(.navbar-portal-slot:not(:empty))>.navbar-default{display:none}.global-deploy-center{position:relative;z-index:38}.global-deploy-task{max-width:300px;min-height:32px;display:flex;align-items:center;gap:7px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background) / .82);color:hsl(var(--muted-foreground));font:inherit;font-size:12px;outline:none;white-space:nowrap;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}.global-deploy-task:hover{background:hsl(var(--background))}.global-deploy-task:focus-visible{border-color:hsl(var(--ring) / .32);box-shadow:0 0 0 2px hsl(var(--ring) / .07)}.global-deploy-task.is-idle{color:hsl(var(--muted-foreground))}.global-deploy-task.is-running{border-color:#0c77e93d;color:#1863b4}.global-deploy-task.is-success{border-color:#279b5138;color:#277c46}.global-deploy-task.is-error{border-color:hsl(var(--destructive) / .24);color:hsl(var(--destructive))}.global-deploy-task.is-cancelled{color:hsl(var(--muted-foreground))}.global-deploy-task-icon{width:14px;height:14px;flex:0 0 auto}.global-deploy-task-detail{overflow:hidden;text-overflow:ellipsis}.global-deploy-task-chevron{width:13px;height:13px;flex:0 0 auto;transition:transform .14s ease}.global-deploy-task-chevron.is-open{transform:rotate(180deg)}.global-deploy-task-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;padding:0;border:0;background:transparent}.global-deploy-popover{position:absolute;top:40px;right:0;z-index:2;width:390px;max-width:calc(100vw - 32px);overflow:hidden;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--background));box-shadow:0 14px 36px hsl(var(--foreground) / .14)}.global-deploy-popover-head{height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground));font-size:13px;font-weight:650}.global-deploy-popover-head span:last-child{min-width:20px;padding:1px 6px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.global-deploy-list{max-height:min(520px,calc(100vh - 82px));overflow-y:auto;padding:8px}.global-deploy-empty{padding:34px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.global-deploy-item{padding:12px;border:1px solid hsl(var(--border) / .8);border-radius:8px;background:hsl(var(--canvas) / .42)}.global-deploy-item+.global-deploy-item{margin-top:7px}.global-deploy-item-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.global-deploy-runtime-name{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.global-deploy-status{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:11.5px}.global-deploy-item.is-running .global-deploy-status{color:#1863b4}.global-deploy-item.is-success .global-deploy-status{color:#277c46}.global-deploy-item.is-error .global-deploy-status{color:hsl(var(--destructive))}.global-deploy-item.is-cancelled .global-deploy-status{color:hsl(var(--muted-foreground))}.global-deploy-meta{display:grid;grid-template-columns:1fr 1fr;gap:9px 14px;margin:11px 0 0}.global-deploy-meta>div{min-width:0}.global-deploy-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:10.5px}.global-deploy-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.global-deploy-message{margin:10px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.global-deploy-error{margin-top:10px;color:hsl(var(--muted-foreground));font-size:11.5px}.deploy-error-message-text{display:-webkit-box;margin:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-height:1.5;overflow-wrap:anywhere;white-space:pre-wrap}.deploy-error-message.is-expanded .deploy-error-message-text{display:block;max-height:280px;overflow:auto;-webkit-line-clamp:unset}.deploy-error-message-actions{display:flex;justify-content:flex-end;gap:2px;margin-top:6px}.deploy-error-message-actions button{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:inherit;cursor:pointer;opacity:.72}.deploy-error-message-actions button:hover{background:hsl(var(--foreground) / .07);opacity:1}.deploy-error-message-actions button:disabled{cursor:default;opacity:.5}.deploy-error-message-actions .deploy-error-retry{width:auto;gap:5px;margin-right:auto;padding:0 8px;font:inherit;font-size:11.5px;font-weight:600}.deploy-error-message-actions svg{width:14px;height:14px}.global-deploy-progress{height:3px;margin-top:10px;overflow:hidden;border-radius:999px;background:hsl(var(--foreground) / .08)}.global-deploy-progress span{display:block;height:100%;border-radius:inherit;background:#2581e4;transition:width .18s ease}.global-deploy-item-actions{display:flex;justify-content:flex-end;margin-top:9px}.global-deploy-item-actions button{min-height:27px;padding:0 9px;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:11.5px;cursor:pointer}.global-deploy-item-actions button:hover:not(:disabled){border-color:hsl(var(--destructive) / .3);background:hsl(var(--destructive) / .05);color:hsl(var(--destructive))}.global-deploy-item-actions button:disabled{opacity:.55;cursor:default}.navbar-title{padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.agent-dd{position:relative}.agent-dd-trigger{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:none;border-radius:8px;background:none;color:hsl(var(--foreground));font:inherit;font-size:16px;font-weight:650;letter-spacing:-.01em;cursor:pointer;transition:background .12s}.agent-dd-trigger:hover{background:hsl(var(--foreground) / .05)}.agent-dd-current{max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-dd-chev{width:16px;height:16px;opacity:.6;transition:transform .2s ease}.agent-dd-chev.open{transform:rotate(180deg)}.agent-dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;min-width:240px;max-width:360px;max-height:min(560px,calc(100dvh - 84px));padding:6px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);display:flex;flex-direction:column;gap:2px;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;animation:ddpop .14s ease}@keyframes ddpop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.agent-dd-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;font-size:14px;text-align:left;cursor:pointer;transition:background .12s}.agent-dd-row{position:relative}.agent-dd-item{width:100%}.agent-dd-item:hover{background:hsl(var(--foreground) / .05)}.agent-dd-item.active{background:hsl(var(--foreground) / .04)}.agent-dd-item-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-dd-item-dot{width:8px;height:8px;flex-shrink:0;border-radius:50%;background:#21c45d;box-shadow:0 0 0 3px #21c45d2e}.agent-dd-flyout{position:absolute;left:248px;z-index:32;width:280px;padding:12px 14px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);animation:ddpop .12s ease}.agent-dd-flyout:before{content:"";position:absolute;top:0;bottom:0;left:-12px;width:14px}.agent-dd-fly-loading{display:flex;align-items:center;gap:8px;font-size:13px;color:hsl(var(--muted-foreground))}.agent-dd-fly-name{font-size:14px;font-weight:650;letter-spacing:-.01em}.agent-dd-fly-desc{margin-top:3px;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.agent-dd-fly-field{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12.5px;color:hsl(var(--foreground))}.agent-dd-fly-field .icon{width:14px;height:14px;flex-shrink:0;color:hsl(var(--muted-foreground))}.agent-dd-fly-field--tools{align-items:flex-start}.agent-dd-fly-field--tools .icon{margin-top:3px}.agent-dd-fly-label{color:hsl(var(--muted-foreground))}.agent-dd-fly-model{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}.agent-dd-fly-chips{display:flex;flex-wrap:wrap;gap:5px}.agent-dd-chip{padding:2px 8px;border-radius:999px;background:hsl(var(--foreground) / .06);font-size:11.5px;white-space:nowrap}.account{position:relative}.account-avatar{width:32px;height:32px;flex-shrink:0;position:relative;isolation:isolate;overflow:hidden;border:none;border-radius:9px;background:radial-gradient(circle at var(--avatar-x, 32%) var(--avatar-y, 30%),hsl(var(--avatar-hue-a, 202) 100% 92%) 0 12%,hsl(var(--avatar-hue-a, 202) 95% 75% / .76) 34%,transparent 62%),radial-gradient(ellipse at 82% 78%,hsl(var(--avatar-hue-c, 185) 86% 49% / .88) 0 18%,transparent 58%),linear-gradient(142deg,hsl(var(--avatar-hue-b, 222) 94% 83%),hsl(var(--avatar-hue-b, 222) 95% 54%) 52%,hsl(var(--avatar-hue-c, 185) 74% 62%));background-size:180% 180%,160% 160%,100% 100%;background-position:20% 12%,80% 80%,center;color:#152747e0;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;cursor:pointer;text-shadow:0 1px 2px hsl(0 0% 100% / .62);box-shadow:none;animation:avatar-smoke-drift 9s ease-in-out infinite alternate;transition:filter .16s,transform .16s}.account-avatar:hover{filter:saturate(1.12) brightness(1.03);transform:scale(1.035)}.account-avatar.has-image{animation:none;text-shadow:none}.account-avatar-image{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;border-radius:inherit;object-fit:cover}@keyframes avatar-smoke-drift{0%{background-position:18% 12%,82% 84%,center}50%{background-position:58% 42%,54% 62%,center}to{background-position:82% 70%,26% 24%,center}}.account-avatar--lg{width:40px;height:40px;border-radius:11px;font-size:16px;cursor:default}.account-pop{position:absolute;top:calc(100% + 8px);right:0;z-index:31;min-width:220px;padding:12px;background:hsl(var(--panel));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);animation:ddpop .12s ease}.account-head{display:flex;align-items:center;gap:10px}.account-id{min-width:0;flex:1}.account-name-row{display:flex;align-items:center;gap:6px;min-width:0}.account-name{min-width:0;flex:1;font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-sub{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-logout{display:flex;align-items:center;gap:8px;width:100%;margin-top:10px;padding:9px 10px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s}.account-logout:hover{background:hsl(var(--foreground) / .05)}.account-logout .icon{width:16px;height:16px;color:hsl(var(--muted-foreground))}.sidebar-user{position:relative;flex-shrink:0;margin-top:auto;padding:8px 10px 12px}.sidebar-user-btn{display:flex;align-items:center;gap:9px;width:100%;padding:7px 8px;border:none;border-radius:10px;background:none;color:hsl(var(--foreground));font:inherit;cursor:pointer;transition:background .12s}.sidebar-user-btn:hover{background:hsl(var(--foreground) / .05)}.sidebar-user-identity{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.sidebar-user-primary{min-width:0;display:flex;align-items:center;gap:6px}.sidebar-user-name{min-width:0;flex:1;text-align:left;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-user-email{min-width:0;text-align:left;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.studio-role-badge{flex-shrink:0;padding:2px 5px;border:1px solid transparent;border-radius:999px;font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap}.studio-role-badge--admin{color:#7027b4;background:#8f37e11c;border-color:#7d2cc93d}.studio-role-badge--developer{color:#976507;background:#fac70f2e;border-color:#ce9b0d4d}.studio-role-badge--user{color:#1b7e43;background:#25b15f1f;border-color:#2994543d}.sidebar.is-collapsed .sidebar-user-btn{width:36px;height:36px;justify-content:center;gap:0;padding:2px;overflow:hidden}.sidebar.is-collapsed .sidebar-user-identity{display:none}.sidebar.is-collapsed .sidebar-user-pop{left:8px;right:auto;width:220px}@media (prefers-reduced-motion: reduce){.sidebar{transition:none}}.sidebar-user-pop{position:absolute;bottom:calc(100% - 4px);top:auto;left:10px;right:10px}.skillcenter{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;padding:0}.skillcenter-regions{display:grid;padding:2px;border:1px solid hsl(var(--border));background:hsl(var(--canvas) / .62)}.skillcenter-regions button{border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer}.skillcenter-regions button.active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.skillcenter-regions button:focus-visible,.skillcenter-pager button:focus-visible,.skill-detail-close:focus-visible{outline:2px solid hsl(var(--ring) / .28);outline-offset:1px}.skillcenter-space-item:focus-visible,.skillcenter-skill-item:focus-visible{outline:none;border-color:transparent;background:hsl(var(--muted) / .62)}.skillcenter-regions{grid-template-columns:repeat(2,58px);border-radius:7px}.skillcenter-regions button{height:27px;border-radius:5px;font-size:11.5px}.skillcenter-browser{flex:1;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(270px,.9fr) minmax(360px,1.35fr);gap:0}.skillcenter-panel{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.skillcenter-panel+.skillcenter-panel{border-left:1px solid hsl(var(--border))}.skillcenter-panel-head{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.skillcenter-panel-head>div{min-width:0;display:flex;align-items:center;gap:8px}.skillcenter-panel-head .icon{width:17px;height:17px;color:hsl(var(--muted-foreground))}.skillcenter-panel-head h2{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:13.5px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.skillcenter-panel-head>span{flex-shrink:0;color:hsl(var(--muted-foreground));font-size:11.5px}.skillcenter-count-badge{min-width:25px;height:21px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:11px;font-weight:600;line-height:1}.skillcenter-listwrap{position:relative;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}.skillcenter-list{display:flex;flex-direction:column;gap:6px;padding:8px}.skillcenter-space-item,.skillcenter-skill-item{width:100%;min-width:0;display:flex;align-items:flex-start;gap:10px;padding:10px;border:1px solid transparent;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:background-color .12s ease,border-color .12s ease}.skillcenter-space-item:hover,.skillcenter-skill-item:hover,.skillcenter-space-item.active{border-color:transparent;background:hsl(var(--muted) / .62)}.skillcenter-symbol{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground) / .78)}.skillcenter-symbol .icon{width:18px;height:18px}.skillcenter-symbol--skill{color:#2764b4;background:#f2f7fd;border-color:#ccdbf0}.skillcenter-item-body{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}.skillcenter-item-title{min-width:0;overflow:hidden;font-size:13px;font-weight:600;line-height:18px;text-overflow:ellipsis;white-space:nowrap}.skillcenter-item-description{display:-webkit-box;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:17px;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skillcenter-item-meta{min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px;margin-top:2px}.skillcenter-status{flex-shrink:0;padding:2px 6px;border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10.5px;line-height:16px}.skillcenter-status.is-positive{color:#1d7742;background:#e7f8ee}.skillcenter-status.is-progress{color:#8d5911;background:#fdf5e3}.skillcenter-status.is-danger{color:hsl(var(--destructive));background:hsl(var(--destructive) / .09)}.skillcenter-meta-text{min-width:0;max-width:170px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}.skillcenter-pager{height:44px;flex:0 0 44px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11.5px}.skillcenter-pager-actions{display:flex;align-items:center;gap:7px}.skillcenter-pager-actions>span{min-width:38px;text-align:center}.skillcenter-pager button,.skill-detail-close{display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.skillcenter-pager button{width:26px;height:26px;padding:0}.skillcenter-pager button:hover:not(:disabled),.skill-detail-close:hover{color:hsl(var(--foreground));background:hsl(var(--accent))}.skillcenter-pager button:disabled{opacity:.35;cursor:default}.skillcenter-pager button .icon{width:17px;height:17px}.skillcenter-empty,.skillcenter-loading,.skillcenter-error{min-height:130px;display:flex;align-items:center;justify-content:center;gap:8px;padding:24px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55;text-align:center;overflow-wrap:anywhere}.skillcenter-error{color:hsl(var(--destructive))}.skillcenter-loading--overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;min-height:0;background:hsl(var(--background) / .82);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.skillcenter-loading-mark{width:14px;height:14px;flex-shrink:0;border:1.5px solid hsl(var(--foreground) / .16);border-top-color:hsl(var(--foreground) / .62);border-radius:50%;animation:spin .8s linear infinite}.skill-detail-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;display:grid;place-items:center;padding:16px;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.skill-detail-dialog{width:min(760px,100%);height:min(760px,100%);min-height:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 18px 48px hsl(var(--foreground) / .16)}.skill-detail-head{flex-shrink:0;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 18px 14px;border-bottom:1px solid hsl(var(--border))}.skill-detail-heading{min-width:0;display:flex;align-items:flex-start;gap:11px}.skill-detail-heading>div{min-width:0}.skill-detail-heading h2{margin:1px 0 4px;overflow:hidden;font-size:16px;font-weight:650;line-height:22px;text-overflow:ellipsis;white-space:nowrap}.skill-detail-heading p{display:-webkit-box;margin:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12px;line-height:17px;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skill-detail-close{width:30px;height:30px;flex:0 0 30px;padding:0}.skill-detail-meta{flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 18px;margin:0;padding:14px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas) / .45)}.skill-detail-meta>div{min-width:0}.skill-detail-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:10.5px}.skill-detail-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;line-height:17px;text-overflow:ellipsis;white-space:nowrap}.skill-detail-content{flex:1;min-height:0;display:flex;flex-direction:column}.skill-detail-content-title{height:40px;flex:0 0 40px;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid hsl(var(--border));font-size:12px;font-weight:600}.skill-detail-content>.skillcenter-loading,.skill-detail-content>.skillcenter-error,.skill-detail-content>.skillcenter-empty{flex:1;min-height:0}.skill-detail-markdown{flex:1;min-height:0;overflow-y:auto;padding:18px 22px 28px;overflow-wrap:anywhere}@media (max-width: 760px){.skillcenter-browser{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr))}.skillcenter-panel+.skillcenter-panel{border-top:1px solid hsl(var(--border));border-left:0}.skill-detail-meta{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 560px){.skillcenter-regions{grid-template-columns:repeat(2,46px)}.skillcenter-browser{gap:8px}.skillcenter-item-meta{gap:4px 6px}.skillcenter-meta-text{max-width:132px}.skill-detail-backdrop{padding:8px}.skill-detail-dialog{border-radius:10px}.skill-detail-meta{grid-template-columns:minmax(0,1fr);gap:8px;max-height:180px;overflow-y:auto}}.addagent{flex:1;min-height:0;overflow-y:auto;display:flex;justify-content:center;align-items:flex-start;padding:8vh 16px 16px}.addagent-card{width:100%;max-width:480px}.addagent-title{margin:0 0 6px;font-size:20px;font-weight:650;letter-spacing:-.01em}.addagent-sub{margin:0 0 22px;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.addagent-field{display:block;margin-bottom:14px}.addagent-label{display:block;margin-bottom:6px;font-size:12.5px;font-weight:500;color:hsl(var(--muted-foreground))}.addagent-input{width:100%;border:1px solid hsl(var(--border));border-radius:10px;padding:10px 12px;font:inherit;font-size:14px;background:hsl(var(--background));color:hsl(var(--foreground))}.addagent-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.addagent-error{margin:4px 0 14px;padding:9px 12px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.addagent-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.addagent-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:14px;font-weight:500;cursor:pointer;transition:background .12s,opacity .12s}.addagent-btn--ghost{background:none;border-color:hsl(var(--border));color:hsl(var(--foreground))}.addagent-btn--ghost:hover{background:hsl(var(--foreground) / .05)}.addagent-btn--primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.addagent-btn--primary:hover:not(:disabled){opacity:.88}.addagent-btn:disabled{opacity:.4;cursor:default}.addagent-btn .icon{width:15px;height:15px}.search{flex:1;min-height:0;display:flex;flex-direction:column;width:100%;max-width:720px;margin:0 auto;padding:28px 16px 16px}.search-box{position:relative;display:flex;align-items:center;gap:0;padding:5px 6px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));transition:border-color .16s,box-shadow .16s}.search-box:focus-within{border-color:hsl(var(--foreground) / .3);box-shadow:0 0 0 3px hsl(var(--foreground) / .035)}.search-source-picker-wrap{position:relative;flex:0 0 auto}.search-source-picker{display:inline-flex;align-items:center;gap:5px;max-width:176px;height:34px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;cursor:pointer}.search-source-picker:hover,.search-source-picker[aria-expanded=true]{background:hsl(var(--foreground) / .045)}.search-source-picker>span{flex:0 0 auto;font-size:13px;font-weight:550}.search-source-picker>small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.search-source-chevron{width:12px;height:12px;flex:0 0 auto;color:hsl(var(--muted-foreground));transition:transform .15s ease}.search-source-chevron.open{transform:rotate(180deg)}.search-source-menu{position:absolute;z-index:30;top:calc(100% + 9px);left:-6px;display:flex;width:224px;padding:5px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .1);flex-direction:column}.search-source-menu>button{display:flex;min-width:0;padding:8px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;flex-direction:column;gap:2px}.search-source-menu>button:hover:not(:disabled),.search-source-menu>button[aria-selected=true]{background:hsl(var(--foreground) / .055)}.search-source-menu>button:disabled{color:hsl(var(--muted-foreground));cursor:default}.search-source-menu>button>span{font-size:12.5px;font-weight:550}.search-source-menu>button>small{overflow:hidden;max-width:100%;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.search-box-divider{width:1px;height:18px;margin:0 11px 0 5px;background:hsl(var(--border))}.search-input{flex:1;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px}.search-input::placeholder{color:hsl(var(--muted-foreground))}.search-input:disabled{cursor:default}.search-go{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.search-go:hover:not(:disabled){opacity:.85}.search-go:active:not(:disabled){transform:scale(.94)}.search-go:disabled{opacity:.3;cursor:default}.search-go .icon{width:17px;height:17px}.search-results{flex:1;min-height:0;overflow-y:auto;margin-top:12px;display:flex;flex-direction:column;gap:4px}.search-empty{padding:40px 8px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.search-result{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:12px 14px;border:none;border-radius:12px;background:none;color:hsl(var(--foreground));font:inherit;cursor:pointer;transition:background .12s}.search-result:hover{background:hsl(var(--foreground) / .05)}.search-result-static{cursor:default;border:1px solid transparent}.search-result-static:hover{border-color:hsl(var(--border));background:hsl(var(--foreground) / .025)}a.search-result{text-decoration:none;color:inherit}.search-result-ext{width:12px;height:12px;margin-left:4px;vertical-align:-1px;opacity:.6}.search-result-icon{width:16px;height:16px;flex-shrink:0;margin-top:2px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.search-result-body{min-width:0;flex:1}.search-result-head{display:flex;align-items:baseline;gap:10px;justify-content:space-between}.search-result-title{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-result-meta{flex-shrink:0;font-size:11.5px;color:hsl(var(--muted-foreground))}.search-result-snippet{margin-top:3px;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground));display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.search-result-snippet-expanded{-webkit-line-clamp:4;white-space:pre-wrap;overflow-wrap:anywhere}.login{position:fixed;top:10px;right:10px;bottom:10px;left:10px;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;display:flex;flex-direction:column;background:hsl(var(--panel));color:hsl(var(--foreground))}.login-top{padding:18px 24px}.login-brand{display:inline-flex;align-items:center;gap:9px;font-weight:600;font-size:15px;letter-spacing:-.01em}.login-main{flex:1;display:flex;align-items:center;justify-content:center;padding:0 24px}.login-card{width:100%;max-width:420px}.login-title{margin:0 0 14px;font-size:28px;font-weight:700;line-height:1.2;letter-spacing:-.02em}.login-sub{margin:0 0 28px;color:hsl(var(--muted-foreground));font-size:15px}.login-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:14px 18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer;transition:background .15s,border-color .15s,transform .1s}.login-btn:hover{background:hsl(var(--accent));border-color:hsl(var(--ring) / .3)}.login-btn:active{transform:scale(.99)}.login-btn .icon{width:18px;height:18px}.login-powered{margin:18px 0 0;font-size:12px;color:hsl(var(--muted-foreground))}.login-legal{margin:6px 0 0;font-size:12px;color:hsl(var(--muted-foreground))}.login-legal a{color:inherit;font-weight:600;text-decoration:underline;text-decoration-color:hsl(var(--muted-foreground) / .45);text-underline-offset:2px}.login-legal a:hover{color:hsl(var(--foreground))}.login-footer{padding:18px 24px;text-align:center;font-size:12px;color:hsl(var(--muted-foreground))}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}.login-providers{display:flex;flex-direction:column;gap:10px}.login-provider-error{display:flex;flex-direction:column;align-items:flex-start;gap:12px;color:hsl(var(--destructive));font-size:13px}.login-provider-error p{margin:0}.login-name{display:flex;align-items:center;gap:8px}.login-name-input{flex:1;border:1px solid hsl(var(--border));border-radius:14px;padding:13px 16px;font:inherit;font-size:15px;background:hsl(var(--background));color:hsl(var(--foreground))}.login-name-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.login-name-go{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s}.login-name-go .icon{width:18px;height:18px}.login-name-go:disabled{opacity:.35;cursor:default}.login-hint{margin:8px 0 0;min-height:16px;line-height:16px;font-size:12px;color:hsl(var(--destructive))}.session-loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .6);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.main{position:relative}.topo{position:absolute;top:68px;right:18px;width:220px;max-height:calc(100% - 150px);overflow-y:auto;padding:12px;background:hsl(var(--canvas));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 4px 16px #0000000a;z-index:2}.topo-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}.topo-head-title{font-size:12px;font-weight:650;letter-spacing:.02em}.topo-head-sub{font-size:11px;color:hsl(var(--muted-foreground))}.topo-tree{display:flex;flex-direction:column;gap:4px}.topo-children{display:flex;flex-direction:column;gap:4px;margin-top:4px;margin-left:10px;padding-left:8px;border-left:1px solid hsl(var(--border))}.topo-node{display:flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));font-size:12px;transition:border-color .15s ease,background .15s ease,opacity .15s ease}.topo-icon{width:14px;height:14px;flex-shrink:0;opacity:.8}.topo-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.topo-badge{flex-shrink:0;font-size:10px;padding:1px 5px;border-radius:5px;background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.topo-node.is-active{border-color:hsl(var(--primary));background:hsl(var(--primary) / .08);animation:topo-pulse 1.4s ease-in-out infinite}.topo-node.is-active .topo-icon{opacity:1}.topo-node.is-onpath{border-color:hsl(var(--primary) / .4);background:hsl(var(--primary) / .04)}.topo-node.is-done{opacity:.55}.topo-remote{margin:3px 0 2px 22px;font-size:10.5px;color:hsl(var(--primary));animation:topo-blink 1.2s ease-in-out infinite}@keyframes topo-blink{0%,to{opacity:1}50%{opacity:.45}}.topo-path{display:flex;flex-wrap:wrap;align-items:center;gap:1px;margin-bottom:9px;padding:6px 8px;border-radius:7px;background:hsl(var(--primary) / .05);font-size:11px;line-height:1.4}.topo-path-seg{display:inline-flex;align-items:center;min-width:0}.topo-path-sep{width:12px;height:12px;flex-shrink:0;color:hsl(var(--muted-foreground))}.topo-path-name{color:hsl(var(--muted-foreground))}.topo-path-name.is-current{color:hsl(var(--primary));font-weight:600}@keyframes topo-pulse{0%,to{box-shadow:0 0 hsl(var(--primary) / .28)}50%{box-shadow:0 0 0 4px hsl(var(--primary) / 0)}}@media (max-width: 1200px){.topo{display:none}}.quick-create{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.qc-head{text-align:center;margin-bottom:28px}.qc-title{margin:0;font-size:26px;font-weight:650;letter-spacing:-.02em}.qc-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.qc-cards{display:grid;grid-template-columns:repeat(4,220px);justify-content:center;gap:16px}@media (max-width: 1240px){.qc-cards{grid-template-columns:repeat(2,220px)}}@media (max-width: 560px){.qc-cards{grid-template-columns:minmax(0,320px)}}.qc-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:20px;text-align:left;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--card));cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s}.qc-card:hover{border-color:hsl(var(--ring) / .35);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.qc-card-arrow{position:absolute;top:18px;right:18px;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.qc-card:hover .qc-card-arrow{opacity:1;transform:translate(0)}.qc-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;margin-bottom:6px;border-radius:12px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.qc-icon svg{width:20px;height:20px}.qc-card-title{font-size:15px;font-weight:600}.qc-card-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.navbar-title{min-width:0;max-width:min(60vw,640px);overflow:hidden;padding:0;font-size:15px;font-weight:600;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.create-stub{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:hsl(var(--muted-foreground))}.create-back{align-self:flex-start;margin:12px;border:none;background:none;font:inherit;font-size:13px;color:hsl(var(--muted-foreground));cursor:pointer}.create-back:hover{color:hsl(var(--foreground))}.navbar-crumbs{display:flex;align-items:center;gap:4px;min-width:0}.navbar-crumbs>.crumb:first-child{padding-left:0}.crumb{font-size:15px;font-weight:600;letter-spacing:-.01em;padding:2px 4px;border-radius:6px;white-space:nowrap}.crumb-link{border:none;background:none;font:inherit;font-weight:500;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.crumb-link:hover{color:hsl(var(--foreground));background:hsl(var(--foreground) / .05)}.crumb-current{color:hsl(var(--foreground))}.crumb-sep{width:15px;height:15px;color:hsl(var(--muted-foreground));flex-shrink:0}.confirm-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;display:flex;align-items:center;justify-content:center;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.confirm-box{width:340px;max-width:calc(100vw - 32px);padding:20px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:14px;box-shadow:0 16px 48px -16px hsl(var(--foreground) / .3)}.confirm-title{font-size:15px;font-weight:600;margin-bottom:6px}.confirm-text{font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground));margin-bottom:18px}.confirm-actions{display:flex;justify-content:flex-end;gap:8px}.confirm-btn{padding:7px 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s}.confirm-btn:hover{background:hsl(var(--foreground) / .05)}.confirm-btn--danger{border-color:transparent;background:hsl(var(--destructive));color:#fff}.confirm-btn--danger:hover{background:hsl(var(--destructive) / .9)} diff --git a/veadk/webui/assets/index-gtSqVSNF.js b/veadk/webui/assets/index-CGGQQgcg.js similarity index 79% rename from veadk/webui/assets/index-gtSqVSNF.js rename to veadk/webui/assets/index-CGGQQgcg.js index 7dbf923b..7e538d71 100644 --- a/veadk/webui/assets/index-gtSqVSNF.js +++ b/veadk/webui/assets/index-CGGQQgcg.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-CwT7JlSU.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-BBPnStN4.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); var PP=Object.defineProperty;var jP=(e,t,n)=>t in e?PP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var cw=(e,t,n)=>jP(e,typeof t!="symbol"?t+"":t,n);function BP(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Ah=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var SS={exports:{}},Up={},AS={exports:{}},at={};/** * @license React * react.production.min.js @@ -7,7 +7,7 @@ var PP=Object.defineProperty;var jP=(e,t,n)=>t in e?PP(e,t,{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 nd=Symbol.for("react.element"),FP=Symbol.for("react.portal"),UP=Symbol.for("react.fragment"),$P=Symbol.for("react.strict_mode"),HP=Symbol.for("react.profiler"),zP=Symbol.for("react.provider"),VP=Symbol.for("react.context"),KP=Symbol.for("react.forward_ref"),YP=Symbol.for("react.suspense"),WP=Symbol.for("react.memo"),qP=Symbol.for("react.lazy"),uw=Symbol.iterator;function GP(e){return e===null||typeof e!="object"?null:(e=uw&&e[uw]||e["@@iterator"],typeof e=="function"?e:null)}var CS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},IS=Object.assign,RS={};function Ll(e,t,n){this.props=e,this.context=t,this.refs=RS,this.updater=n||CS}Ll.prototype.isReactComponent={};Ll.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ll.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function OS(){}OS.prototype=Ll.prototype;function Q1(e,t,n){this.props=e,this.context=t,this.refs=RS,this.updater=n||CS}var Z1=Q1.prototype=new OS;Z1.constructor=Q1;IS(Z1,Ll.prototype);Z1.isPureReactComponent=!0;var dw=Array.isArray,LS=Object.prototype.hasOwnProperty,J1={current:null},MS={key:!0,ref:!0,__self:!0,__source:!0};function DS(e,t,n){var r,s={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)LS.call(t,r)&&!MS.hasOwnProperty(r)&&(s[r]=t[r]);var o=arguments.length-2;if(o===1)s.children=n;else if(1t in e?PP(e,t,{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 e4=v,t4=Symbol.for("react.element"),n4=Symbol.for("react.fragment"),r4=Object.prototype.hasOwnProperty,s4=e4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i4={key:!0,ref:!0,__self:!0,__source:!0};function jS(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)r4.call(t,r)&&!i4.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:t4,type:e,key:i,ref:a,props:s,_owner:s4.current}}Up.Fragment=n4;Up.jsx=jS;Up.jsxs=jS;SS.exports=Up;var c=SS.exports,z0={},BS={exports:{}},Pr={},FS={exports:{}},US={};/** + */var e4=v,t4=Symbol.for("react.element"),n4=Symbol.for("react.fragment"),r4=Object.prototype.hasOwnProperty,s4=e4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i4={key:!0,ref:!0,__self:!0,__source:!0};function jS(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)r4.call(t,r)&&!i4.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:t4,type:e,key:i,ref:a,props:s,_owner:s4.current}}Up.Fragment=n4;Up.jsx=jS;Up.jsxs=jS;SS.exports=Up;var c=SS.exports,H0={},BS={exports:{}},Pr={},FS={exports:{}},US={};/** * @license React * scheduler.production.min.js * @@ -23,7 +23,7 @@ var PP=Object.defineProperty;var jP=(e,t,n)=>t in e?PP(e,t,{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. - */(function(e){function t(O,j){var S=O.length;O.push(j);e:for(;0>>1,V=O[H];if(0>>1;Hs(ee,S))res(de,ee)?(O[H]=de,O[re]=S,H=re):(O[H]=ee,O[ne]=S,H=ne);else if(res(de,S))O[H]=de,O[re]=S,H=re;else break e}}return j}function s(O,j){var S=O.sortIndex-j.sortIndex;return S!==0?S:O.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,f=null,h=3,p=!1,m=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(O){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=O)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function _(O){if(y=!1,b(O),!m)if(n(l)!==null)m=!0,C(N);else{var j=n(u);j!==null&&L(_,j.startTime-O)}}function N(O,j){m=!1,y&&(y=!1,g(k),k=-1),p=!0;var S=h;try{for(b(j),f=n(l);f!==null&&(!(f.expirationTime>j)||O&&!M());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var V=H(f.expirationTime<=j);j=e.unstable_now(),typeof V=="function"?f.callback=V:f===n(l)&&r(l),b(j)}else r(l);f=n(l)}if(f!==null)var D=!0;else{var ne=n(u);ne!==null&&L(_,ne.startTime-j),D=!1}return D}finally{f=null,h=S,p=!1}}var T=!1,A=null,k=-1,R=5,I=-1;function M(){return!(e.unstable_now()-IO||125H?(O.sortIndex=S,t(u,O),n(l)===null&&O===n(u)&&(y?(g(k),k=-1):y=!0,L(_,S-H))):(O.sortIndex=V,t(l,O),m||p||(m=!0,C(N))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var j=h;return function(){var S=h;h=j;try{return O.apply(this,arguments)}finally{h=S}}}})(US);FS.exports=US;var a4=FS.exports;/** + */(function(e){function t(O,j){var S=O.length;O.push(j);e:for(;0>>1,V=O[H];if(0>>1;Hs(ee,S))res(de,ee)?(O[H]=de,O[re]=S,H=re):(O[H]=ee,O[ne]=S,H=ne);else if(res(de,S))O[H]=de,O[re]=S,H=re;else break e}}return j}function s(O,j){var S=O.sortIndex-j.sortIndex;return S!==0?S:O.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,f=null,h=3,p=!1,m=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(O){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=O)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function _(O){if(y=!1,b(O),!m)if(n(l)!==null)m=!0,C(k);else{var j=n(u);j!==null&&L(_,j.startTime-O)}}function k(O,j){m=!1,y&&(y=!1,g(N),N=-1),p=!0;var S=h;try{for(b(j),f=n(l);f!==null&&(!(f.expirationTime>j)||O&&!M());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var V=H(f.expirationTime<=j);j=e.unstable_now(),typeof V=="function"?f.callback=V:f===n(l)&&r(l),b(j)}else r(l);f=n(l)}if(f!==null)var D=!0;else{var ne=n(u);ne!==null&&L(_,ne.startTime-j),D=!1}return D}finally{f=null,h=S,p=!1}}var T=!1,A=null,N=-1,R=5,I=-1;function M(){return!(e.unstable_now()-IO||125H?(O.sortIndex=S,t(u,O),n(l)===null&&O===n(u)&&(y?(g(N),N=-1):y=!0,L(_,S-H))):(O.sortIndex=V,t(l,O),m||p||(m=!0,C(k))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var j=h;return function(){var S=h;h=j;try{return O.apply(this,arguments)}finally{h=S}}}})(US);FS.exports=US;var a4=FS.exports;/** * @license React * react-dom.production.min.js * @@ -31,14 +31,14 @@ var PP=Object.defineProperty;var jP=(e,t,n)=>t in e?PP(e,t,{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 o4=v,Lr=a4;function me(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V0=Object.prototype.hasOwnProperty,l4=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hw={},pw={};function c4(e){return V0.call(pw,e)?!0:V0.call(hw,e)?!1:l4.test(e)?pw[e]=!0:(hw[e]=!0,!1)}function u4(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function d4(e,t,n,r){if(t===null||typeof t>"u"||u4(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function dr(e,t,n,r,s,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var $n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$n[e]=new dr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$n[t]=new dr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$n[e]=new dr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$n[e]=new dr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$n[e]=new dr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$n[e]=new dr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$n[e]=new dr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$n[e]=new dr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$n[e]=new dr(e,5,!1,e.toLowerCase(),null,!1,!1)});var tb=/[\-:]([a-z])/g;function nb(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(tb,nb);$n[t]=new dr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(tb,nb);$n[t]=new dr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(tb,nb);$n[t]=new dr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$n[e]=new dr(e,1,!1,e.toLowerCase(),null,!1,!1)});$n.xlinkHref=new dr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$n[e]=new dr(e,1,!1,e.toLowerCase(),null,!0,!0)});function rb(e,t,n,r){var s=$n.hasOwnProperty(t)?$n[t]:null;(s!==null?s.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),z0=Object.prototype.hasOwnProperty,l4=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hw={},pw={};function c4(e){return z0.call(pw,e)?!0:z0.call(hw,e)?!1:l4.test(e)?pw[e]=!0:(hw[e]=!0,!1)}function u4(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function d4(e,t,n,r){if(t===null||typeof t>"u"||u4(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function dr(e,t,n,r,s,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var $n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$n[e]=new dr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$n[t]=new dr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$n[e]=new dr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$n[e]=new dr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$n[e]=new dr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$n[e]=new dr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$n[e]=new dr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$n[e]=new dr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$n[e]=new dr(e,5,!1,e.toLowerCase(),null,!1,!1)});var eb=/[\-:]([a-z])/g;function tb(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(eb,tb);$n[t]=new dr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(eb,tb);$n[t]=new dr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(eb,tb);$n[t]=new dr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$n[e]=new dr(e,1,!1,e.toLowerCase(),null,!1,!1)});$n.xlinkHref=new dr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$n[e]=new dr(e,1,!1,e.toLowerCase(),null,!0,!0)});function nb(e,t,n,r){var s=$n.hasOwnProperty(t)?$n[t]:null;(s!==null?s.type!==0:r||!(2o||s[a]!==i[o]){var l=` -`+s[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{ng=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Tc(e):""}function f4(e){switch(e.tag){case 5:return Tc(e.type);case 16:return Tc("Lazy");case 13:return Tc("Suspense");case 19:return Tc("SuspenseList");case 0:case 2:case 15:return e=rg(e.type,!1),e;case 11:return e=rg(e.type.render,!1),e;case 1:return e=rg(e.type,!0),e;default:return""}}function q0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case To:return"Fragment";case _o:return"Portal";case K0:return"Profiler";case sb:return"StrictMode";case Y0:return"Suspense";case W0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zS:return(e.displayName||"Context")+".Consumer";case HS:return(e._context.displayName||"Context")+".Provider";case ib:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ab:return t=e.displayName||null,t!==null?t:q0(e.type)||"Memo";case _i:t=e._payload,e=e._init;try{return q0(e(t))}catch{}}return null}function h4(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q0(t);case 8:return t===sb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function KS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p4(e){var t=KS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gd(e){e._valueTracker||(e._valueTracker=p4(e))}function YS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=KS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ch(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function G0(e,t){var n=t.checked;return sn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Yi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function WS(e,t){t=t.checked,t!=null&&rb(e,"checked",t,!1)}function X0(e,t){WS(e,t);var n=Yi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Q0(e,t.type,n):t.hasOwnProperty("defaultValue")&&Q0(e,t.type,Yi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Q0(e,t,n){(t!=="number"||Ch(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nc=Array.isArray;function Yo(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Xd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function du(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},m4=["Webkit","ms","Moz","O"];Object.keys(Pc).forEach(function(e){m4.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pc[t]=Pc[e]})});function QS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pc.hasOwnProperty(e)&&Pc[e]?(""+t).trim():t+"px"}function ZS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=QS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var g4=sn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ey(e,t){if(t){if(g4[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function ty(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ny=null;function ob(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ry=null,Wo=null,qo=null;function xw(e){if(e=id(e)){if(typeof ry!="function")throw Error(me(280));var t=e.stateNode;t&&(t=Kp(t),ry(e.stateNode,e.type,t))}}function JS(e){Wo?qo?qo.push(e):qo=[e]:Wo=e}function e2(){if(Wo){var e=Wo,t=qo;if(qo=Wo=null,xw(e),t)for(e=0;e>>=0,e===0?32:31-(S4(e)/A4|0)|0}var Qd=64,Zd=4194304;function kc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Lh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~s;o!==0?r=kc(o):(i&=a,i!==0&&(r=kc(i)))}else a=n&~s,a!==0?r=kc(a):i!==0&&(r=kc(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function rd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-us(t),e[t]=n}function O4(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Bc),Cw=" ",Iw=!1;function x2(e,t){switch(e){case"keyup":return a6.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function w2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var No=!1;function l6(e,t){switch(e){case"compositionend":return w2(t);case"keypress":return t.which!==32?null:(Iw=!0,Cw);case"textInput":return e=t.data,e===Cw&&Iw?null:e;default:return null}}function c6(e,t){if(No)return e==="compositionend"||!mb&&x2(e,t)?(e=b2(),Xf=fb=Ii=null,No=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mw(n)}}function N2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?N2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function k2(){for(var e=window,t=Ch();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ch(e.document)}return t}function gb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function b6(e){var t=k2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&N2(n.ownerDocument.documentElement,n)){if(r!==null&&gb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Dw(n,i);var a=Dw(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ko=null,cy=null,Uc=null,uy=!1;function Pw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uy||ko==null||ko!==Ch(r)||(r=ko,"selectionStart"in r&&gb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Uc&&yu(Uc,r)||(Uc=r,r=Ph(cy,"onSelect"),0Co||(e.current=gy[Co],gy[Co]=null,Co--)}function Pt(e,t){Co++,gy[Co]=e.current,e.current=t}var Wi={},Qn=Zi(Wi),br=Zi(!1),Pa=Wi;function al(e,t){var n=e.type.contextTypes;if(!n)return Wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Er(e){return e=e.childContextTypes,e!=null}function Bh(){Ut(br),Ut(Qn)}function zw(e,t,n){if(Qn.current!==Wi)throw Error(me(168));Pt(Qn,t),Pt(br,n)}function D2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(me(108,h4(e)||"Unknown",s));return sn({},n,r)}function Fh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wi,Pa=Qn.current,Pt(Qn,e),Pt(br,br.current),!0}function Vw(e,t,n){var r=e.stateNode;if(!r)throw Error(me(169));n?(e=D2(e,t,Pa),r.__reactInternalMemoizedMergedChildContext=e,Ut(br),Ut(Qn),Pt(Qn,e)):Ut(br),Pt(br,n)}var Ws=null,Yp=!1,yg=!1;function P2(e){Ws===null?Ws=[e]:Ws.push(e)}function I6(e){Yp=!0,P2(e)}function Ji(){if(!yg&&Ws!==null){yg=!0;var e=0,t=xt;try{var n=Ws;for(xt=1;e>=a,s-=a,Gs=1<<32-us(t)+s|n<k?(R=A,A=null):R=A.sibling;var I=h(g,A,b[k],_);if(I===null){A===null&&(A=R);break}e&&A&&I.alternate===null&&t(g,A),E=i(I,E,k),T===null?N=I:T.sibling=I,T=I,A=R}if(k===b.length)return n(g,A),qt&&da(g,k),N;if(A===null){for(;kk?(R=A,A=null):R=A.sibling;var M=h(g,A,I.value,_);if(M===null){A===null&&(A=R);break}e&&A&&M.alternate===null&&t(g,A),E=i(M,E,k),T===null?N=M:T.sibling=M,T=M,A=R}if(I.done)return n(g,A),qt&&da(g,k),N;if(A===null){for(;!I.done;k++,I=b.next())I=f(g,I.value,_),I!==null&&(E=i(I,E,k),T===null?N=I:T.sibling=I,T=I);return qt&&da(g,k),N}for(A=r(g,A);!I.done;k++,I=b.next())I=p(A,g,k,I.value,_),I!==null&&(e&&I.alternate!==null&&A.delete(I.key===null?k:I.key),E=i(I,E,k),T===null?N=I:T.sibling=I,T=I);return e&&A.forEach(function(B){return t(g,B)}),qt&&da(g,k),N}function w(g,E,b,_){if(typeof b=="object"&&b!==null&&b.type===To&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case qd:e:{for(var N=b.key,T=E;T!==null;){if(T.key===N){if(N=b.type,N===To){if(T.tag===7){n(g,T.sibling),E=s(T,b.props.children),E.return=g,g=E;break e}}else if(T.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===_i&&Ww(N)===T.type){n(g,T.sibling),E=s(T,b.props),E.ref=oc(g,T,b),E.return=g,g=E;break e}n(g,T);break}else t(g,T);T=T.sibling}b.type===To?(E=Ca(b.props.children,g.mode,_,b.key),E.return=g,g=E):(_=sh(b.type,b.key,b.props,null,g.mode,_),_.ref=oc(g,E,b),_.return=g,g=_)}return a(g);case _o:e:{for(T=b.key;E!==null;){if(E.key===T)if(E.tag===4&&E.stateNode.containerInfo===b.containerInfo&&E.stateNode.implementation===b.implementation){n(g,E.sibling),E=s(E,b.children||[]),E.return=g,g=E;break e}else{n(g,E);break}else t(g,E);E=E.sibling}E=Ng(b,g.mode,_),E.return=g,g=E}return a(g);case _i:return T=b._init,w(g,E,T(b._payload),_)}if(Nc(b))return m(g,E,b,_);if(nc(b))return y(g,E,b,_);af(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,E!==null&&E.tag===6?(n(g,E.sibling),E=s(E,b),E.return=g,g=E):(n(g,E),E=Tg(b,g.mode,_),E.return=g,g=E),a(g)):n(g,E)}return w}var ll=U2(!0),$2=U2(!1),Hh=Zi(null),zh=null,Oo=null,xb=null;function wb(){xb=Oo=zh=null}function vb(e){var t=Hh.current;Ut(Hh),e._currentValue=t}function Ey(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Xo(e,t){zh=e,xb=Oo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gr=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if(xb!==e)if(e={context:e,memoizedValue:t,next:null},Oo===null){if(zh===null)throw Error(me(308));Oo=e,zh.dependencies={lanes:0,firstContext:e}}else Oo=Oo.next=e;return t}var wa=null;function _b(e){wa===null?wa=[e]:wa.push(e)}function H2(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,_b(t)):(n.next=s.next,s.next=n),t.interleaved=n,oi(e,r)}function oi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ti=!1;function Tb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function z2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ti(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ht&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,oi(e,n)}return s=r.interleaved,s===null?(t.next=t,_b(r)):(t.next=s.next,s.next=t),r.interleaved=t,oi(e,n)}function Zf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cb(e,n)}}function qw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vh(e,t,n,r){var s=e.updateQueue;Ti=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?i=u:a.next=u,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;a=0,d=u=l=null,o=i;do{var h=o.lane,p=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,y=o;switch(h=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=sn({},f,h);break e;case 2:Ti=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,l=f):d=d.next=p,a|=h;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;h=o,o=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Fa|=a,e.lanes=a,e.memoizedState=f}}function Gw(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Eg.transition;Eg.transition={};try{e(!1),t()}finally{xt=n,Eg.transition=r}}function aA(){return Gr().memoizedState}function M6(e,t,n){var r=Ui(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},oA(e))lA(t,n);else if(n=H2(e,t,n,r),n!==null){var s=lr();ds(n,e,r,s),cA(n,t,r)}}function D6(e,t,n){var r=Ui(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(oA(e))lA(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,ps(o,a)){var l=t.interleaved;l===null?(s.next=s,_b(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=H2(e,t,s,r),n!==null&&(s=lr(),ds(n,e,r,s),cA(n,t,r))}}function oA(e){var t=e.alternate;return e===rn||t!==null&&t===rn}function lA(e,t){$c=Yh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cb(e,n)}}var Wh={readContext:qr,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useInsertionEffect:Vn,useLayoutEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useMutableSource:Vn,useSyncExternalStore:Vn,useId:Vn,unstable_isNewReconciler:!1},P6={readContext:qr,useCallback:function(e,t){return Ns().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:Qw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,eh(4194308,4,tA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return eh(4194308,4,e,t)},useInsertionEffect:function(e,t){return eh(4,2,e,t)},useMemo:function(e,t){var n=Ns();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ns();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=M6.bind(null,rn,e),[r.memoizedState,e]},useRef:function(e){var t=Ns();return e={current:e},t.memoizedState=e},useState:Xw,useDebugValue:Ob,useDeferredValue:function(e){return Ns().memoizedState=e},useTransition:function(){var e=Xw(!1),t=e[0];return e=L6.bind(null,e[1]),Ns().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=rn,s=Ns();if(qt){if(n===void 0)throw Error(me(407));n=n()}else{if(n=t(),Mn===null)throw Error(me(349));Ba&30||W2(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Qw(G2.bind(null,r,i,e),[e]),r.flags|=2048,Nu(9,q2.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ns(),t=Mn.identifierPrefix;if(qt){var n=Xs,r=Gs;n=(r&~(1<<32-us(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_u++,0")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{tg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Tc(e):""}function f4(e){switch(e.tag){case 5:return Tc(e.type);case 16:return Tc("Lazy");case 13:return Tc("Suspense");case 19:return Tc("SuspenseList");case 0:case 2:case 15:return e=ng(e.type,!1),e;case 11:return e=ng(e.type.render,!1),e;case 1:return e=ng(e.type,!0),e;default:return""}}function W0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case To:return"Fragment";case _o:return"Portal";case V0:return"Profiler";case rb:return"StrictMode";case K0:return"Suspense";case Y0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zS:return(e.displayName||"Context")+".Consumer";case HS:return(e._context.displayName||"Context")+".Provider";case sb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ib:return t=e.displayName||null,t!==null?t:W0(e.type)||"Memo";case _i:t=e._payload,e=e._init;try{return W0(e(t))}catch{}}return null}function h4(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return W0(t);case 8:return t===rb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function KS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p4(e){var t=KS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gd(e){e._valueTracker||(e._valueTracker=p4(e))}function YS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=KS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ch(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function q0(e,t){var n=t.checked;return sn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Yi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function WS(e,t){t=t.checked,t!=null&&nb(e,"checked",t,!1)}function G0(e,t){WS(e,t);var n=Yi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?X0(e,t.type,n):t.hasOwnProperty("defaultValue")&&X0(e,t.type,Yi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function X0(e,t,n){(t!=="number"||Ch(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kc=Array.isArray;function Yo(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Xd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function du(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},m4=["Webkit","ms","Moz","O"];Object.keys(Pc).forEach(function(e){m4.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pc[t]=Pc[e]})});function QS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pc.hasOwnProperty(e)&&Pc[e]?(""+t).trim():t+"px"}function ZS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=QS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var g4=sn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function J0(e,t){if(t){if(g4[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function ey(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ty=null;function ab(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ny=null,Wo=null,qo=null;function xw(e){if(e=id(e)){if(typeof ny!="function")throw Error(me(280));var t=e.stateNode;t&&(t=Kp(t),ny(e.stateNode,e.type,t))}}function JS(e){Wo?qo?qo.push(e):qo=[e]:Wo=e}function e2(){if(Wo){var e=Wo,t=qo;if(qo=Wo=null,xw(e),t)for(e=0;e>>=0,e===0?32:31-(S4(e)/A4|0)|0}var Qd=64,Zd=4194304;function Nc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Lh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~s;o!==0?r=Nc(o):(i&=a,i!==0&&(r=Nc(i)))}else a=n&~s,a!==0?r=Nc(a):i!==0&&(r=Nc(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function rd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-us(t),e[t]=n}function O4(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Bc),Cw=" ",Iw=!1;function x2(e,t){switch(e){case"keyup":return a6.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function w2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ko=!1;function l6(e,t){switch(e){case"compositionend":return w2(t);case"keypress":return t.which!==32?null:(Iw=!0,Cw);case"textInput":return e=t.data,e===Cw&&Iw?null:e;default:return null}}function c6(e,t){if(ko)return e==="compositionend"||!pb&&x2(e,t)?(e=b2(),Xf=db=Ii=null,ko=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mw(n)}}function k2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?k2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function N2(){for(var e=window,t=Ch();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ch(e.document)}return t}function mb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function b6(e){var t=N2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&k2(n.ownerDocument.documentElement,n)){if(r!==null&&mb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Dw(n,i);var a=Dw(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,No=null,ly=null,Uc=null,cy=!1;function Pw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cy||No==null||No!==Ch(r)||(r=No,"selectionStart"in r&&mb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Uc&&yu(Uc,r)||(Uc=r,r=Ph(ly,"onSelect"),0Co||(e.current=my[Co],my[Co]=null,Co--)}function Pt(e,t){Co++,my[Co]=e.current,e.current=t}var Wi={},Xn=Zi(Wi),br=Zi(!1),Pa=Wi;function al(e,t){var n=e.type.contextTypes;if(!n)return Wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Er(e){return e=e.childContextTypes,e!=null}function Bh(){Ut(br),Ut(Xn)}function zw(e,t,n){if(Xn.current!==Wi)throw Error(me(168));Pt(Xn,t),Pt(br,n)}function D2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(me(108,h4(e)||"Unknown",s));return sn({},n,r)}function Fh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wi,Pa=Xn.current,Pt(Xn,e),Pt(br,br.current),!0}function Vw(e,t,n){var r=e.stateNode;if(!r)throw Error(me(169));n?(e=D2(e,t,Pa),r.__reactInternalMemoizedMergedChildContext=e,Ut(br),Ut(Xn),Pt(Xn,e)):Ut(br),Pt(br,n)}var Ws=null,Yp=!1,gg=!1;function P2(e){Ws===null?Ws=[e]:Ws.push(e)}function I6(e){Yp=!0,P2(e)}function Ji(){if(!gg&&Ws!==null){gg=!0;var e=0,t=xt;try{var n=Ws;for(xt=1;e>=a,s-=a,Gs=1<<32-us(t)+s|n<N?(R=A,A=null):R=A.sibling;var I=h(g,A,b[N],_);if(I===null){A===null&&(A=R);break}e&&A&&I.alternate===null&&t(g,A),E=i(I,E,N),T===null?k=I:T.sibling=I,T=I,A=R}if(N===b.length)return n(g,A),qt&&da(g,N),k;if(A===null){for(;NN?(R=A,A=null):R=A.sibling;var M=h(g,A,I.value,_);if(M===null){A===null&&(A=R);break}e&&A&&M.alternate===null&&t(g,A),E=i(M,E,N),T===null?k=M:T.sibling=M,T=M,A=R}if(I.done)return n(g,A),qt&&da(g,N),k;if(A===null){for(;!I.done;N++,I=b.next())I=f(g,I.value,_),I!==null&&(E=i(I,E,N),T===null?k=I:T.sibling=I,T=I);return qt&&da(g,N),k}for(A=r(g,A);!I.done;N++,I=b.next())I=p(A,g,N,I.value,_),I!==null&&(e&&I.alternate!==null&&A.delete(I.key===null?N:I.key),E=i(I,E,N),T===null?k=I:T.sibling=I,T=I);return e&&A.forEach(function(B){return t(g,B)}),qt&&da(g,N),k}function w(g,E,b,_){if(typeof b=="object"&&b!==null&&b.type===To&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case qd:e:{for(var k=b.key,T=E;T!==null;){if(T.key===k){if(k=b.type,k===To){if(T.tag===7){n(g,T.sibling),E=s(T,b.props.children),E.return=g,g=E;break e}}else if(T.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_i&&Ww(k)===T.type){n(g,T.sibling),E=s(T,b.props),E.ref=oc(g,T,b),E.return=g,g=E;break e}n(g,T);break}else t(g,T);T=T.sibling}b.type===To?(E=Ca(b.props.children,g.mode,_,b.key),E.return=g,g=E):(_=sh(b.type,b.key,b.props,null,g.mode,_),_.ref=oc(g,E,b),_.return=g,g=_)}return a(g);case _o:e:{for(T=b.key;E!==null;){if(E.key===T)if(E.tag===4&&E.stateNode.containerInfo===b.containerInfo&&E.stateNode.implementation===b.implementation){n(g,E.sibling),E=s(E,b.children||[]),E.return=g,g=E;break e}else{n(g,E);break}else t(g,E);E=E.sibling}E=Tg(b,g.mode,_),E.return=g,g=E}return a(g);case _i:return T=b._init,w(g,E,T(b._payload),_)}if(kc(b))return m(g,E,b,_);if(nc(b))return y(g,E,b,_);af(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,E!==null&&E.tag===6?(n(g,E.sibling),E=s(E,b),E.return=g,g=E):(n(g,E),E=_g(b,g.mode,_),E.return=g,g=E),a(g)):n(g,E)}return w}var ll=U2(!0),$2=U2(!1),Hh=Zi(null),zh=null,Oo=null,Eb=null;function xb(){Eb=Oo=zh=null}function wb(e){var t=Hh.current;Ut(Hh),e._currentValue=t}function by(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Xo(e,t){zh=e,Eb=Oo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gr=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if(Eb!==e)if(e={context:e,memoizedValue:t,next:null},Oo===null){if(zh===null)throw Error(me(308));Oo=e,zh.dependencies={lanes:0,firstContext:e}}else Oo=Oo.next=e;return t}var wa=null;function vb(e){wa===null?wa=[e]:wa.push(e)}function H2(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,vb(t)):(n.next=s.next,s.next=n),t.interleaved=n,oi(e,r)}function oi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ti=!1;function _b(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function z2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ti(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ht&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,oi(e,n)}return s=r.interleaved,s===null?(t.next=t,vb(r)):(t.next=s.next,s.next=t),r.interleaved=t,oi(e,n)}function Zf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lb(e,n)}}function qw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vh(e,t,n,r){var s=e.updateQueue;Ti=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?i=u:a.next=u,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;a=0,d=u=l=null,o=i;do{var h=o.lane,p=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,y=o;switch(h=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=sn({},f,h);break e;case 2:Ti=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,l=f):d=d.next=p,a|=h;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;h=o,o=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Fa|=a,e.lanes=a,e.memoizedState=f}}function Gw(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bg.transition;bg.transition={};try{e(!1),t()}finally{xt=n,bg.transition=r}}function aA(){return Gr().memoizedState}function M6(e,t,n){var r=Ui(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},oA(e))lA(t,n);else if(n=H2(e,t,n,r),n!==null){var s=or();ds(n,e,r,s),cA(n,t,r)}}function D6(e,t,n){var r=Ui(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(oA(e))lA(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,ps(o,a)){var l=t.interleaved;l===null?(s.next=s,vb(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=H2(e,t,s,r),n!==null&&(s=or(),ds(n,e,r,s),cA(n,t,r))}}function oA(e){var t=e.alternate;return e===rn||t!==null&&t===rn}function lA(e,t){$c=Yh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lb(e,n)}}var Wh={readContext:qr,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useInsertionEffect:Vn,useLayoutEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useMutableSource:Vn,useSyncExternalStore:Vn,useId:Vn,unstable_isNewReconciler:!1},P6={readContext:qr,useCallback:function(e,t){return ks().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:Qw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,eh(4194308,4,tA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return eh(4194308,4,e,t)},useInsertionEffect:function(e,t){return eh(4,2,e,t)},useMemo:function(e,t){var n=ks();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ks();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=M6.bind(null,rn,e),[r.memoizedState,e]},useRef:function(e){var t=ks();return e={current:e},t.memoizedState=e},useState:Xw,useDebugValue:Rb,useDeferredValue:function(e){return ks().memoizedState=e},useTransition:function(){var e=Xw(!1),t=e[0];return e=L6.bind(null,e[1]),ks().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=rn,s=ks();if(qt){if(n===void 0)throw Error(me(407));n=n()}else{if(n=t(),Mn===null)throw Error(me(349));Ba&30||W2(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Qw(G2.bind(null,r,i,e),[e]),r.flags|=2048,ku(9,q2.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ks(),t=Mn.identifierPrefix;if(qt){var n=Xs,r=Gs;n=(r&~(1<<32-us(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_u++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Cs]=t,e[xu]=r,EA(e,t,!1,!1),t.stateNode=e;e:{switch(a=ty(n,r),n){case"dialog":Ft("cancel",e),Ft("close",e),s=r;break;case"iframe":case"object":case"embed":Ft("load",e),s=r;break;case"video":case"audio":for(s=0;sdl&&(t.flags|=128,r=!0,lc(i,!1),t.lanes=4194304)}else{if(!r)if(e=Kh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!qt)return Kn(t),null}else 2*dn()-i.renderingStartTime>dl&&n!==1073741824&&(t.flags|=128,r=!0,lc(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=dn(),t.sibling=null,n=tn.current,Pt(tn,r?n&1|2:n&1),t):(Kn(t),null);case 22:case 23:return Bb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Sr&1073741824&&(Kn(t),t.subtreeFlags&6&&(t.flags|=8192)):Kn(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function V6(e,t){switch(bb(t),t.tag){case 1:return Er(t.type)&&Bh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cl(),Ut(br),Ut(Qn),Sb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return kb(t),null;case 13:if(Ut(tn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ut(tn),null;case 4:return cl(),null;case 10:return vb(t.type._context),null;case 22:case 23:return Bb(),null;case 24:return null;default:return null}}var lf=!1,Wn=!1,K6=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function Lo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ln(e,t,r)}else n.current=null}function Ay(e,t,n){try{n()}catch(r){ln(e,t,r)}}var lv=!1;function Y6(e,t){if(dy=Mh,e=k2(),gb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(o=a+s),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===s&&(o=a),h===i&&++d===r&&(l=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(fy={focusedElem:e,selectionRange:n},Mh=!1,Ae=t;Ae!==null;)if(t=Ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ae=e;else for(;Ae!==null;){t=Ae;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,w=m.memoizedState,g=t.stateNode,E=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:rs(t.type,y),w);g.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(_){ln(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Ae=e;break}Ae=t.return}return m=lv,lv=!1,m}function Hc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Ay(t,n,i)}s=s.next}while(s!==r)}}function Gp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Cy(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vA(e){var t=e.alternate;t!==null&&(e.alternate=null,vA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cs],delete t[xu],delete t[my],delete t[A6],delete t[C6])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function _A(e){return e.tag===5||e.tag===3||e.tag===4}function cv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_A(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Iy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=jh));else if(r!==4&&(e=e.child,e!==null))for(Iy(e,t,n),e=e.sibling;e!==null;)Iy(e,t,n),e=e.sibling}function Ry(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ry(e,t,n),e=e.sibling;e!==null;)Ry(e,t,n),e=e.sibling}var Bn=null,ss=!1;function gi(e,t,n){for(n=n.child;n!==null;)TA(e,t,n),n=n.sibling}function TA(e,t,n){if(Is&&typeof Is.onCommitFiberUnmount=="function")try{Is.onCommitFiberUnmount($p,n)}catch{}switch(n.tag){case 5:Wn||Lo(n,t);case 6:var r=Bn,s=ss;Bn=null,gi(e,t,n),Bn=r,ss=s,Bn!==null&&(ss?(e=Bn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Bn.removeChild(n.stateNode));break;case 18:Bn!==null&&(ss?(e=Bn,n=n.stateNode,e.nodeType===8?gg(e.parentNode,n):e.nodeType===1&&gg(e,n),mu(e)):gg(Bn,n.stateNode));break;case 4:r=Bn,s=ss,Bn=n.stateNode.containerInfo,ss=!0,gi(e,t,n),Bn=r,ss=s;break;case 0:case 11:case 14:case 15:if(!Wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Ay(n,t,a),s=s.next}while(s!==r)}gi(e,t,n);break;case 1:if(!Wn&&(Lo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ln(n,t,o)}gi(e,t,n);break;case 21:gi(e,t,n);break;case 22:n.mode&1?(Wn=(r=Wn)||n.memoizedState!==null,gi(e,t,n),Wn=r):gi(e,t,n);break;default:gi(e,t,n)}}function uv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new K6),t.forEach(function(r){var s=t5.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function es(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=dn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*q6(r/1960))-r,10e?16:e,Ri===null)var r=!1;else{if(e=Ri,Ri=null,Xh=0,ht&6)throw Error(me(331));var s=ht;for(ht|=4,Ae=e.current;Ae!==null;){var i=Ae,a=i.child;if(Ae.flags&16){var o=i.deletions;if(o!==null){for(var l=0;ldn()-Pb?Aa(e,0):Db|=n),xr(e,t)}function OA(e,t){t===0&&(e.mode&1?(t=Zd,Zd<<=1,!(Zd&130023424)&&(Zd=4194304)):t=1);var n=lr();e=oi(e,t),e!==null&&(rd(e,t,n),xr(e,n))}function e5(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),OA(e,n)}function t5(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(me(314))}r!==null&&r.delete(t),OA(e,n)}var LA;LA=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||br.current)gr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return gr=!1,H6(e,t,n);gr=!!(e.flags&131072)}else gr=!1,qt&&t.flags&1048576&&j2(t,$h,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;th(e,t),e=t.pendingProps;var s=al(t,Qn.current);Xo(t,n),s=Cb(null,t,r,e,s,n);var i=Ib();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Er(r)?(i=!0,Fh(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Tb(t),s.updater=qp,t.stateNode=s,s._reactInternals=t,wy(t,r,e,n),t=Ty(null,t,r,!0,i,n)):(t.tag=0,qt&&i&&yb(t),ir(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(th(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=r5(r),e=rs(r,e),s){case 0:t=_y(null,t,r,e,n);break e;case 1:t=iv(null,t,r,e,n);break e;case 11:t=rv(null,t,r,e,n);break e;case 14:t=sv(null,t,r,rs(r.type,e),n);break e}throw Error(me(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),_y(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),iv(e,t,r,s,n);case 3:e:{if(gA(t),e===null)throw Error(me(387));r=t.pendingProps,i=t.memoizedState,s=i.element,z2(e,t),Vh(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=ul(Error(me(423)),t),t=av(e,t,r,n,s);break e}else if(r!==s){s=ul(Error(me(424)),t),t=av(e,t,r,n,s);break e}else for(Cr=ji(t.stateNode.containerInfo.firstChild),Ir=t,qt=!0,as=null,n=$2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ol(),r===s){t=li(e,t,n);break e}ir(e,t,r,n)}t=t.child}return t;case 5:return V2(t),e===null&&by(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,hy(r,s)?a=null:i!==null&&hy(r,i)&&(t.flags|=32),mA(e,t),ir(e,t,a,n),t.child;case 6:return e===null&&by(t),null;case 13:return yA(e,t,n);case 4:return Nb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ll(t,null,r,n):ir(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),rv(e,t,r,s,n);case 7:return ir(e,t,t.pendingProps,n),t.child;case 8:return ir(e,t,t.pendingProps.children,n),t.child;case 12:return ir(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,Pt(Hh,r._currentValue),r._currentValue=a,i!==null)if(ps(i.value,a)){if(i.children===s.children&&!br.current){t=li(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=ti(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ey(i.return,n,t),o.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(me(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ey(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}ir(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Xo(t,n),s=qr(s),r=r(s),t.flags|=1,ir(e,t,r,n),t.child;case 14:return r=t.type,s=rs(r,t.pendingProps),s=rs(r.type,s),sv(e,t,r,s,n);case 15:return hA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),th(e,t),t.tag=1,Er(r)?(e=!0,Fh(t)):e=!1,Xo(t,n),uA(t,r,s),wy(t,r,s,n),Ty(null,t,r,!0,e,n);case 19:return bA(e,t,n);case 22:return pA(e,t,n)}throw Error(me(156,t.tag))};function MA(e,t){return o2(e,t)}function n5(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,n,r){return new n5(e,t,n,r)}function Ub(e){return e=e.prototype,!(!e||!e.isReactComponent)}function r5(e){if(typeof e=="function")return Ub(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ib)return 11;if(e===ab)return 14}return 2}function $i(e,t){var n=e.alternate;return n===null?(n=Kr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function sh(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Ub(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case To:return Ca(n.children,s,i,t);case sb:a=8,s|=8;break;case K0:return e=Kr(12,n,t,s|2),e.elementType=K0,e.lanes=i,e;case Y0:return e=Kr(13,n,t,s),e.elementType=Y0,e.lanes=i,e;case W0:return e=Kr(19,n,t,s),e.elementType=W0,e.lanes=i,e;case VS:return Qp(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case HS:a=10;break e;case zS:a=9;break e;case ib:a=11;break e;case ab:a=14;break e;case _i:a=16,r=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=Kr(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Ca(e,t,n,r){return e=Kr(7,e,r,t),e.lanes=n,e}function Qp(e,t,n,r){return e=Kr(22,e,r,t),e.elementType=VS,e.lanes=n,e.stateNode={isHidden:!1},e}function Tg(e,t,n){return e=Kr(6,e,null,t),e.lanes=n,e}function Ng(e,t,n){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function s5(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ig(0),this.expirationTimes=ig(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ig(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function $b(e,t,n,r,s,i,a,o,l){return e=new s5(e,t,n,o,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Kr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tb(i),e}function i5(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(BA)}catch(e){console.error(e)}}BA(),BS.exports=Pr;var $a=BS.exports,bv=$a;z0.createRoot=bv.createRoot,z0.hydrateRoot=bv.hydrateRoot;const Kb=v.createContext({});function nm(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const rm=v.createContext(null),Su=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class u5 extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function d5({children:e,isPresent:t}){const n=v.useId(),r=v.useRef(null),s=v.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=v.useContext(Su);return v.useInsertionEffect(()=>{const{width:a,height:o,top:l,left:u}=s.current;if(t||!r.current||!a||!o)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return i&&(d.nonce=i),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+i.stack}return{value:e,source:t,stack:s,digest:null}}function wg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function wy(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var F6=typeof WeakMap=="function"?WeakMap:Map;function dA(e,t,n){n=ti(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gh||(Gh=!0,Ry=r),wy(e,t)},n}function fA(e,t,n){n=ti(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){wy(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){wy(e,t),typeof r!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function ev(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new F6;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=J6.bind(null,e,t,n),t.then(e,e))}function tv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function nv(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ti(-1,1),t.tag=2,Bi(n,t,1))),n.lanes|=1),e)}var U6=di.ReactCurrentOwner,gr=!1;function sr(e,t,n,r){t.child=e===null?$2(t,null,n,r):ll(t,e.child,n,r)}function rv(e,t,n,r,s){n=n.render;var i=t.ref;return Xo(t,s),r=Ab(e,t,n,r,i,s),n=Cb(),e!==null&&!gr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,li(e,t,s)):(qt&&n&&gb(t),t.flags|=1,sr(e,t,r,s),t.child)}function sv(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Fb(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,hA(e,t,i,r,s)):(e=sh(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:yu,n(a,r)&&e.ref===t.ref)return li(e,t,s)}return t.flags|=1,e=$i(i,r),e.ref=t.ref,e.return=t,t.child=e}function hA(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(yu(i,r)&&e.ref===t.ref)if(gr=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(gr=!0);else return t.lanes=e.lanes,li(e,t,s)}return vy(e,t,n,r,s)}function pA(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pt(Mo,Sr),Sr|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pt(Mo,Sr),Sr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pt(Mo,Sr),Sr|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pt(Mo,Sr),Sr|=r;return sr(e,t,s,n),t.child}function mA(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function vy(e,t,n,r,s){var i=Er(n)?Pa:Xn.current;return i=al(t,i),Xo(t,s),n=Ab(e,t,n,r,i,s),r=Cb(),e!==null&&!gr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,li(e,t,s)):(qt&&r&&gb(t),t.flags|=1,sr(e,t,n,s),t.child)}function iv(e,t,n,r,s){if(Er(n)){var i=!0;Fh(t)}else i=!1;if(Xo(t,s),t.stateNode===null)th(e,t),uA(t,n,r),xy(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=qr(u):(u=Er(n)?Pa:Xn.current,u=al(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==u)&&Jw(t,a,r,u),Ti=!1;var h=t.memoizedState;a.state=h,Vh(t,r,a,s),l=t.memoizedState,o!==r||h!==l||br.current||Ti?(typeof d=="function"&&(Ey(t,n,d,r),l=t.memoizedState),(o=Ti||Zw(t,n,o,r,h,l,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,z2(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:rs(t.type,o),a.props=u,f=t.pendingProps,h=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=qr(l):(l=Er(n)?Pa:Xn.current,l=al(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||h!==l)&&Jw(t,a,r,l),Ti=!1,h=t.memoizedState,a.state=h,Vh(t,r,a,s);var m=t.memoizedState;o!==f||h!==m||br.current||Ti?(typeof p=="function"&&(Ey(t,n,p,r),m=t.memoizedState),(u=Ti||Zw(t,n,u,r,h,m,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,m,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,m,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return _y(e,t,n,r,i,s)}function _y(e,t,n,r,s,i){mA(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&Vw(t,n,!1),li(e,t,i);r=t.stateNode,U6.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=ll(t,e.child,null,i),t.child=ll(t,null,o,i)):sr(e,t,o,i),t.memoizedState=r.state,s&&Vw(t,n,!0),t.child}function gA(e){var t=e.stateNode;t.pendingContext?zw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zw(e,t.context,!1),Tb(e,t.containerInfo)}function av(e,t,n,r,s){return ol(),bb(s),t.flags|=256,sr(e,t,n,r),t.child}var Ty={dehydrated:null,treeContext:null,retryLane:0};function ky(e){return{baseLanes:e,cachePool:null,transitions:null}}function yA(e,t,n){var r=t.pendingProps,s=tn.current,i=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(s&2)!==0),o?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Pt(tn,s&1),e===null)return yy(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Qp(a,r,0,null),e=Ca(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ky(n),t.memoizedState=Ty,e):Ob(t,a));if(s=e.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return $6(e,t,a,r,o,s,n);if(i){i=r.fallback,a=t.mode,s=e.child,o=s.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=$i(s,l),r.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=$i(o,i):(i=Ca(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?ky(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Ty,r}return i=e.child,e=i.sibling,r=$i(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ob(e,t){return t=Qp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function of(e,t,n,r){return r!==null&&bb(r),ll(t,e.child,null,n),e=Ob(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $6(e,t,n,r,s,i,a){if(n)return t.flags&256?(t.flags&=-257,r=wg(Error(me(422))),of(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Qp({mode:"visible",children:r.children},s,0,null),i=Ca(i,s,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ll(t,e.child,null,a),t.child.memoizedState=ky(a),t.memoizedState=Ty,i);if(!(t.mode&1))return of(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var o=r.dgst;return r=o,i=Error(me(419)),r=wg(i,r,void 0),of(e,t,a,r)}if(o=(a&e.childLanes)!==0,gr||o){if(r=Mn,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,oi(e,s),ds(r,e,s,-1))}return Bb(),r=wg(Error(me(421))),of(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=e5.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Cr=ji(s.nextSibling),Ir=t,qt=!0,as=null,e!==null&&(Ur[$r++]=Gs,Ur[$r++]=Xs,Ur[$r++]=ja,Gs=e.id,Xs=e.overflow,ja=t),t=Ob(t,r.children),t.flags|=4096,t)}function ov(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),by(e.return,t,n)}function vg(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function bA(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(sr(e,t,r.children,n),r=tn.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ov(e,n,t);else if(e.tag===19)ov(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Pt(tn,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Kh(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),vg(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Kh(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}vg(t,!0,n,null,i);break;case"together":vg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function th(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function li(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Fa|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(me(153));if(t.child!==null){for(e=t.child,n=$i(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$i(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function H6(e,t,n){switch(t.tag){case 3:gA(t),ol();break;case 5:V2(t);break;case 1:Er(t.type)&&Fh(t);break;case 4:Tb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Pt(Hh,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pt(tn,tn.current&1),t.flags|=128,null):n&t.child.childLanes?yA(e,t,n):(Pt(tn,tn.current&1),e=li(e,t,n),e!==null?e.sibling:null);Pt(tn,tn.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return bA(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Pt(tn,tn.current),r)break;return null;case 22:case 23:return t.lanes=0,pA(e,t,n)}return li(e,t,n)}var EA,Ny,xA,wA;EA=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ny=function(){};xA=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,va(Rs.current);var i=null;switch(n){case"input":s=q0(e,s),r=q0(e,r),i=[];break;case"select":s=sn({},s,{value:void 0}),r=sn({},r,{value:void 0}),i=[];break;case"textarea":s=Q0(e,s),r=Q0(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=jh)}J0(n,r);var a;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var o=s[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(uu.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(o=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(uu.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ft("scroll",e),i||o===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};wA=function(e,t,n,r){n!==r&&(t.flags|=4)};function lc(e,t){if(!qt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Kn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function z6(e,t,n){var r=t.pendingProps;switch(yb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kn(t),null;case 1:return Er(t.type)&&Bh(),Kn(t),null;case 3:return r=t.stateNode,cl(),Ut(br),Ut(Xn),Nb(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(sf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,as!==null&&(My(as),as=null))),Ny(e,t),Kn(t),null;case 5:kb(t);var s=va(vu.current);if(n=t.type,e!==null&&t.stateNode!=null)xA(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(me(166));return Kn(t),null}if(e=va(Rs.current),sf(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Cs]=t,r[xu]=i,e=(t.mode&1)!==0,n){case"dialog":Ft("cancel",r),Ft("close",r);break;case"iframe":case"object":case"embed":Ft("load",r);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Cs]=t,e[xu]=r,EA(e,t,!1,!1),t.stateNode=e;e:{switch(a=ey(n,r),n){case"dialog":Ft("cancel",e),Ft("close",e),s=r;break;case"iframe":case"object":case"embed":Ft("load",e),s=r;break;case"video":case"audio":for(s=0;sdl&&(t.flags|=128,r=!0,lc(i,!1),t.lanes=4194304)}else{if(!r)if(e=Kh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!qt)return Kn(t),null}else 2*dn()-i.renderingStartTime>dl&&n!==1073741824&&(t.flags|=128,r=!0,lc(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=dn(),t.sibling=null,n=tn.current,Pt(tn,r?n&1|2:n&1),t):(Kn(t),null);case 22:case 23:return jb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Sr&1073741824&&(Kn(t),t.subtreeFlags&6&&(t.flags|=8192)):Kn(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function V6(e,t){switch(yb(t),t.tag){case 1:return Er(t.type)&&Bh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cl(),Ut(br),Ut(Xn),Nb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return kb(t),null;case 13:if(Ut(tn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ut(tn),null;case 4:return cl(),null;case 10:return wb(t.type._context),null;case 22:case 23:return jb(),null;case 24:return null;default:return null}}var lf=!1,Wn=!1,K6=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function Lo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ln(e,t,r)}else n.current=null}function Sy(e,t,n){try{n()}catch(r){ln(e,t,r)}}var lv=!1;function Y6(e,t){if(uy=Mh,e=N2(),mb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(o=a+s),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===s&&(o=a),h===i&&++d===r&&(l=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(dy={focusedElem:e,selectionRange:n},Mh=!1,Ae=t;Ae!==null;)if(t=Ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ae=e;else for(;Ae!==null;){t=Ae;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,w=m.memoizedState,g=t.stateNode,E=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:rs(t.type,y),w);g.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(_){ln(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Ae=e;break}Ae=t.return}return m=lv,lv=!1,m}function Hc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Sy(t,n,i)}s=s.next}while(s!==r)}}function Gp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ay(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vA(e){var t=e.alternate;t!==null&&(e.alternate=null,vA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cs],delete t[xu],delete t[py],delete t[A6],delete t[C6])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function _A(e){return e.tag===5||e.tag===3||e.tag===4}function cv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_A(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=jh));else if(r!==4&&(e=e.child,e!==null))for(Cy(e,t,n),e=e.sibling;e!==null;)Cy(e,t,n),e=e.sibling}function Iy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Iy(e,t,n),e=e.sibling;e!==null;)Iy(e,t,n),e=e.sibling}var Bn=null,ss=!1;function gi(e,t,n){for(n=n.child;n!==null;)TA(e,t,n),n=n.sibling}function TA(e,t,n){if(Is&&typeof Is.onCommitFiberUnmount=="function")try{Is.onCommitFiberUnmount($p,n)}catch{}switch(n.tag){case 5:Wn||Lo(n,t);case 6:var r=Bn,s=ss;Bn=null,gi(e,t,n),Bn=r,ss=s,Bn!==null&&(ss?(e=Bn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Bn.removeChild(n.stateNode));break;case 18:Bn!==null&&(ss?(e=Bn,n=n.stateNode,e.nodeType===8?mg(e.parentNode,n):e.nodeType===1&&mg(e,n),mu(e)):mg(Bn,n.stateNode));break;case 4:r=Bn,s=ss,Bn=n.stateNode.containerInfo,ss=!0,gi(e,t,n),Bn=r,ss=s;break;case 0:case 11:case 14:case 15:if(!Wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Sy(n,t,a),s=s.next}while(s!==r)}gi(e,t,n);break;case 1:if(!Wn&&(Lo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ln(n,t,o)}gi(e,t,n);break;case 21:gi(e,t,n);break;case 22:n.mode&1?(Wn=(r=Wn)||n.memoizedState!==null,gi(e,t,n),Wn=r):gi(e,t,n);break;default:gi(e,t,n)}}function uv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new K6),t.forEach(function(r){var s=t5.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function es(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=dn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*q6(r/1960))-r,10e?16:e,Ri===null)var r=!1;else{if(e=Ri,Ri=null,Xh=0,ht&6)throw Error(me(331));var s=ht;for(ht|=4,Ae=e.current;Ae!==null;){var i=Ae,a=i.child;if(Ae.flags&16){var o=i.deletions;if(o!==null){for(var l=0;ldn()-Db?Aa(e,0):Mb|=n),xr(e,t)}function OA(e,t){t===0&&(e.mode&1?(t=Zd,Zd<<=1,!(Zd&130023424)&&(Zd=4194304)):t=1);var n=or();e=oi(e,t),e!==null&&(rd(e,t,n),xr(e,n))}function e5(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),OA(e,n)}function t5(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(me(314))}r!==null&&r.delete(t),OA(e,n)}var LA;LA=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||br.current)gr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return gr=!1,H6(e,t,n);gr=!!(e.flags&131072)}else gr=!1,qt&&t.flags&1048576&&j2(t,$h,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;th(e,t),e=t.pendingProps;var s=al(t,Xn.current);Xo(t,n),s=Ab(null,t,r,e,s,n);var i=Cb();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Er(r)?(i=!0,Fh(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,_b(t),s.updater=qp,t.stateNode=s,s._reactInternals=t,xy(t,r,e,n),t=_y(null,t,r,!0,i,n)):(t.tag=0,qt&&i&&gb(t),sr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(th(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=r5(r),e=rs(r,e),s){case 0:t=vy(null,t,r,e,n);break e;case 1:t=iv(null,t,r,e,n);break e;case 11:t=rv(null,t,r,e,n);break e;case 14:t=sv(null,t,r,rs(r.type,e),n);break e}throw Error(me(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),vy(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),iv(e,t,r,s,n);case 3:e:{if(gA(t),e===null)throw Error(me(387));r=t.pendingProps,i=t.memoizedState,s=i.element,z2(e,t),Vh(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=ul(Error(me(423)),t),t=av(e,t,r,n,s);break e}else if(r!==s){s=ul(Error(me(424)),t),t=av(e,t,r,n,s);break e}else for(Cr=ji(t.stateNode.containerInfo.firstChild),Ir=t,qt=!0,as=null,n=$2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ol(),r===s){t=li(e,t,n);break e}sr(e,t,r,n)}t=t.child}return t;case 5:return V2(t),e===null&&yy(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,fy(r,s)?a=null:i!==null&&fy(r,i)&&(t.flags|=32),mA(e,t),sr(e,t,a,n),t.child;case 6:return e===null&&yy(t),null;case 13:return yA(e,t,n);case 4:return Tb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ll(t,null,r,n):sr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),rv(e,t,r,s,n);case 7:return sr(e,t,t.pendingProps,n),t.child;case 8:return sr(e,t,t.pendingProps.children,n),t.child;case 12:return sr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,Pt(Hh,r._currentValue),r._currentValue=a,i!==null)if(ps(i.value,a)){if(i.children===s.children&&!br.current){t=li(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=ti(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),by(i.return,n,t),o.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(me(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),by(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}sr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Xo(t,n),s=qr(s),r=r(s),t.flags|=1,sr(e,t,r,n),t.child;case 14:return r=t.type,s=rs(r,t.pendingProps),s=rs(r.type,s),sv(e,t,r,s,n);case 15:return hA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rs(r,s),th(e,t),t.tag=1,Er(r)?(e=!0,Fh(t)):e=!1,Xo(t,n),uA(t,r,s),xy(t,r,s,n),_y(null,t,r,!0,e,n);case 19:return bA(e,t,n);case 22:return pA(e,t,n)}throw Error(me(156,t.tag))};function MA(e,t){return o2(e,t)}function n5(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,n,r){return new n5(e,t,n,r)}function Fb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function r5(e){if(typeof e=="function")return Fb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sb)return 11;if(e===ib)return 14}return 2}function $i(e,t){var n=e.alternate;return n===null?(n=Kr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function sh(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Fb(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case To:return Ca(n.children,s,i,t);case rb:a=8,s|=8;break;case V0:return e=Kr(12,n,t,s|2),e.elementType=V0,e.lanes=i,e;case K0:return e=Kr(13,n,t,s),e.elementType=K0,e.lanes=i,e;case Y0:return e=Kr(19,n,t,s),e.elementType=Y0,e.lanes=i,e;case VS:return Qp(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case HS:a=10;break e;case zS:a=9;break e;case sb:a=11;break e;case ib:a=14;break e;case _i:a=16,r=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=Kr(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Ca(e,t,n,r){return e=Kr(7,e,r,t),e.lanes=n,e}function Qp(e,t,n,r){return e=Kr(22,e,r,t),e.elementType=VS,e.lanes=n,e.stateNode={isHidden:!1},e}function _g(e,t,n){return e=Kr(6,e,null,t),e.lanes=n,e}function Tg(e,t,n){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function s5(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sg(0),this.expirationTimes=sg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sg(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ub(e,t,n,r,s,i,a,o,l){return e=new s5(e,t,n,o,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Kr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_b(i),e}function i5(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(BA)}catch(e){console.error(e)}}BA(),BS.exports=Pr;var $a=BS.exports,bv=$a;H0.createRoot=bv.createRoot,H0.hydrateRoot=bv.hydrateRoot;const Vb=v.createContext({});function nm(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const rm=v.createContext(null),Su=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class u5 extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function d5({children:e,isPresent:t}){const n=v.useId(),r=v.useRef(null),s=v.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=v.useContext(Su);return v.useInsertionEffect(()=>{const{width:a,height:o,top:l,left:u}=s.current;if(t||!r.current||!a||!o)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return i&&(d.nonce=i),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${a}px !important; @@ -46,7 +46,7 @@ Error generating stack: `+i.message+` top: ${l}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),c.jsx(u5,{isPresent:t,childRef:r,sizeRef:s,children:v.cloneElement(e,{ref:r})})}const f5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const o=nm(h5),l=v.useId(),u=v.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=v.useMemo(()=>({id:l,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(o.set(f,!1),()=>o.delete(f))}),i?[Math.random(),u]:[n,u]);return v.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),v.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),a==="popLayout"&&(e=c.jsx(d5,{isPresent:n,children:e})),c.jsx(rm.Provider,{value:d,children:e})};function h5(){return new Map}function FA(e=!0){const t=v.useContext(rm);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=v.useId();v.useEffect(()=>{e&&s(i)},[e]);const a=v.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const df=e=>e.key||"";function Ev(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Yb=typeof window<"u",UA=Yb?v.useLayoutEffect:v.useEffect,Hi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[o,l]=FA(a),u=v.useMemo(()=>Ev(e),[e]),d=a&&!o?[]:u.map(df),f=v.useRef(!0),h=v.useRef(u),p=nm(()=>new Map),[m,y]=v.useState(u),[w,g]=v.useState(u);UA(()=>{f.current=!1,h.current=u;for(let _=0;_{const N=df(_),T=a&&!o?!1:u===w||d.includes(N),A=()=>{if(p.has(N))p.set(N,!0);else return;let k=!0;p.forEach(R=>{R||(k=!1)}),k&&(b==null||b(),g(h.current),a&&(l==null||l()),r&&r())};return c.jsx(f5,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:T?void 0:A,children:_},N)})})},Rr=e=>e;let $A=Rr;const p5={useManualTiming:!1};function m5(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&i.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(a=u,r){s=!0;return}r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,s&&(s=!1,l.process(u))}};return l}const ff=["read","resolveKeyframes","update","preRender","render","postRender"],g5=40;function HA(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=ff.reduce((g,E)=>(g[E]=m5(i),g),{}),{read:o,resolveKeyframes:l,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const g=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(g-s.timestamp,g5),1),s.timestamp=g,s.isProcessing=!0,o.process(s),l.process(s),u.process(s),d.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:ff.reduce((g,E)=>{const b=a[E];return g[E]=(_,N=!1,T=!1)=>(n||m(),b.schedule(_,N,T)),g},{}),cancel:g=>{for(let E=0;Exv[e].some(n=>!!t[n])};function y5(e){for(const t in e)fl[t]={...fl[t],...e[t]}}const b5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Jh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||b5.has(e)}let VA=e=>!Jh(e);function KA(e){e&&(VA=t=>t.startsWith("on")?!Jh(t):e(t))}try{KA(require("@emotion/is-prop-valid").default)}catch{}function E5(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(VA(s)||n===!0&&Jh(s)||!t&&!Jh(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function x5({children:e,isValidProp:t,...n}){t&&KA(t),n={...v.useContext(Su),...n},n.isStatic=nm(()=>n.isStatic);const r=v.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return c.jsx(Su.Provider,{value:r,children:e})}function w5(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const sm=v.createContext({});function Au(e){return typeof e=="string"||Array.isArray(e)}function im(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Wb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qb=["initial",...Wb];function am(e){return im(e.animate)||qb.some(t=>Au(e[t]))}function YA(e){return!!(am(e)||e.variants)}function v5(e,t){if(am(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Au(n)?n:void 0,animate:Au(r)?r:void 0}}return e.inherit!==!1?t:{}}function _5(e){const{initial:t,animate:n}=v5(e,v.useContext(sm));return v.useMemo(()=>({initial:t,animate:n}),[wv(t),wv(n)])}function wv(e){return Array.isArray(e)?e.join(" "):e}const T5=Symbol.for("motionComponentSymbol");function Do(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function N5(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Do(n)&&(n.current=r))},[t])}const Gb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),k5="framerAppearId",WA="data-"+Gb(k5),{schedule:Xb}=HA(queueMicrotask,!1),qA=v.createContext({});function S5(e,t,n,r,s){var i,a;const{visualElement:o}=v.useContext(sm),l=v.useContext(zA),u=v.useContext(rm),d=v.useContext(Su).reducedMotion,f=v.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=v.useContext(qA);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&A5(f.current,n,s,p);const m=v.useRef(!1);v.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const y=n[WA],w=v.useRef(!!y&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,y)));return UA(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Xb.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),w.current=!1))}),h}function A5(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:GA(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||o&&Do(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function GA(e){if(e)return e.options.allowProjection!==!1?e.projection:GA(e.parent)}function C5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&y5(e);function o(u,d){let f;const h={...v.useContext(Su),...u,layoutId:I5(u)},{isStatic:p}=h,m=_5(u),y=r(u,p);if(!p&&Yb){R5();const w=O5(h);f=w.MeasureLayout,m.visualElement=S5(s,y,h,t,w.ProjectionNode)}return c.jsxs(sm.Provider,{value:m,children:[f&&m.visualElement?c.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,N5(y,m.visualElement,d),y,p,m.visualElement)]})}o.displayName=`motion.${typeof s=="string"?s:`create(${(a=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&a!==void 0?a:""})`}`;const l=v.forwardRef(o);return l[T5]=s,l}function I5({layoutId:e}){const t=v.useContext(Kb).id;return t&&e!==void 0?t+"-"+e:e}function R5(e,t){v.useContext(zA).strict}function O5(e){const{drag:t,layout:n}=fl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const L5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Qb(e){return typeof e!="string"||e.includes("-")?!1:!!(L5.indexOf(e)>-1||/[A-Z]/u.test(e))}function vv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Zb(e,t,n,r){if(typeof t=="function"){const[s,i]=vv(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=vv(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Py=e=>Array.isArray(e),M5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),D5=e=>Py(e)?e[e.length-1]||0:e,qn=e=>!!(e&&e.getVelocity);function ih(e){const t=qn(e)?e.get():e;return M5(t)?t.toValue():t}function P5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:j5(r,s,i,e),renderState:t()};return n&&(a.onMount=o=>n({props:r,current:o,...a}),a.onUpdate=o=>n(o)),a}const XA=e=>(t,n)=>{const r=v.useContext(sm),s=v.useContext(rm),i=()=>P5(e,t,r,s);return n?i():nm(i)};function j5(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=ih(i[h]);let{initial:a,animate:o}=e;const l=am(e),u=YA(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?o:a;if(f&&typeof f!="boolean"&&!im(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),ZA=QA("--"),B5=QA("var(--"),Jb=e=>B5(e)?F5.test(e.split("/*")[0].trim()):!1,F5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,JA=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ci=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Cu={...jl,transform:e=>ci(0,1,e)},hf={...jl,default:1},od=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xi=od("deg"),Os=od("%"),ze=od("px"),U5=od("vh"),$5=od("vw"),_v={...Os,parse:e=>Os.parse(e)/100,transform:e=>Os.transform(e*100)},H5={borderWidth:ze,borderTopWidth:ze,borderRightWidth:ze,borderBottomWidth:ze,borderLeftWidth:ze,borderRadius:ze,radius:ze,borderTopLeftRadius:ze,borderTopRightRadius:ze,borderBottomRightRadius:ze,borderBottomLeftRadius:ze,width:ze,maxWidth:ze,height:ze,maxHeight:ze,top:ze,right:ze,bottom:ze,left:ze,padding:ze,paddingTop:ze,paddingRight:ze,paddingBottom:ze,paddingLeft:ze,margin:ze,marginTop:ze,marginRight:ze,marginBottom:ze,marginLeft:ze,backgroundPositionX:ze,backgroundPositionY:ze},z5={rotate:xi,rotateX:xi,rotateY:xi,rotateZ:xi,scale:hf,scaleX:hf,scaleY:hf,scaleZ:hf,skew:xi,skewX:xi,skewY:xi,distance:ze,translateX:ze,translateY:ze,translateZ:ze,x:ze,y:ze,z:ze,perspective:ze,transformPerspective:ze,opacity:Cu,originX:_v,originY:_v,originZ:ze},Tv={...jl,transform:Math.round},eE={...H5,...z5,zIndex:Tv,size:ze,fillOpacity:Cu,strokeOpacity:Cu,numOctaves:Tv},V5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},K5=Pl.length;function Y5(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),eC=()=>({...rE(),attrs:{}}),sE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function tC(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function rC(e,t,n,r){tC(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Gb(s),t.attrs[s])}const ep={};function Q5(e){Object.assign(ep,e)}function sC(e,{layout:t,layoutId:n}){return eo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ep[e]||e==="opacity")}function iE(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(qn(s[a])||t.style&&qn(t.style[a])||sC(a,e)||((r=n==null?void 0:n.getValue(a))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[a]=s[a]);return i}function iC(e,t,n){const r=iE(e,t,n);for(const s in e)if(qn(e[s])||qn(t[s])){const i=Pl.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function Z5(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const kv=["x","y","width","height","cx","cy","r"],J5={useVisualState:XA({scrapeMotionValuesFromProps:iC,createRenderState:eC,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const o in s)if(eo.has(o)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let o=0;o{Z5(n,r),$t.render(()=>{nE(r,s,sE(n.tagName),e.transformTemplate),rC(n,r)})})}})},ej={useVisualState:XA({scrapeMotionValuesFromProps:iE,createRenderState:rE})};function aC(e,t,n){for(const r in t)!qn(t[r])&&!sC(r,n)&&(e[r]=t[r])}function tj({transformTemplate:e},t){return v.useMemo(()=>{const n=rE();return tE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nj(e,t){const n=e.style||{},r={};return aC(r,n,e),Object.assign(r,tj(e,t)),r}function rj(e,t){const n={},r=nj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function sj(e,t,n,r){const s=v.useMemo(()=>{const i=eC();return nE(i,t,sE(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};aC(i,e.style,e),s.style={...i,...s.style}}return s}function ij(e=!1){return(n,r,s,{latestValues:i},a)=>{const l=(Qb(n)?sj:rj)(r,i,a,n),u=E5(r,typeof n=="string",e),d=n!==v.Fragment?{...u,...l,ref:s}:{},{children:f}=r,h=v.useMemo(()=>qn(f)?f.get():f,[f]);return v.createElement(n,{...d,children:h})}}function aj(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...Qb(r)?J5:ej,preloadedFeatures:e,useRender:ij(s),createVisualElement:t,Component:r};return C5(a)}}function oC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(ah===void 0&&Ls.set(Fn.isProcessing||p5.useManualTiming?Fn.timestamp:performance.now()),ah),set:e=>{ah=e,queueMicrotask(oj)}};function oE(e,t){e.indexOf(t)===-1&&e.push(t)}function lE(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class cE{constructor(){this.subscriptions=[]}add(t){return oE(this.subscriptions,t),()=>lE(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class cj{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ls.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ls.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new cE);const r=this.events[t].add(n);return t==="change"?()=>{r(),$t.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ls.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sv);return cC(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Iu(e,t){return new cj(e,t)}function uj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Iu(n))}function dj(e,t){const n=om(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const o=D5(i[a]);uj(e,a,o)}}function fj(e){return!!(qn(e)&&e.add)}function jy(e,t){const n=e.getValue("willChange");if(fj(n))return n.add(t)}function uC(e){return e.props[WA]}function uE(e){let t;return()=>(t===void 0&&(t=e()),t)}const hj=uE(()=>window.ScrollTimeline!==void 0);class pj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r{if(hj()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mj extends pj{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const ni=e=>e*1e3,ri=e=>e/1e3;function dE(e){return typeof e=="function"}function Av(e,t){e.timeline=t,e.onfinish=null}const fE=e=>Array.isArray(e)&&typeof e[0]=="number",gj={linearEasing:void 0};function yj(e,t){const n=uE(e);return()=>{var r;return(r=gj[t])!==null&&r!==void 0?r:n()}}const tp=yj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),hl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},dC=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i`cubic-bezier(${e}, ${t}, ${n}, ${r})`,By={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ac([0,.65,.55,1]),circOut:Ac([.55,0,1,.45]),backIn:Ac([.31,.01,.66,-.59]),backOut:Ac([.33,1.53,.69,.99])};function hC(e,t){if(e)return typeof e=="function"&&tp()?dC(e,t):fE(e)?Ac(e):Array.isArray(e)?e.map(n=>hC(n,t)||By.easeOut):By[e]}const pC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bj=1e-7,Ej=12;function xj(e,t,n,r,s){let i,a,o=0;do a=t+(n-t)/2,i=pC(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>bj&&++oxj(i,0,1,e,n);return i=>i===0||i===1?i:pC(s(i),t,r)}const mC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,gC=e=>t=>1-e(1-t),yC=ld(.33,1.53,.69,.99),hE=gC(yC),bC=mC(hE),EC=e=>(e*=2)<1?.5*hE(e):.5*(2-Math.pow(2,-10*(e-1))),pE=e=>1-Math.sin(Math.acos(e)),xC=gC(pE),wC=mC(pE),vC=e=>/^0[^.\s]+$/u.test(e);function wj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||vC(e):!0}const Kc=e=>Math.round(e*1e5)/1e5,mE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vj(e){return e==null}const _j=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gE=(e,t)=>n=>!!(typeof n=="string"&&_j.test(n)&&n.startsWith(e)||t&&!vj(n)&&Object.prototype.hasOwnProperty.call(n,t)),_C=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,o]=r.match(mE);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},Tj=e=>ci(0,255,e),Sg={...jl,transform:e=>Math.round(Tj(e))},_a={test:gE("rgb","red"),parse:_C("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Sg.transform(e)+", "+Sg.transform(t)+", "+Sg.transform(n)+", "+Kc(Cu.transform(r))+")"};function Nj(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Fy={test:gE("#"),parse:Nj,transform:_a.transform},Po={test:gE("hsl","hue"),parse:_C("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Os.transform(Kc(t))+", "+Os.transform(Kc(n))+", "+Kc(Cu.transform(r))+")"},Yn={test:e=>_a.test(e)||Fy.test(e)||Po.test(e),parse:e=>_a.test(e)?_a.parse(e):Po.test(e)?Po.parse(e):Fy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?_a.transform(e):Po.transform(e)},kj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Sj(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(mE))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(kj))===null||n===void 0?void 0:n.length)||0)>0}const TC="number",NC="color",Aj="var",Cj="var(",Cv="${}",Ij=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ru(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=t.replace(Ij,l=>(Yn.test(l)?(r.color.push(i),s.push(NC),n.push(Yn.parse(l))):l.startsWith(Cj)?(r.var.push(i),s.push(Aj),n.push(l)):(r.number.push(i),s.push(TC),n.push(parseFloat(l))),++i,Cv)).split(Cv);return{values:n,split:o,indexes:r,types:s}}function kC(e){return Ru(e).values}function SC(e){const{split:t,types:n}=Ru(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function Oj(e){const t=kC(e);return SC(e)(t.map(Rj))}const Gi={test:Sj,parse:kC,createTransformer:SC,getAnimatableNone:Oj},Lj=new Set(["brightness","contrast","saturate","opacity"]);function Mj(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(mE)||[];if(!r)return e;const s=n.replace(r,"");let i=Lj.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Dj=/\b([a-z-]*)\(.*?\)/gu,Uy={...Gi,getAnimatableNone:e=>{const t=e.match(Dj);return t?t.map(Mj).join(" "):e}},Pj={...eE,color:Yn,backgroundColor:Yn,outlineColor:Yn,fill:Yn,stroke:Yn,borderColor:Yn,borderTopColor:Yn,borderRightColor:Yn,borderBottomColor:Yn,borderLeftColor:Yn,filter:Uy,WebkitFilter:Uy},yE=e=>Pj[e];function AC(e,t){let n=yE(e);return n!==Uy&&(n=Gi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const jj=new Set(["auto","none","0"]);function Bj(e,t,n){let r=0,s;for(;re===jl||e===ze,Rv=(e,t)=>parseFloat(e.split(", ")[t]),Ov=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Rv(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Rv(i[1],e):0}},Fj=new Set(["x","y","z"]),Uj=Pl.filter(e=>!Fj.has(e));function $j(e){const t=[];return Uj.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const pl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ov(4,13),y:Ov(5,14)};pl.translateX=pl.x;pl.translateY=pl.y;const Ia=new Set;let $y=!1,Hy=!1;function CC(){if(Hy){const e=Array.from(Ia).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=$j(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var o;(o=r.getValue(i))===null||o===void 0||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hy=!1,$y=!1,Ia.forEach(e=>e.complete()),Ia.clear()}function IC(){Ia.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hy=!0)})}function Hj(){IC(),CC()}class bE{constructor(t,n,r,s,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ia.add(this),$y||($y=!0,$t.read(IC),$t.resolveKeyframes(CC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),zj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vj(e){const t=zj.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function OC(e,t,n=1){const[r,s]=Vj(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return RC(a)?parseFloat(a):a}return Jb(s)?OC(s,t,n+1):s}const LC=e=>t=>t.test(e),Kj={test:e=>e==="auto",parse:e=>e},MC=[jl,ze,Os,xi,$5,U5,Kj],Lv=e=>MC.find(LC(e));class DC extends bE{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Mv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gi.test(e)||e==="0")&&!e.startsWith("url("));function Yj(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function lm(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(qj),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Gj=40;class PC{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ls.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Gj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Hj(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ls.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:o,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Wj(t,r,s,i))if(a)this.options.duration=0;else{l&&l(lm(t,this.options,n)),o&&o(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const zy=2e4;function jC(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=zy?1/0:t}const nn=(e,t,n)=>e+(t-e)*n;function Ag(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xj({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,a=0;if(!t)s=i=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=Ag(l,o,e+1/3),i=Ag(l,o,e),a=Ag(l,o,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function np(e,t){return n=>n>0?t:e}const Cg=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Qj=[Fy,_a,Po],Zj=e=>Qj.find(t=>t.test(e));function Dv(e){const t=Zj(e);if(!t)return!1;let n=t.parse(e);return t===Po&&(n=Xj(n)),n}const Pv=(e,t)=>{const n=Dv(e),r=Dv(t);if(!n||!r)return np(e,t);const s={...n};return i=>(s.red=Cg(n.red,r.red,i),s.green=Cg(n.green,r.green,i),s.blue=Cg(n.blue,r.blue,i),s.alpha=nn(n.alpha,r.alpha,i),_a.transform(s))},Jj=(e,t)=>n=>t(e(n)),cd=(...e)=>e.reduce(Jj),Vy=new Set(["none","hidden"]);function eB(e,t){return Vy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tB(e,t){return n=>nn(e,t,n)}function EE(e){return typeof e=="number"?tB:typeof e=="string"?Jb(e)?np:Yn.test(e)?Pv:sB:Array.isArray(e)?BC:typeof e=="object"?Yn.test(e)?Pv:nB:np}function BC(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>EE(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function rB(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=Gi.createTransformer(t),r=Ru(e),s=Ru(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Vy.has(e)&&!s.values.length||Vy.has(t)&&!r.values.length?eB(e,t):cd(BC(rB(r,s),s.values),n):np(e,t)};function FC(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?nn(e,t,n):EE(e)(e,t)}const iB=5;function UC(e,t,n){const r=Math.max(t-iB,0);return cC(n-e(r),t-r)}const on={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ig=.001;function aB({duration:e=on.duration,bounce:t=on.bounce,velocity:n=on.velocity,mass:r=on.mass}){let s,i,a=1-t;a=ci(on.minDamping,on.maxDamping,a),e=ci(on.minDuration,on.maxDuration,ri(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=Ky(u,a),m=Math.exp(-f);return Ig-h/p*m},i=u=>{const f=u*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(u,2)*e,m=Math.exp(-f),y=Ky(Math.pow(u,2),a);return(-s(u)+Ig>0?-1:1)*((h-p)*m)/y}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Ig+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,l=lB(s,i,o);if(e=ni(e),isNaN(l))return{stiffness:on.stiffness,damping:on.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const oB=12;function lB(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function dB(e){let t={velocity:on.velocity,stiffness:on.stiffness,damping:on.damping,mass:on.mass,isResolvedFromDuration:!1,...e};if(!jv(e,uB)&&jv(e,cB))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ci(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:on.mass,stiffness:s,damping:i}}else{const n=aB(e);t={...t,...n,mass:on.mass},t.isResolvedFromDuration=!0}return t}function $C(e=on.visualDuration,t=on.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=dB({...n,velocity:-ri(n.velocity||0)}),m=h||0,y=u/(2*Math.sqrt(l*d)),w=a-i,g=ri(Math.sqrt(l/d)),E=Math.abs(w)<5;r||(r=E?on.restSpeed.granular:on.restSpeed.default),s||(s=E?on.restDelta.granular:on.restDelta.default);let b;if(y<1){const N=Ky(g,y);b=T=>{const A=Math.exp(-y*g*T);return a-A*((m+y*g*w)/N*Math.sin(N*T)+w*Math.cos(N*T))}}else if(y===1)b=N=>a-Math.exp(-g*N)*(w+(m+g*w)*N);else{const N=g*Math.sqrt(y*y-1);b=T=>{const A=Math.exp(-y*g*T),k=Math.min(N*T,300);return a-A*((m+y*g*w)*Math.sinh(k)+N*w*Math.cosh(k))/N}}const _={calculatedDuration:p&&f||null,next:N=>{const T=b(N);if(p)o.done=N>=f;else{let A=0;y<1&&(A=N===0?ni(m):UC(b,N,T));const k=Math.abs(A)<=r,R=Math.abs(a-T)<=s;o.done=k&&R}return o.value=o.done?a:T,o},toString:()=>{const N=Math.min(jC(_),zy),T=dC(A=>_.next(N*A).value,N,30);return N+"ms "+T}};return _}function Bv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=k=>o!==void 0&&kl,m=k=>o===void 0?l:l===void 0||Math.abs(o-k)-y*Math.exp(-k/r),b=k=>g+E(k),_=k=>{const R=E(k),I=b(k);h.done=Math.abs(R)<=u,h.value=h.done?g:I};let N,T;const A=k=>{p(h.value)&&(N=k,T=$C({keyframes:[h.value,m(h.value)],velocity:UC(b,k,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:k=>{let R=!1;return!T&&N===void 0&&(R=!0,_(k),A(k)),N!==void 0&&k>=N?T.next(k-N):(!R&&_(k),h)}}}const fB=ld(.42,0,1,1),hB=ld(0,0,.58,1),HC=ld(.42,0,.58,1),pB=e=>Array.isArray(e)&&typeof e[0]!="number",mB={linear:Rr,easeIn:fB,easeInOut:HC,easeOut:hB,circIn:pE,circInOut:wC,circOut:xC,backIn:hE,backInOut:bC,backOut:yC,anticipate:EC},Fv=e=>{if(fE(e)){$A(e.length===4);const[t,n,r,s]=e;return ld(t,n,r,s)}else if(typeof e=="string")return mB[e];return e};function gB(e,t,n){const r=[],s=n||FC,i=e.length-1;for(let a=0;at[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=gB(t,r,s),l=o.length,u=d=>{if(a&&d1)for(;fu(ci(e[0],e[i-1],d)):u}function bB(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=hl(0,t,r);e.push(nn(n,1,s))}}function EB(e){const t=[0];return bB(t,e.length-1),t}function xB(e,t){return e.map(n=>n*t)}function wB(e,t){return e.map(()=>t||HC).splice(0,e.length-1)}function rp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=pB(r)?r.map(Fv):Fv(r),i={done:!1,value:t[0]},a=xB(n&&n.length===t.length?n:EB(t),e),o=yB(a,t,{ease:Array.isArray(s)?s:wB(t,s)});return{calculatedDuration:e,next:l=>(i.value=o(l),i.done=l>=e,i)}}const vB=e=>{const t=({timestamp:n})=>e(n);return{start:()=>$t.update(t,!0),stop:()=>qi(t),now:()=>Fn.isProcessing?Fn.timestamp:Ls.now()}},_B={decay:Bv,inertia:Bv,tween:rp,keyframes:rp,spring:$C},TB=e=>e/100;class xE extends PC{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,a=(s==null?void 0:s.KeyframeResolver)||bE,o=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new a(i,o,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=this.options,o=dE(n)?n:_B[n]||rp;let l,u;o!==rp&&typeof t[0]!="number"&&(l=cd(TB,FC(t[0],t[1])),t=[0,100]);const d=o({...this.options,keyframes:t});i==="mirror"&&(u=o({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=jC(d));const{calculatedDuration:f}=d,h=f+s,p=h*(r+1)-s;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:p,repeatType:m,repeatDelay:y,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),E=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,_=i;if(p){const k=Math.min(this.currentTime,d)/f;let R=Math.floor(k),I=k%1;!I&&k>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,y&&(I-=y/f)):m==="mirror"&&(_=a)),b=ci(0,1,I)*f}const N=E?{done:!1,value:l[0]}:_.next(b);o&&(N.value=o(N.value));let{done:T}=N;!E&&u!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return A&&s!==void 0&&(N.value=lm(l,this.options,s)),w&&w(N.value),A&&this.finish(),N}get duration(){const{resolved:t}=this;return t?ri(t.calculatedDuration):0}get time(){return ri(this.currentTime)}set time(t){t=ni(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ri(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vB,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const NB=new Set(["opacity","clipPath","filter","transform"]);function kB(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:o="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const d=hC(o,s);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"})}const SB=uE(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),sp=10,AB=2e4;function CB(e){return dE(e.type)||e.type==="spring"||!fC(e.ease)}function IB(e,t){const n=new xE({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&ithis.onKeyframesResolved(a,o),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:o,name:l,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof i=="string"&&tp()&&RB(i)&&(i=zC[i]),CB(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...y}=this.options,w=IB(t,y);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=kB(o.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Av(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(lm(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:s,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ri(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ri(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ni(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Rr;const{animation:r}=n;Av(r,t)}return Rr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:a,times:o}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...p}=this.options,m=new xE({...p,keyframes:r,duration:s,type:i,ease:a,times:o,isGenerator:!0}),y=ni(this.time);u.setWithVelocity(m.sample(y-sp).value,m.sample(y).value,sp)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:a,type:o}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return SB()&&r&&NB.has(r)&&!l&&!u&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}}const OB={type:"spring",stiffness:500,damping:25,restSpeed:10},LB=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MB={type:"keyframes",duration:.8},DB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PB=(e,{keyframes:t})=>t.length>2?MB:eo.has(e)?e.startsWith("scale")?LB(t[1]):OB:DB;function jB({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:o,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const wE=(e,t,n,r={},s,i)=>a=>{const o=aE(r,e)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-ni(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:s};jB(o)||(d={...d,...PB(e,d)}),d.duration&&(d.duration=ni(d.duration)),d.repeatDelay&&(d.repeatDelay=ni(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!i&&t.get()!==void 0){const h=lm(d.keyframes,o);if(h!==void 0)return $t.update(()=>{d.onUpdate(h),d.onComplete()}),new mj([])}return!i&&Uv.supports(d)?new Uv(d):new xE(d)};function BB({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function VC(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const u=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),p=l[f];if(p===void 0||d&&BB(d,f))continue;const m={delay:n,...aE(a||{},f)};let y=!1;if(window.MotionHandoffAnimation){const g=uC(e);if(g){const E=window.MotionHandoffAnimation(g,f,$t);E!==null&&(m.startTime=E,y=!0)}}jy(e,f),h.start(wE(f,h,p,e.shouldReduceMotion&&lC.has(f)?{type:!1}:m,e,y));const w=h.animation;w&&u.push(w)}return o&&Promise.all(u).then(()=>{$t.update(()=>{o&&dj(e,o)})}),u}function Yy(e,t,n={}){var r;const s=om(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const a=s?()=>Promise.all(VC(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return FB(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function FB(e,t,n=0,r=0,s=1,i){const a=[],o=(e.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(e.variantChildren).sort(UB).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(Yy(u,t,{...i,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function UB(e,t){return e.sortNodePosition(t)}function $B(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Yy(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Yy(e,t,n);else{const s=typeof t=="function"?om(e,t,n.custom):t;r=Promise.all(VC(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const HB=qb.length;function KC(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?KC(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>$B(e,n,r)))}function YB(e){let t=KB(e),n=$v(),r=!0;const s=l=>(u,d)=>{var f;const h=om(e,d,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...y}=h;u={...u,...y,...m}}return u};function i(l){t=l(e)}function a(l){const{props:u}=e,d=KC(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;wm&&_,R=!1;const I=Array.isArray(b)?b:[b];let M=I.reduce(s(g),{});N===!1&&(M={});const{prevResolvedValues:B={}}=E,Y={...B,...M},P=L=>{k=!0,h.has(L)&&(R=!0,h.delete(L)),E.needsAnimating[L]=!0;const O=e.getValue(L);O&&(O.liveStyle=!1)};for(const L in Y){const O=M[L],j=B[L];if(p.hasOwnProperty(L))continue;let S=!1;Py(O)&&Py(j)?S=!oC(O,j):S=O!==j,S?O!=null?P(L):h.add(L):O!==void 0&&h.has(L)?P(L):E.protectedKeys[L]=!0}E.prevProp=b,E.prevResolvedValues=M,E.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(k=!1),k&&(!(T&&A)||R)&&f.push(...I.map(L=>({animation:L,options:{type:g}})))}if(h.size){const w={};h.forEach(g=>{const E=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),w[g]=E??null}),f.push({animation:w})}let y=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function o(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=a(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:o,setAnimateFunction:i,getState:()=>n,reset:()=>{n=$v(),r=!0}}}function WB(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!oC(t,e):!1}function la(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $v(){return{animate:la(!0),whileInView:la(),whileHover:la(),whileTap:la(),whileDrag:la(),whileFocus:la(),exit:la()}}class ea{constructor(t){this.isMounted=!1,this.node=t}update(){}}class qB extends ea{constructor(t){super(t),t.animationState||(t.animationState=YB(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();im(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let GB=0;class XB extends ea{constructor(){super(...arguments),this.id=GB++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const QB={animation:{Feature:qB},exit:{Feature:XB}},ns={x:!1,y:!1};function YC(){return ns.x||ns.y}function ZB(e){return e==="x"||e==="y"?ns[e]?null:(ns[e]=!0,()=>{ns[e]=!1}):ns.x||ns.y?null:(ns.x=ns.y=!0,()=>{ns.x=ns.y=!1})}const vE=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Ou(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ud(e){return{point:{x:e.pageX,y:e.pageY}}}const JB=e=>t=>vE(t)&&e(t,ud(t));function Yc(e,t,n,r){return Ou(e,t,JB(n),r)}const Hv=(e,t)=>Math.abs(e-t);function e8(e,t){const n=Hv(e.x,t.x),r=Hv(e.y,t.y);return Math.sqrt(n**2+r**2)}class WC{constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Og(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=e8(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:y}=Fn;this.history.push({...m,timestamp:y});const{onStart:w,onMove:g}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Rg(h,this.transformPagePoint),$t.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Og(f.type==="pointercancel"?this.lastMoveEventInfo:Rg(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!vE(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=ud(t),o=Rg(a,this.transformPagePoint),{point:l}=o,{timestamp:u}=Fn;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Og(o,this.history)),this.removeListeners=cd(Yc(this.contextWindow,"pointermove",this.handlePointerMove),Yc(this.contextWindow,"pointerup",this.handlePointerUp),Yc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qi(this.updatePoint)}}function Rg(e,t){return t?{point:t(e.point)}:e}function zv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Og({point:e},t){return{point:e,delta:zv(e,qC(t)),offset:zv(e,t8(t)),velocity:n8(t,.1)}}function t8(e){return e[0]}function qC(e){return e[e.length-1]}function n8(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=qC(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>ni(t)));)n--;if(!r)return{x:0,y:0};const i=ri(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const GC=1e-4,r8=1-GC,s8=1+GC,XC=.01,i8=0-XC,a8=0+XC;function Mr(e){return e.max-e.min}function o8(e,t,n){return Math.abs(e-t)<=n}function Vv(e,t,n,r=.5){e.origin=r,e.originPoint=nn(t.min,t.max,e.origin),e.scale=Mr(n)/Mr(t),e.translate=nn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=r8&&e.scale<=s8||isNaN(e.scale))&&(e.scale=1),(e.translate>=i8&&e.translate<=a8||isNaN(e.translate))&&(e.translate=0)}function Wc(e,t,n,r){Vv(e.x,t.x,n.x,r?r.originX:void 0),Vv(e.y,t.y,n.y,r?r.originY:void 0)}function Kv(e,t,n){e.min=n.min+t.min,e.max=e.min+Mr(t)}function l8(e,t,n){Kv(e.x,t.x,n.x),Kv(e.y,t.y,n.y)}function Yv(e,t,n){e.min=t.min-n.min,e.max=e.min+Mr(t)}function qc(e,t,n){Yv(e.x,t.x,n.x),Yv(e.y,t.y,n.y)}function c8(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?nn(n,e,r.max):Math.min(e,n)),e}function Wv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function u8(e,{top:t,left:n,bottom:r,right:s}){return{x:Wv(e.x,n,s),y:Wv(e.y,t,r)}}function qv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=hl(t.min,t.max-r,e.min):r>s&&(n=hl(e.min,e.max-s,t.min)),ci(0,1,n)}function h8(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Wy=.35;function p8(e=Wy){return e===!1?e=0:e===!0&&(e=Wy),{x:Gv(e,"left","right"),y:Gv(e,"top","bottom")}}function Gv(e,t,n){return{min:Xv(e,t),max:Xv(e,n)}}function Xv(e,t){return typeof e=="number"?e:e[t]||0}const Qv=()=>({translate:0,scale:1,origin:0,originPoint:0}),jo=()=>({x:Qv(),y:Qv()}),Zv=()=>({min:0,max:0}),un=()=>({x:Zv(),y:Zv()});function Fr(e){return[e("x"),e("y")]}function QC({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function m8({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function g8(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Lg(e){return e===void 0||e===1}function qy({scale:e,scaleX:t,scaleY:n}){return!Lg(e)||!Lg(t)||!Lg(n)}function ha(e){return qy(e)||ZC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ZC(e){return Jv(e.x)||Jv(e.y)}function Jv(e){return e&&e!=="0%"}function ip(e,t,n){const r=e-n,s=t*r;return n+s}function e_(e,t,n,r,s){return s!==void 0&&(e=ip(e,s,r)),ip(e,n,r)+t}function Gy(e,t=0,n=1,r,s){e.min=e_(e.min,t,n,r,s),e.max=e_(e.max,t,n,r,s)}function JC(e,{x:t,y:n}){Gy(e.x,t.translate,t.scale,t.originPoint),Gy(e.y,n.translate,n.scale,n.originPoint)}const t_=.999999999999,n_=1.0000000000001;function y8(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let o=0;ot_&&(t.x=1),t.yt_&&(t.y=1)}function Bo(e,t){e.min=e.min+t,e.max=e.max+t}function r_(e,t,n,r,s=.5){const i=nn(e.min,e.max,s);Gy(e,t,n,i,r)}function Fo(e,t){r_(e.x,t.x,t.scaleX,t.scale,t.originX),r_(e.y,t.y,t.scaleY,t.scale,t.originY)}function eI(e,t){return QC(g8(e.getBoundingClientRect(),t))}function b8(e,t,n){const r=eI(e,n),{scroll:s}=t;return s&&(Bo(r.x,s.offset.x),Bo(r.y,s.offset.y)),r}const tI=({current:e})=>e?e.ownerDocument.defaultView:null,E8=new WeakMap;class x8{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=un(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ud(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ZB(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fr(w=>{let g=this.getAxisMotionValue(w).get()||0;if(Os.test(g)){const{projection:E}=this.visualElement;if(E&&E.layout){const b=E.layout.layoutBox[w];b&&(g=Mr(b)*(parseFloat(g)/100))}}this.originPoint[w]=g}),m&&$t.postRender(()=>m(d,f)),jy(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=w8(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),l=()=>Fr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new WC(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:tI(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&$t.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!pf(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=c8(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&Do(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=u8(s.layoutBox,n):this.constraints=!1,this.elastic=p8(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Fr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=h8(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Do(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=b8(r,s.root,this.visualElement.getTransformPagePoint());let a=d8(s.layout.layoutBox,i);if(n){const o=n(m8(a));this.hasMutatedConstraints=!!o,o&&(a=QC(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Fr(d=>{if(!pf(d,n,this.currentDirection))return;let f=l&&l[d]||{};a&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return jy(this.visualElement,t),r.start(wE(t,r,0,n,this.visualElement,!1))}stopAnimation(){Fr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Fr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Fr(n=>{const{drag:r}=this.getProps();if(!pf(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[n];i.set(t[n]-nn(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Do(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Fr(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();s[a]=f8({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Fr(a=>{if(!pf(a,t,null))return;const o=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];o.set(nn(l,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;E8.set(this.visualElement,this);const t=this.visualElement.current,n=Yc(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Do(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),$t.read(r);const a=Ou(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Fr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=Wy,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function pf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function w8(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class v8 extends ea{constructor(t){super(t),this.removeGroupControls=Rr,this.removeListeners=Rr,this.controls=new x8(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rr}unmount(){this.removeGroupControls(),this.removeListeners()}}const s_=e=>(t,n)=>{e&&$t.postRender(()=>e(t,n))};class _8 extends ea{constructor(){super(...arguments),this.removePointerDownListener=Rr}onPointerDown(t){this.session=new WC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tI(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:s_(t),onStart:s_(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&$t.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Yc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ze.test(e))e=parseFloat(e);else return e;const n=i_(e,t.target.x),r=i_(e,t.target.y);return`${n}% ${r}%`}},T8={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Gi.parse(e);if(s.length>5)return r;const i=Gi.createTransformer(e),a=typeof s[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;s[0+a]/=o,s[1+a]/=l;const u=nn(o,l,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class N8 extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Q5(k8),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),oh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,s||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||$t.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Xb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nI(e){const[t,n]=FA(),r=v.useContext(Kb);return c.jsx(N8,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(qA),isPresent:t,safeToRemove:n})}const k8={borderRadius:{...uc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uc,borderTopRightRadius:uc,borderBottomLeftRadius:uc,borderBottomRightRadius:uc,boxShadow:T8};function S8(e,t,n){const r=qn(e)?e:Iu(e);return r.start(wE("",r,t,n)),r.animation}function A8(e){return e instanceof SVGElement&&e.tagName!=="svg"}const C8=(e,t)=>e.depth-t.depth;class I8{constructor(){this.children=[],this.isDirty=!1}add(t){oE(this.children,t),this.isDirty=!0}remove(t){lE(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(C8),this.isDirty=!1,this.children.forEach(t)}}function R8(e,t){const n=Ls.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(qi(r),e(i-t))};return $t.read(r,!0),()=>qi(r)}const rI=["TopLeft","TopRight","BottomLeft","BottomRight"],O8=rI.length,a_=e=>typeof e=="string"?parseFloat(e):e,o_=e=>typeof e=="number"||ze.test(e);function L8(e,t,n,r,s,i){s?(e.opacity=nn(0,n.opacity!==void 0?n.opacity:1,M8(r)),e.opacityExit=nn(t.opacity!==void 0?t.opacity:1,0,D8(r))):i&&(e.opacity=nn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(hl(e,t,r))}function c_(e,t){e.min=t.min,e.max=t.max}function Br(e,t){c_(e.x,t.x),c_(e.y,t.y)}function u_(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function d_(e,t,n,r,s){return e-=t,e=ip(e,1/n,r),s!==void 0&&(e=ip(e,1/s,r)),e}function P8(e,t=0,n=1,r=.5,s,i=e,a=e){if(Os.test(t)&&(t=parseFloat(t),t=nn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=nn(i.min,i.max,r);e===i&&(o-=t),e.min=d_(e.min,t,n,o,s),e.max=d_(e.max,t,n,o,s)}function f_(e,t,[n,r,s],i,a){P8(e,t[n],t[r],t[s],t.scale,i,a)}const j8=["x","scaleX","originX"],B8=["y","scaleY","originY"];function h_(e,t,n,r){f_(e.x,t,j8,n?n.x:void 0,r?r.x:void 0),f_(e.y,t,B8,n?n.y:void 0,r?r.y:void 0)}function p_(e){return e.translate===0&&e.scale===1}function iI(e){return p_(e.x)&&p_(e.y)}function m_(e,t){return e.min===t.min&&e.max===t.max}function F8(e,t){return m_(e.x,t.x)&&m_(e.y,t.y)}function g_(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aI(e,t){return g_(e.x,t.x)&&g_(e.y,t.y)}function y_(e){return Mr(e.x)/Mr(e.y)}function b_(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class U8{constructor(){this.members=[]}add(t){oE(this.members,t),t.scheduleRender()}remove(t){if(lE(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $8(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const pa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Cc=typeof window<"u"&&window.MotionDebug!==void 0,Mg=["","X","Y","Z"],H8={visibility:"hidden"},E_=1e3;let z8=0;function Dg(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function oI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=uC(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",$t,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&oI(r)}function lI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},o=t==null?void 0:t()){this.id=z8++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cc&&(pa.totalNodes=pa.resolvedTargetDeltas=pa.recalculatedProjection=0),this.nodes.forEach(Y8),this.nodes.forEach(Q8),this.nodes.forEach(Z8),this.nodes.forEach(W8),Cc&&window.MotionDebug.record(pa)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=R8(h,250),oh.hasAnimatedSinceResize&&(oh.hasAnimatedSinceResize=!1,this.nodes.forEach(w_))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||r9,{onLayoutAnimationStart:w,onLayoutAnimationComplete:g}=d.getProps(),E=!this.targetLayout||!aI(this.targetLayout,m)||p,b=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||h&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,b);const _={...aE(y,"layout"),onPlay:w,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||w_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,qi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(J8),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&oI(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const N=_/1e3;v_(f.x,a.x,N),v_(f.y,a.y,N),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),t9(this.relativeTarget,this.relativeTargetOrigin,h,N),b&&F8(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=un()),Br(b,this.relativeTarget)),y&&(this.animationValues=d,L8(d,u,this.latestValues,N,E,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$t.update(()=>{oh.hasAnimatedSinceResize=!0,this.currentAnimation=S8(0,E_,{...a,onUpdate:o=>{this.mixTargetDelta(o),a.onUpdate&&a.onUpdate(o)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(E_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:d}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&cI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||un();const f=Mr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const h=Mr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+h}Br(o,l),Fo(o,d),Wc(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new U8),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&Dg("z",a,u,this.animationValues);for(let d=0;d{var o;return(o=a.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(x_),this.root.sharedNodes.clear()}}}function V8(e){e.updateLayout()}function K8(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;i==="size"?Fr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Mr(h);h.min=r[f].min,h.max=h.min+p}):cI(i,n.layoutBox,r)&&Fr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Mr(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=jo();Wc(o,r,n.layoutBox);const l=jo();a?Wc(l,e.applyTransform(s,!0),n.measuredBox):Wc(l,r,n.layoutBox);const u=!iI(o);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=un();qc(m,n.layoutBox,h.layoutBox);const y=un();qc(y,r,p.layoutBox),aI(m,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Y8(e){Cc&&pa.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function W8(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function q8(e){e.clearSnapshot()}function x_(e){e.clearMeasurements()}function G8(e){e.isLayoutDirty=!1}function X8(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function w_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Q8(e){e.resolveTargetDelta()}function Z8(e){e.calcProjection()}function J8(e){e.resetSkewAndRotation()}function e9(e){e.removeLeadSnapshot()}function v_(e,t,n){e.translate=nn(t.translate,0,n),e.scale=nn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function __(e,t,n,r){e.min=nn(t.min,n.min,r),e.max=nn(t.max,n.max,r)}function t9(e,t,n,r){__(e.x,t.x,n.x,r),__(e.y,t.y,n.y,r)}function n9(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const r9={duration:.45,ease:[.4,0,.1,1]},T_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),N_=T_("applewebkit/")&&!T_("chrome/")?Math.round:Rr;function k_(e){e.min=N_(e.min),e.max=N_(e.max)}function s9(e){k_(e.x),k_(e.y)}function cI(e,t,n){return e==="position"||e==="preserve-aspect"&&!o8(y_(t),y_(n),.2)}function i9(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const a9=lI({attachResizeListener:(e,t)=>Ou(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Pg={current:void 0},uI=lI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Pg.current){const e=new a9({});e.mount(window),e.setOptions({layoutScroll:!0}),Pg.current=e}return Pg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),o9={pan:{Feature:_8},drag:{Feature:v8,ProjectionNode:uI,MeasureLayout:nI}};function l9(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const i=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function dI(e,t){const n=l9(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function S_(e){return t=>{t.pointerType==="touch"||YC()||e(t)}}function c9(e,t,n={}){const[r,s,i]=dI(e,n),a=S_(o=>{const{target:l}=o,u=t(o);if(typeof u!="function"||!l)return;const d=S_(f=>{u(f),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,s)});return r.forEach(o=>{o.addEventListener("pointerenter",a,s)}),i}function A_(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&$t.postRender(()=>i(t,ud(t)))}class u9 extends ea{mount(){const{current:t}=this.node;t&&(this.unmount=c9(t,n=>(A_(this.node,n,"Start"),r=>A_(this.node,r,"End"))))}unmount(){}}class d9 extends ea{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=cd(Ou(this.node.current,"focus",()=>this.onFocus()),Ou(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const fI=(e,t)=>t?e===t?!0:fI(e,t.parentElement):!1,f9=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function h9(e){return f9.has(e.tagName)||e.tabIndex!==-1}const Ic=new WeakSet;function C_(e){return t=>{t.key==="Enter"&&e(t)}}function jg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const p9=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=C_(()=>{if(Ic.has(n))return;jg(n,"down");const s=C_(()=>{jg(n,"up")}),i=()=>jg(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function I_(e){return vE(e)&&!YC()}function m9(e,t,n={}){const[r,s,i]=dI(e,n),a=o=>{const l=o.currentTarget;if(!I_(o)||Ic.has(l))return;Ic.add(l);const u=t(o),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!I_(p)||!Ic.has(l))&&(Ic.delete(l),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||fI(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(o=>{!h9(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,s),o.addEventListener("focus",u=>p9(u,s),s)}),i}function R_(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&$t.postRender(()=>i(t,ud(t)))}class g9 extends ea{mount(){const{current:t}=this.node;t&&(this.unmount=m9(t,n=>(R_(this.node,n,"Start"),(r,{success:s})=>R_(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Xy=new WeakMap,Bg=new WeakMap,y9=e=>{const t=Xy.get(e.target);t&&t(e)},b9=e=>{e.forEach(y9)};function E9({root:e,...t}){const n=e||document;Bg.has(n)||Bg.set(n,{});const r=Bg.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(b9,{root:e,...t})),r[s]}function x9(e,t,n){const r=E9(t);return Xy.set(e,n),r.observe(e),()=>{Xy.delete(e),r.unobserve(e)}}const w9={some:0,all:1};class v9 extends ea{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:w9[s]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(l)};return x9(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(_9(t,n))&&this.startObserver()}unmount(){}}function _9({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const T9={inView:{Feature:v9},tap:{Feature:g9},focus:{Feature:d9},hover:{Feature:u9}},N9={layout:{ProjectionNode:uI,MeasureLayout:nI}},Qy={current:null},hI={current:!1};function k9(){if(hI.current=!0,!!Yb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Qy.current=e.matches;e.addListener(t),t()}else Qy.current=!1}const S9=[...MC,Yn,Gi],A9=e=>S9.find(LC(e)),O_=new WeakMap;function C9(e,t,n){for(const r in t){const s=t[r],i=n[r];if(qn(s))e.addValue(r,s);else if(qn(i))e.addValue(r,Iu(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Iu(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const L_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class I9{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ls.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),hI.current||k9(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Qy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){O_.delete(this.current),this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=eo.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&$t.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in fl){const n=fl[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):un()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Iu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(RC(s)||vC(s))?s=parseFloat(s):!A9(s)&&Gi.test(n)&&(s=AC(t,n)),this.setBaseTarget(t,qn(s)?s.get():s)),qn(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const a=Zb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(s=a[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!qn(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new cE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class pI extends I9{constructor(){super(...arguments),this.KeyframeResolver=DC}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;qn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function R9(e){return window.getComputedStyle(e)}class O9 extends pI{constructor(){super(...arguments),this.type="html",this.renderInstance=tC}readValueFromInstance(t,n){if(eo.has(n)){const r=yE(n);return r&&r.default||0}else{const r=R9(t),s=(ZA(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return eI(t,n)}build(t,n,r){tE(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return iE(t,n,r)}}class L9 extends pI{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=un}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(eo.has(n)){const r=yE(n);return r&&r.default||0}return n=nC.has(n)?n:Gb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iC(t,n,r)}build(t,n,r){nE(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){rC(t,n,r,s)}mount(t){this.isSVGTag=sE(t.tagName),super.mount(t)}}const M9=(e,t)=>Qb(e)?new L9(t):new O9(t,{allowProjection:e!==v.Fragment}),D9=aj({...QB,...T9,...o9,...N9},M9),Gt=w5(D9);function _n(){return _n=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?v.useEffect:v.useLayoutEffect;function yo(e,t,n){var r=v.useRef(t);r.current=t,v.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var P9=["container"];function j9(e){var t=e.container,n=t===void 0?document.body:t,r=cm(e,P9);return $a.createPortal(et.createElement("div",_n({},r)),n)}function B9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function F9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function U9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function $9(){return v.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function D_(e){var t=e.touches[0],n=t.clientX,r=t.clientY;if(e.touches.length>=2){var s=e.touches[1],i=s.clientX,a=s.clientY;return[(n+i)/2,(r+a)/2,Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2))]}return[n,r,0]}var Ni=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,o=e;return i<=r?(s=1,o=0):e>0&&a-e<=0?(s=2,o=a):e<0&&a+e<=0&&(s=3,o=-a),[s,o]};function Fg(e,t,n,r,s,i,a,o,l,u){a===void 0&&(a=innerWidth/2),o===void 0&&(o=innerHeight/2),l===void 0&&(l=0),u===void 0&&(u=0);var d=Ni(e,i,n,innerWidth)[0],f=Ni(t,i,r,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-i/s*(a-(h+e))-h+(r/n>=3&&n*i===innerWidth?0:d?l/2:l),y:o-i/s*(o-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:o}}function e1(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function Ug(e,t,n){var r=e1(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,o=s,l=i,u=e/t*i,d=t/e*s;return e=i?o=u:e>=s&&ts/i?l=d:t/e>=3&&!r[2]?a=((l=d)-i)/2:o=u,{width:o,height:l,x:0,y:a,pause:!0}}function gf(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,o=v.useRef(e);o.current=e;var l=v.useRef(0),u=v.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=v.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){l.current=p,d(),o.current.apply(null,h)}var y=l.current,w=p-y;if(y===0&&(r&&m(),l.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){l=requestAnimationFrame(u)}}var z9={T:0,L:0,W:0,H:0,FIT:void 0},gI=function(){var e=v.useRef(!1);return v.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},V9=["className"];function K9(e){var t=e.className,n=t===void 0?"":t,r=cm(e,V9);return et.createElement("div",_n({className:"PhotoView__Spinner "+n},r),et.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},et.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),et.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var Y9=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function W9(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,o=e.brokenElement,l=cm(e,Y9),u=gI();return t&&!r?et.createElement(et.Fragment,null,et.createElement("img",_n({className:"PhotoView__Photo"+(s?" "+s:""),src:t,onLoad:function(d){var f=d.target;u.current&&i({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&i({broken:!0})},draggable:!1,alt:""},l)),!n&&(a?et.createElement("span",{className:"PhotoView__icon"},a):et.createElement(K9,{className:"PhotoView__icon"}))):o?et.createElement("span",{className:"PhotoView__icon"},typeof o=="function"?o({src:t}):o):null}var q9={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function G9(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,o=a===void 0?0:a,l=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,y=e.loadingElement,w=e.brokenElement,g=e.onPhotoTap,E=e.onMaskTap,b=e.onReachMove,_=e.onReachUp,N=e.onPhotoResize,T=e.isActive,A=e.expose,k=ap(q9),R=k[0],I=k[1],M=v.useRef(0),B=gI(),Y=R.naturalWidth,P=Y===void 0?i:Y,U=R.naturalHeight,C=U===void 0?o:U,L=R.width,O=L===void 0?i:L,j=R.height,S=j===void 0?o:j,H=R.loaded,V=H===void 0?!n:H,D=R.broken,ne=R.x,ee=R.y,re=R.touched,de=R.stopRaf,G=R.maskTouched,W=R.rotate,oe=R.scale,he=R.CX,J=R.CY,ce=R.lastX,Ce=R.lastY,Ee=R.lastCX,ge=R.lastCY,Le=R.lastScale,ve=R.touchTime,Ue=R.touchLength,Ie=R.pause,ae=R.reach,wt=Ra({onScale:function(ue){return we(mf(ue))},onRotate:function(ue){W!==ue&&(A({rotate:ue}),I(_n({rotate:ue},Ug(P,C,ue))))}});function we(ue,Oe,Qe){oe!==ue&&(A({scale:ue}),I(_n({scale:ue},Fg(ne,ee,O,S,oe,ue,Oe,Qe),ue<=1&&{x:0,y:0})))}var vt=gf(function(ue,Oe,Qe){if(Qe===void 0&&(Qe=0),(re||G)&&T){var cn=e1(W,O,S),an=cn[0],ie=cn[1];if(Qe===0&&M.current===0){var _e=Math.abs(ue-he)<=20,ye=Math.abs(Oe-J)<=20;if(_e&&ye)return void I({lastCX:ue,lastCY:Oe});M.current=_e?Oe>J?3:2:1}var Pe,$e=ue-Ee,qe=Oe-ge;if(Qe===0){var gt=Ni($e+ce,oe,an,innerWidth)[0],It=Ni(qe+Ce,oe,ie,innerHeight);Pe=function(gn,yn,zt,kn){return yn&&gn===1||kn==="x"?"x":zt&&gn>1||kn==="y"?"y":void 0}(M.current,gt,It[0],ae),Pe!==void 0&&b(Pe,ue,Oe,oe)}if(Pe==="x"||G)return void I({reach:"x"});var Rt=mf(oe+(Qe-Ue)/100/2*oe,P/O,.2);A({scale:Rt}),I(_n({touchLength:Qe,reach:Pe,scale:Rt},Fg(ne,ee,O,S,oe,Rt,ue,Oe,$e,qe)))}},{maxWait:8});function ct(ue){return!de&&!re&&(B.current&&I(_n({},ue,{pause:u})),B.current)}var K,X,le,Ne,Re,ut,We,ot,Zt=(Re=function(ue){return ct({x:ue})},ut=function(ue){return ct({y:ue})},We=function(ue){return B.current&&(A({scale:ue}),I({scale:ue})),!re&&B.current},ot=Ra({X:function(ue){return Re(ue)},Y:function(ue){return ut(ue)},S:function(ue){return We(ue)}}),function(ue,Oe,Qe,cn,an,ie,_e,ye,Pe,$e,qe){var gt=e1($e,an,ie),It=gt[0],Rt=gt[1],gn=Ni(ue,ye,It,innerWidth),yn=gn[0],zt=gn[1],kn=Ni(Oe,ye,Rt,innerHeight),er=kn[0],_r=kn[1],Dn=Date.now()-qe;if(Dn>=200||ye!==_e||Math.abs(Pe-_e)>1){var Hn=Fg(ue,Oe,an,ie,_e,ye),tr=Hn.x,Tr=Hn.y,Vt=yn?zt:tr!==ue?tr:null,Sn=er?_r:Tr!==Oe?Tr:null;return Vt!==null&&ba(ue,Vt,ot.X),Sn!==null&&ba(Oe,Sn,ot.Y),void(ye!==_e&&ba(_e,ye,ot.S))}var Pn=(ue-Qe)/Dn,nr=(Oe-cn)/Dn,zn=Math.sqrt(Math.pow(Pn,2)+Math.pow(nr,2)),An=!1,st=!1;(function(Cn,Bt){var Jt,In=Cn,jn=0,wn=0,rr=function(ke){Jt||(Jt=ke);var Me=ke-Jt,He=Math.sign(Cn),Lt=-.001*He,yt=Math.sign(-In)*Math.pow(In,2)*2e-4,Kt=In*Me+(Lt+yt)*Math.pow(Me,2)/2;jn+=Kt,Jt=ke,He*(In+=(Lt+yt)*Me)<=0?Z():Bt(jn)?Ot():Z()};function Ot(){wn=requestAnimationFrame(rr)}function Z(){cancelAnimationFrame(wn)}Ot()})(zn,function(Cn){var Bt=ue+Cn*(Pn/zn),Jt=Oe+Cn*(nr/zn),In=Ni(Bt,_e,It,innerWidth),jn=In[0],wn=In[1],rr=Ni(Jt,_e,Rt,innerHeight),Ot=rr[0],Z=rr[1];if(jn&&!An&&(An=!0,yn?ba(Bt,wn,ot.X):P_(wn,Bt+(Bt-wn),ot.X)),Ot&&!st&&(st=!0,er?ba(Jt,Z,ot.Y):P_(Z,Jt+(Jt-Z),ot.Y)),An&&st)return!1;var ke=An||ot.X(wn),Me=st||ot.Y(Z);return ke&&Me})}),Ct=(K=g,X=function(ue,Oe){ae||we(oe!==1?1:Math.max(2,P/O),ue,Oe)},le=v.useRef(0),Ne=gf(function(){le.current=0,K.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var ue=[].slice.call(arguments);le.current+=1,Ne.apply(void 0,ue),le.current>=2&&(Ne.cancel(),le.current=0,X.apply(void 0,ue))});function Ge(ue,Oe){if(M.current=0,(re||G)&&T){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Qe=mf(oe,P/O);if(Zt(ne,ee,ce,Ce,O,S,oe,Qe,Le,W,ve),_(ue,Oe),he===ue&&J===Oe){if(re)return void Ct(ue,Oe);G&&E(ue,Oe)}}}function Et(ue,Oe,Qe){Qe===void 0&&(Qe=0),I({touched:!0,CX:ue,CY:Oe,lastCX:ue,lastCY:Oe,lastX:ne,lastY:ee,lastScale:oe,touchLength:Qe,touchTime:Date.now()})}function Ht(ue){I({maskTouched:!0,CX:ue.clientX,CY:ue.clientY,lastX:ne,lastY:ee})}yo(Ks?void 0:"mousemove",function(ue){ue.preventDefault(),vt(ue.clientX,ue.clientY)}),yo(Ks?void 0:"mouseup",function(ue){Ge(ue.clientX,ue.clientY)}),yo(Ks?"touchmove":void 0,function(ue){ue.preventDefault();var Oe=D_(ue);vt.apply(void 0,Oe)},{passive:!1}),yo(Ks?"touchend":void 0,function(ue){var Oe=ue.changedTouches[0];Ge(Oe.clientX,Oe.clientY)},{passive:!1}),yo("resize",gf(function(){V&&!re&&(I(Ug(P,C,W)),N())},{maxWait:8})),Jy(function(){T&&A(_n({scale:oe,rotate:W},wt))},[T]);var Nn=function(ue,Oe,Qe,cn,an,ie,_e,ye,Pe,$e){var qe=function(tr,Tr,Vt,Sn,Pn){var nr=v.useRef(!1),zn=ap({lead:!0,scale:Vt}),An=zn[0],st=An.lead,Cn=An.scale,Bt=zn[1],Jt=gf(function(In){try{return Pn(!0),Bt({lead:!1,scale:In}),Promise.resolve()}catch(jn){return Promise.reject(jn)}},{wait:Sn});return Jy(function(){nr.current?(Pn(!1),Bt({lead:!0}),Jt(Vt)):nr.current=!0},[Vt]),st?[tr*Cn,Tr*Cn,Vt/Cn]:[tr*Vt,Tr*Vt,1]}(ie,_e,ye,Pe,$e),gt=qe[0],It=qe[1],Rt=qe[2],gn=function(tr,Tr,Vt,Sn,Pn){var nr=v.useState(z9),zn=nr[0],An=nr[1],st=v.useState(0),Cn=st[0],Bt=st[1],Jt=v.useRef(),In=Ra({OK:function(){return tr&&Bt(4)}});function jn(wn){Pn(!1),Bt(wn)}return v.useEffect(function(){if(Jt.current||(Jt.current=Date.now()),Vt){if(function(wn,rr){var Ot=wn&&wn.current;if(Ot&&Ot.nodeType===1){var Z=Ot.getBoundingClientRect();rr({T:Z.top,L:Z.left,W:Z.width,H:Z.height,FIT:Ot.tagName==="IMG"?getComputedStyle(Ot).objectFit:void 0})}}(Tr,An),tr)return Date.now()-Jt.current<250?(Bt(1),requestAnimationFrame(function(){Bt(2),requestAnimationFrame(function(){return jn(3)})}),void setTimeout(In.OK,Sn)):void Bt(4);jn(5)}},[tr,Vt]),[Cn,zn]}(ue,Oe,Qe,Pe,$e),yn=gn[0],zt=gn[1],kn=zt.W,er=zt.FIT,_r=innerWidth/2,Dn=innerHeight/2,Hn=yn<3||yn>4;return[Hn?kn?zt.L:_r:cn+(_r-ie*ye/2),Hn?kn?zt.T:Dn:an+(Dn-_e*ye/2),gt,Hn&&er?gt*(zt.H/kn):It,yn===0?Rt:Hn?kn/(ie*ye)||.01:Rt,Hn?er?1:0:1,yn,er]}(u,l,V,ne,ee,O,S,oe,d,function(ue){return I({pause:ue})}),Fe=Nn[4],rt=Nn[6],tt="transform "+d+"ms "+f,mt={className:p,onMouseDown:Ks?void 0:function(ue){ue.stopPropagation(),ue.button===0&&Et(ue.clientX,ue.clientY,0)},onTouchStart:Ks?function(ue){ue.stopPropagation(),Et.apply(void 0,D_(ue))}:void 0,onWheel:function(ue){if(!ae){var Oe=mf(oe-ue.deltaY/100/2,P/O);I({stopRaf:!0}),we(Oe,ue.clientX,ue.clientY)}},style:{width:Nn[2]+"px",height:Nn[3]+"px",opacity:Nn[5],objectFit:rt===4?void 0:Nn[7],transform:W?"rotate("+W+"deg)":void 0,transition:rt>2?tt+", opacity "+d+"ms ease, height "+(rt<4?d/2:rt>4?d:0)+"ms "+f:void 0}};return et.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Ks&&T?Ht:void 0,onTouchStart:Ks&&T?function(ue){return Ht(ue.touches[0])}:void 0},et.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Fe+", 0, 0, "+Fe+", "+Nn[0]+", "+Nn[1]+")",transition:re||Ie?void 0:tt,willChange:T?"transform":void 0}},n?et.createElement(W9,_n({src:n,loaded:V,broken:D},mt,{onPhotoLoad:function(ue){I(_n({},ue,ue.loaded&&Ug(ue.naturalWidth||0,ue.naturalHeight||0,W)))},loadingElement:y,brokenElement:w})):r&&r({attrs:mt,scale:Fe,rotate:W})))}var j_={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function X9(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,o=a===void 0||a,l=e.maskOpacity,u=l===void 0?1:l,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,y=e.toolbarRender,w=e.className,g=e.maskClassName,E=e.photoClassName,b=e.photoWrapClassName,_=e.loadingElement,N=e.brokenElement,T=e.images,A=e.index,k=A===void 0?0:A,R=e.onIndexChange,I=e.visible,M=e.onClose,B=e.afterClose,Y=e.portalContainer,P=ap(j_),U=P[0],C=P[1],L=v.useState(0),O=L[0],j=L[1],S=U.x,H=U.touched,V=U.pause,D=U.lastCX,ne=U.lastCY,ee=U.bg,re=ee===void 0?u:ee,de=U.lastBg,G=U.overlay,W=U.minimal,oe=U.scale,he=U.rotate,J=U.onScale,ce=U.onRotate,Ce=e.hasOwnProperty("index"),Ee=Ce?k:O,ge=Ce?R:j,Le=v.useRef(Ee),ve=T.length,Ue=T[Ee],Ie=typeof n=="boolean"?n:ve>n,ae=function(Fe,rt){var tt=v.useReducer(function(Qe){return!Qe},!1)[1],mt=v.useRef(0),ue=function(Qe){var cn=v.useRef(Qe);function an(ie){cn.current=ie}return v.useMemo(function(){(function(ie){Fe?(ie(Fe),mt.current=1):mt.current=2})(an)},[Qe]),[cn.current,an]}(Fe),Oe=ue[1];return[ue[0],mt.current,function(){tt(),mt.current===2&&(Oe(!1),rt&&rt()),mt.current=0}]}(I,B),wt=ae[0],we=ae[1],vt=ae[2];Jy(function(){if(wt)return C({pause:!0,x:Ee*-(innerWidth+uo)}),void(Le.current=Ee);C(j_)},[wt]);var ct=Ra({close:function(Fe){ce&&ce(0),C({overlay:!0,lastBg:re}),M(Fe)},changeIndex:function(Fe,rt){rt===void 0&&(rt=!1);var tt=Ie?Le.current+(Fe-Ee):Fe,mt=ve-1,ue=Zy(tt,0,mt),Oe=Ie?tt:ue,Qe=innerWidth+uo;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-Qe*Oe,pause:rt}),Le.current=Oe,ge&&ge(Ie?Fe<0?mt:Fe>mt?0:Fe:ue)}}),K=ct.close,X=ct.changeIndex;function le(Fe){return Fe?K():C({overlay:!G})}function Ne(){C({x:-(innerWidth+uo)*Ee,lastCX:void 0,lastCY:void 0,pause:!0}),Le.current=Ee}function Re(Fe,rt,tt,mt){Fe==="x"?function(ue){if(D!==void 0){var Oe=ue-D,Qe=Oe;!Ie&&(Ee===0&&Oe>0||Ee===ve-1&&Oe<0)&&(Qe=Oe/2),C({touched:!0,lastCX:D,x:-(innerWidth+uo)*Le.current+Qe,pause:!1})}else C({touched:!0,lastCX:ue,x:S,pause:!1})}(rt):Fe==="y"&&function(ue,Oe){if(ne!==void 0){var Qe=u===null?null:Zy(u,.01,u-Math.abs(ue-ne)/100/4);C({touched:!0,lastCY:ne,bg:Oe===1?Qe:u,minimal:Oe===1})}else C({touched:!0,lastCY:ue,bg:re,minimal:!0})}(tt,mt)}function ut(Fe,rt){var tt=Fe-(D??Fe),mt=rt-(ne??rt),ue=!1;if(tt<-40)X(Ee+1);else if(tt>40)X(Ee-1);else{var Oe=-(innerWidth+uo)*Le.current;Math.abs(mt)>100&&W&&f&&(ue=!0,K()),C({touched:!1,x:Oe,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!ue||G})}}yo("keydown",function(Fe){if(I)switch(Fe.key){case"ArrowLeft":X(Ee-1,!0);break;case"ArrowRight":X(Ee+1,!0);break;case"Escape":K()}});var We=function(Fe,rt,tt){return v.useMemo(function(){var mt=Fe.length;return tt?Fe.concat(Fe).concat(Fe).slice(mt+rt-1,mt+rt+2):Fe.slice(Math.max(rt-1,0),Math.min(rt+2,mt+1))},[Fe,rt,tt])}(T,Ee,Ie);if(!wt)return null;var ot=G&&!we,Zt=I?re:de,Ct=J&&ce&&{images:T,index:Ee,visible:I,onClose:K,onIndexChange:X,overlayVisible:ot,overlay:Ue&&Ue.overlay,scale:oe,rotate:he,onScale:J,onRotate:ce},Ge=r?r(we):400,Et=s?s(we):M_,Ht=r?r(3):600,Nn=s?s(3):M_;return et.createElement(j9,{className:"PhotoView-Portal"+(ot?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(Fe){return Fe.stopPropagation()},container:Y},I&&et.createElement($9,null),et.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(we===1?" PhotoView-Slider__fadeIn":we===2?" PhotoView-Slider__fadeOut":""),style:{background:Zt?"rgba(0, 0, 0, "+Zt+")":void 0,transitionTimingFunction:Et,transitionDuration:(H?0:Ge)+"ms",animationDuration:Ge+"ms"},onAnimationEnd:vt}),p&&et.createElement("div",{className:"PhotoView-Slider__BannerWrap"},et.createElement("div",{className:"PhotoView-Slider__Counter"},Ee+1," / ",ve),et.createElement("div",{className:"PhotoView-Slider__BannerRight"},y&&Ct&&y(Ct),et.createElement(B9,{className:"PhotoView-Slider__toolbarIcon",onClick:K}))),We.map(function(Fe,rt){var tt=Ie||Ee!==0?Le.current-1+rt:Ee+rt;return et.createElement(G9,{key:Ie?Fe.key+"/"+Fe.src+"/"+tt:Fe.key,item:Fe,speed:Ge,easing:Et,visible:I,onReachMove:Re,onReachUp:ut,onPhotoTap:function(){return le(i)},onMaskTap:function(){return le(o)},wrapClassName:b,className:E,style:{left:(innerWidth+uo)*tt+"px",transform:"translate3d("+S+"px, 0px, 0)",transition:H||V?void 0:"transform "+Ht+"ms "+Nn},loadingElement:_,brokenElement:N,onPhotoResize:Ne,isActive:Le.current===tt,expose:C})}),!Ks&&p&&et.createElement(et.Fragment,null,(Ie||Ee!==0)&&et.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return X(Ee-1,!0)}},et.createElement(F9,null)),(Ie||Ee+1-1){var g=u.slice();return g.splice(w,1,y),void o({images:g})}o(function(E){return{images:E.images.concat(y)}})},remove:function(y){o(function(w){var g=w.images.filter(function(E){return E.key!==y});return{images:g,index:Math.min(g.length-1,f)}})},show:function(y){var w=u.findIndex(function(g){return g.key===y});o({visible:!0,index:w}),r&&r(!0,w,a)}}),p=Ra({close:function(){o({visible:!1}),r&&r(!1,f,a)},changeIndex:function(y){o({index:y}),n&&n(y,a)}}),m=v.useMemo(function(){return _n({},a,h)},[a,h]);return et.createElement(mI.Provider,{value:m},t,et.createElement(X9,_n({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var yI=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,o=e.height,l=e.triggers,u=l===void 0?["onClick"]:l,d=e.children,f=v.useContext(mI),h=(t=function(){return f.nextId()},(n=v.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=v.useRef(null);v.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),v.useEffect(function(){return function(){f.remove(h)}},[]);var m=Ra({render:function(w){return s&&s(w)},show:function(w,g){f.show(h),function(E,b){if(d){var _=d.props[E];_&&_(b)}}(w,g)}}),y=v.useMemo(function(){var w={};return u.forEach(function(g){w[g]=m.show.bind(null,g)}),w},[]);return v.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:o})},[r]),d?v.Children.only(v.cloneElement(d,_n({},y,{ref:p}))):null};/** + `),()=>{document.head.removeChild(d)}},[t]),c.jsx(u5,{isPresent:t,childRef:r,sizeRef:s,children:v.cloneElement(e,{ref:r})})}const f5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const o=nm(h5),l=v.useId(),u=v.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=v.useMemo(()=>({id:l,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(o.set(f,!1),()=>o.delete(f))}),i?[Math.random(),u]:[n,u]);return v.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),v.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),a==="popLayout"&&(e=c.jsx(d5,{isPresent:n,children:e})),c.jsx(rm.Provider,{value:d,children:e})};function h5(){return new Map}function FA(e=!0){const t=v.useContext(rm);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=v.useId();v.useEffect(()=>{e&&s(i)},[e]);const a=v.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const df=e=>e.key||"";function Ev(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Kb=typeof window<"u",UA=Kb?v.useLayoutEffect:v.useEffect,Hi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[o,l]=FA(a),u=v.useMemo(()=>Ev(e),[e]),d=a&&!o?[]:u.map(df),f=v.useRef(!0),h=v.useRef(u),p=nm(()=>new Map),[m,y]=v.useState(u),[w,g]=v.useState(u);UA(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=df(_),T=a&&!o?!1:u===w||d.includes(k),A=()=>{if(p.has(k))p.set(k,!0);else return;let N=!0;p.forEach(R=>{R||(N=!1)}),N&&(b==null||b(),g(h.current),a&&(l==null||l()),r&&r())};return c.jsx(f5,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:T?void 0:A,children:_},k)})})},Rr=e=>e;let $A=Rr;const p5={useManualTiming:!1};function m5(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&i.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(a=u,r){s=!0;return}r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,s&&(s=!1,l.process(u))}};return l}const ff=["read","resolveKeyframes","update","preRender","render","postRender"],g5=40;function HA(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=ff.reduce((g,E)=>(g[E]=m5(i),g),{}),{read:o,resolveKeyframes:l,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const g=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(g-s.timestamp,g5),1),s.timestamp=g,s.isProcessing=!0,o.process(s),l.process(s),u.process(s),d.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:ff.reduce((g,E)=>{const b=a[E];return g[E]=(_,k=!1,T=!1)=>(n||m(),b.schedule(_,k,T)),g},{}),cancel:g=>{for(let E=0;Exv[e].some(n=>!!t[n])};function y5(e){for(const t in e)fl[t]={...fl[t],...e[t]}}const b5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Jh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||b5.has(e)}let VA=e=>!Jh(e);function KA(e){e&&(VA=t=>t.startsWith("on")?!Jh(t):e(t))}try{KA(require("@emotion/is-prop-valid").default)}catch{}function E5(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(VA(s)||n===!0&&Jh(s)||!t&&!Jh(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function x5({children:e,isValidProp:t,...n}){t&&KA(t),n={...v.useContext(Su),...n},n.isStatic=nm(()=>n.isStatic);const r=v.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return c.jsx(Su.Provider,{value:r,children:e})}function w5(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const sm=v.createContext({});function Au(e){return typeof e=="string"||Array.isArray(e)}function im(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Yb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wb=["initial",...Yb];function am(e){return im(e.animate)||Wb.some(t=>Au(e[t]))}function YA(e){return!!(am(e)||e.variants)}function v5(e,t){if(am(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Au(n)?n:void 0,animate:Au(r)?r:void 0}}return e.inherit!==!1?t:{}}function _5(e){const{initial:t,animate:n}=v5(e,v.useContext(sm));return v.useMemo(()=>({initial:t,animate:n}),[wv(t),wv(n)])}function wv(e){return Array.isArray(e)?e.join(" "):e}const T5=Symbol.for("motionComponentSymbol");function Do(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function k5(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Do(n)&&(n.current=r))},[t])}const qb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),N5="framerAppearId",WA="data-"+qb(N5),{schedule:Gb}=HA(queueMicrotask,!1),qA=v.createContext({});function S5(e,t,n,r,s){var i,a;const{visualElement:o}=v.useContext(sm),l=v.useContext(zA),u=v.useContext(rm),d=v.useContext(Su).reducedMotion,f=v.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=v.useContext(qA);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&A5(f.current,n,s,p);const m=v.useRef(!1);v.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const y=n[WA],w=v.useRef(!!y&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,y)));return UA(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Gb.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),w.current=!1))}),h}function A5(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:GA(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||o&&Do(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function GA(e){if(e)return e.options.allowProjection!==!1?e.projection:GA(e.parent)}function C5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&y5(e);function o(u,d){let f;const h={...v.useContext(Su),...u,layoutId:I5(u)},{isStatic:p}=h,m=_5(u),y=r(u,p);if(!p&&Kb){R5();const w=O5(h);f=w.MeasureLayout,m.visualElement=S5(s,y,h,t,w.ProjectionNode)}return c.jsxs(sm.Provider,{value:m,children:[f&&m.visualElement?c.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,k5(y,m.visualElement,d),y,p,m.visualElement)]})}o.displayName=`motion.${typeof s=="string"?s:`create(${(a=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&a!==void 0?a:""})`}`;const l=v.forwardRef(o);return l[T5]=s,l}function I5({layoutId:e}){const t=v.useContext(Vb).id;return t&&e!==void 0?t+"-"+e:e}function R5(e,t){v.useContext(zA).strict}function O5(e){const{drag:t,layout:n}=fl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const L5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Xb(e){return typeof e!="string"||e.includes("-")?!1:!!(L5.indexOf(e)>-1||/[A-Z]/u.test(e))}function vv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Qb(e,t,n,r){if(typeof t=="function"){const[s,i]=vv(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=vv(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Dy=e=>Array.isArray(e),M5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),D5=e=>Dy(e)?e[e.length-1]||0:e,qn=e=>!!(e&&e.getVelocity);function ih(e){const t=qn(e)?e.get():e;return M5(t)?t.toValue():t}function P5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:j5(r,s,i,e),renderState:t()};return n&&(a.onMount=o=>n({props:r,current:o,...a}),a.onUpdate=o=>n(o)),a}const XA=e=>(t,n)=>{const r=v.useContext(sm),s=v.useContext(rm),i=()=>P5(e,t,r,s);return n?i():nm(i)};function j5(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=ih(i[h]);let{initial:a,animate:o}=e;const l=am(e),u=YA(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?o:a;if(f&&typeof f!="boolean"&&!im(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),ZA=QA("--"),B5=QA("var(--"),Zb=e=>B5(e)?F5.test(e.split("/*")[0].trim()):!1,F5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,JA=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ci=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Cu={...jl,transform:e=>ci(0,1,e)},hf={...jl,default:1},od=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xi=od("deg"),Os=od("%"),ze=od("px"),U5=od("vh"),$5=od("vw"),_v={...Os,parse:e=>Os.parse(e)/100,transform:e=>Os.transform(e*100)},H5={borderWidth:ze,borderTopWidth:ze,borderRightWidth:ze,borderBottomWidth:ze,borderLeftWidth:ze,borderRadius:ze,radius:ze,borderTopLeftRadius:ze,borderTopRightRadius:ze,borderBottomRightRadius:ze,borderBottomLeftRadius:ze,width:ze,maxWidth:ze,height:ze,maxHeight:ze,top:ze,right:ze,bottom:ze,left:ze,padding:ze,paddingTop:ze,paddingRight:ze,paddingBottom:ze,paddingLeft:ze,margin:ze,marginTop:ze,marginRight:ze,marginBottom:ze,marginLeft:ze,backgroundPositionX:ze,backgroundPositionY:ze},z5={rotate:xi,rotateX:xi,rotateY:xi,rotateZ:xi,scale:hf,scaleX:hf,scaleY:hf,scaleZ:hf,skew:xi,skewX:xi,skewY:xi,distance:ze,translateX:ze,translateY:ze,translateZ:ze,x:ze,y:ze,z:ze,perspective:ze,transformPerspective:ze,opacity:Cu,originX:_v,originY:_v,originZ:ze},Tv={...jl,transform:Math.round},Jb={...H5,...z5,zIndex:Tv,size:ze,fillOpacity:Cu,strokeOpacity:Cu,numOctaves:Tv},V5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},K5=Pl.length;function Y5(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),eC=()=>({...nE(),attrs:{}}),rE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function tC(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function rC(e,t,n,r){tC(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:qb(s),t.attrs[s])}const ep={};function Q5(e){Object.assign(ep,e)}function sC(e,{layout:t,layoutId:n}){return eo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ep[e]||e==="opacity")}function sE(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(qn(s[a])||t.style&&qn(t.style[a])||sC(a,e)||((r=n==null?void 0:n.getValue(a))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[a]=s[a]);return i}function iC(e,t,n){const r=sE(e,t,n);for(const s in e)if(qn(e[s])||qn(t[s])){const i=Pl.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function Z5(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Nv=["x","y","width","height","cx","cy","r"],J5={useVisualState:XA({scrapeMotionValuesFromProps:iC,createRenderState:eC,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const o in s)if(eo.has(o)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let o=0;o{Z5(n,r),$t.render(()=>{tE(r,s,rE(n.tagName),e.transformTemplate),rC(n,r)})})}})},ej={useVisualState:XA({scrapeMotionValuesFromProps:sE,createRenderState:nE})};function aC(e,t,n){for(const r in t)!qn(t[r])&&!sC(r,n)&&(e[r]=t[r])}function tj({transformTemplate:e},t){return v.useMemo(()=>{const n=nE();return eE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nj(e,t){const n=e.style||{},r={};return aC(r,n,e),Object.assign(r,tj(e,t)),r}function rj(e,t){const n={},r=nj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function sj(e,t,n,r){const s=v.useMemo(()=>{const i=eC();return tE(i,t,rE(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};aC(i,e.style,e),s.style={...i,...s.style}}return s}function ij(e=!1){return(n,r,s,{latestValues:i},a)=>{const l=(Xb(n)?sj:rj)(r,i,a,n),u=E5(r,typeof n=="string",e),d=n!==v.Fragment?{...u,...l,ref:s}:{},{children:f}=r,h=v.useMemo(()=>qn(f)?f.get():f,[f]);return v.createElement(n,{...d,children:h})}}function aj(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...Xb(r)?J5:ej,preloadedFeatures:e,useRender:ij(s),createVisualElement:t,Component:r};return C5(a)}}function oC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(ah===void 0&&Ls.set(Fn.isProcessing||p5.useManualTiming?Fn.timestamp:performance.now()),ah),set:e=>{ah=e,queueMicrotask(oj)}};function aE(e,t){e.indexOf(t)===-1&&e.push(t)}function oE(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class lE{constructor(){this.subscriptions=[]}add(t){return aE(this.subscriptions,t),()=>oE(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class cj{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ls.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ls.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new lE);const r=this.events[t].add(n);return t==="change"?()=>{r(),$t.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ls.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sv);return cC(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Iu(e,t){return new cj(e,t)}function uj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Iu(n))}function dj(e,t){const n=om(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const o=D5(i[a]);uj(e,a,o)}}function fj(e){return!!(qn(e)&&e.add)}function Py(e,t){const n=e.getValue("willChange");if(fj(n))return n.add(t)}function uC(e){return e.props[WA]}function cE(e){let t;return()=>(t===void 0&&(t=e()),t)}const hj=cE(()=>window.ScrollTimeline!==void 0);class pj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r{if(hj()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mj extends pj{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const ni=e=>e*1e3,ri=e=>e/1e3;function uE(e){return typeof e=="function"}function Av(e,t){e.timeline=t,e.onfinish=null}const dE=e=>Array.isArray(e)&&typeof e[0]=="number",gj={linearEasing:void 0};function yj(e,t){const n=cE(e);return()=>{var r;return(r=gj[t])!==null&&r!==void 0?r:n()}}const tp=yj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),hl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},dC=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ac([0,.65,.55,1]),circOut:Ac([.55,0,1,.45]),backIn:Ac([.31,.01,.66,-.59]),backOut:Ac([.33,1.53,.69,.99])};function hC(e,t){if(e)return typeof e=="function"&&tp()?dC(e,t):dE(e)?Ac(e):Array.isArray(e)?e.map(n=>hC(n,t)||jy.easeOut):jy[e]}const pC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bj=1e-7,Ej=12;function xj(e,t,n,r,s){let i,a,o=0;do a=t+(n-t)/2,i=pC(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>bj&&++oxj(i,0,1,e,n);return i=>i===0||i===1?i:pC(s(i),t,r)}const mC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,gC=e=>t=>1-e(1-t),yC=ld(.33,1.53,.69,.99),fE=gC(yC),bC=mC(fE),EC=e=>(e*=2)<1?.5*fE(e):.5*(2-Math.pow(2,-10*(e-1))),hE=e=>1-Math.sin(Math.acos(e)),xC=gC(hE),wC=mC(hE),vC=e=>/^0[^.\s]+$/u.test(e);function wj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||vC(e):!0}const Kc=e=>Math.round(e*1e5)/1e5,pE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vj(e){return e==null}const _j=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mE=(e,t)=>n=>!!(typeof n=="string"&&_j.test(n)&&n.startsWith(e)||t&&!vj(n)&&Object.prototype.hasOwnProperty.call(n,t)),_C=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,o]=r.match(pE);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},Tj=e=>ci(0,255,e),Ng={...jl,transform:e=>Math.round(Tj(e))},_a={test:mE("rgb","red"),parse:_C("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ng.transform(e)+", "+Ng.transform(t)+", "+Ng.transform(n)+", "+Kc(Cu.transform(r))+")"};function kj(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const By={test:mE("#"),parse:kj,transform:_a.transform},Po={test:mE("hsl","hue"),parse:_C("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Os.transform(Kc(t))+", "+Os.transform(Kc(n))+", "+Kc(Cu.transform(r))+")"},Yn={test:e=>_a.test(e)||By.test(e)||Po.test(e),parse:e=>_a.test(e)?_a.parse(e):Po.test(e)?Po.parse(e):By.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?_a.transform(e):Po.transform(e)},Nj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Sj(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(pE))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Nj))===null||n===void 0?void 0:n.length)||0)>0}const TC="number",kC="color",Aj="var",Cj="var(",Cv="${}",Ij=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ru(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=t.replace(Ij,l=>(Yn.test(l)?(r.color.push(i),s.push(kC),n.push(Yn.parse(l))):l.startsWith(Cj)?(r.var.push(i),s.push(Aj),n.push(l)):(r.number.push(i),s.push(TC),n.push(parseFloat(l))),++i,Cv)).split(Cv);return{values:n,split:o,indexes:r,types:s}}function NC(e){return Ru(e).values}function SC(e){const{split:t,types:n}=Ru(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function Oj(e){const t=NC(e);return SC(e)(t.map(Rj))}const Gi={test:Sj,parse:NC,createTransformer:SC,getAnimatableNone:Oj},Lj=new Set(["brightness","contrast","saturate","opacity"]);function Mj(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(pE)||[];if(!r)return e;const s=n.replace(r,"");let i=Lj.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Dj=/\b([a-z-]*)\(.*?\)/gu,Fy={...Gi,getAnimatableNone:e=>{const t=e.match(Dj);return t?t.map(Mj).join(" "):e}},Pj={...Jb,color:Yn,backgroundColor:Yn,outlineColor:Yn,fill:Yn,stroke:Yn,borderColor:Yn,borderTopColor:Yn,borderRightColor:Yn,borderBottomColor:Yn,borderLeftColor:Yn,filter:Fy,WebkitFilter:Fy},gE=e=>Pj[e];function AC(e,t){let n=gE(e);return n!==Fy&&(n=Gi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const jj=new Set(["auto","none","0"]);function Bj(e,t,n){let r=0,s;for(;re===jl||e===ze,Rv=(e,t)=>parseFloat(e.split(", ")[t]),Ov=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Rv(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Rv(i[1],e):0}},Fj=new Set(["x","y","z"]),Uj=Pl.filter(e=>!Fj.has(e));function $j(e){const t=[];return Uj.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const pl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ov(4,13),y:Ov(5,14)};pl.translateX=pl.x;pl.translateY=pl.y;const Ia=new Set;let Uy=!1,$y=!1;function CC(){if($y){const e=Array.from(Ia).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=$j(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var o;(o=r.getValue(i))===null||o===void 0||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}$y=!1,Uy=!1,Ia.forEach(e=>e.complete()),Ia.clear()}function IC(){Ia.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($y=!0)})}function Hj(){IC(),CC()}class yE{constructor(t,n,r,s,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ia.add(this),Uy||(Uy=!0,$t.read(IC),$t.resolveKeyframes(CC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),zj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vj(e){const t=zj.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function OC(e,t,n=1){const[r,s]=Vj(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return RC(a)?parseFloat(a):a}return Zb(s)?OC(s,t,n+1):s}const LC=e=>t=>t.test(e),Kj={test:e=>e==="auto",parse:e=>e},MC=[jl,ze,Os,xi,$5,U5,Kj],Lv=e=>MC.find(LC(e));class DC extends yE{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Mv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gi.test(e)||e==="0")&&!e.startsWith("url("));function Yj(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function lm(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(qj),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Gj=40;class PC{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ls.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Gj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Hj(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ls.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:o,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Wj(t,r,s,i))if(a)this.options.duration=0;else{l&&l(lm(t,this.options,n)),o&&o(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Hy=2e4;function jC(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=Hy?1/0:t}const nn=(e,t,n)=>e+(t-e)*n;function Sg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xj({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,a=0;if(!t)s=i=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=Sg(l,o,e+1/3),i=Sg(l,o,e),a=Sg(l,o,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function np(e,t){return n=>n>0?t:e}const Ag=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Qj=[By,_a,Po],Zj=e=>Qj.find(t=>t.test(e));function Dv(e){const t=Zj(e);if(!t)return!1;let n=t.parse(e);return t===Po&&(n=Xj(n)),n}const Pv=(e,t)=>{const n=Dv(e),r=Dv(t);if(!n||!r)return np(e,t);const s={...n};return i=>(s.red=Ag(n.red,r.red,i),s.green=Ag(n.green,r.green,i),s.blue=Ag(n.blue,r.blue,i),s.alpha=nn(n.alpha,r.alpha,i),_a.transform(s))},Jj=(e,t)=>n=>t(e(n)),cd=(...e)=>e.reduce(Jj),zy=new Set(["none","hidden"]);function eB(e,t){return zy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tB(e,t){return n=>nn(e,t,n)}function bE(e){return typeof e=="number"?tB:typeof e=="string"?Zb(e)?np:Yn.test(e)?Pv:sB:Array.isArray(e)?BC:typeof e=="object"?Yn.test(e)?Pv:nB:np}function BC(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>bE(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function rB(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=Gi.createTransformer(t),r=Ru(e),s=Ru(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?zy.has(e)&&!s.values.length||zy.has(t)&&!r.values.length?eB(e,t):cd(BC(rB(r,s),s.values),n):np(e,t)};function FC(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?nn(e,t,n):bE(e)(e,t)}const iB=5;function UC(e,t,n){const r=Math.max(t-iB,0);return cC(n-e(r),t-r)}const on={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Cg=.001;function aB({duration:e=on.duration,bounce:t=on.bounce,velocity:n=on.velocity,mass:r=on.mass}){let s,i,a=1-t;a=ci(on.minDamping,on.maxDamping,a),e=ci(on.minDuration,on.maxDuration,ri(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=Vy(u,a),m=Math.exp(-f);return Cg-h/p*m},i=u=>{const f=u*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(u,2)*e,m=Math.exp(-f),y=Vy(Math.pow(u,2),a);return(-s(u)+Cg>0?-1:1)*((h-p)*m)/y}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Cg+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,l=lB(s,i,o);if(e=ni(e),isNaN(l))return{stiffness:on.stiffness,damping:on.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const oB=12;function lB(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function dB(e){let t={velocity:on.velocity,stiffness:on.stiffness,damping:on.damping,mass:on.mass,isResolvedFromDuration:!1,...e};if(!jv(e,uB)&&jv(e,cB))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ci(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:on.mass,stiffness:s,damping:i}}else{const n=aB(e);t={...t,...n,mass:on.mass},t.isResolvedFromDuration=!0}return t}function $C(e=on.visualDuration,t=on.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=dB({...n,velocity:-ri(n.velocity||0)}),m=h||0,y=u/(2*Math.sqrt(l*d)),w=a-i,g=ri(Math.sqrt(l/d)),E=Math.abs(w)<5;r||(r=E?on.restSpeed.granular:on.restSpeed.default),s||(s=E?on.restDelta.granular:on.restDelta.default);let b;if(y<1){const k=Vy(g,y);b=T=>{const A=Math.exp(-y*g*T);return a-A*((m+y*g*w)/k*Math.sin(k*T)+w*Math.cos(k*T))}}else if(y===1)b=k=>a-Math.exp(-g*k)*(w+(m+g*w)*k);else{const k=g*Math.sqrt(y*y-1);b=T=>{const A=Math.exp(-y*g*T),N=Math.min(k*T,300);return a-A*((m+y*g*w)*Math.sinh(N)+k*w*Math.cosh(N))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const T=b(k);if(p)o.done=k>=f;else{let A=0;y<1&&(A=k===0?ni(m):UC(b,k,T));const N=Math.abs(A)<=r,R=Math.abs(a-T)<=s;o.done=N&&R}return o.value=o.done?a:T,o},toString:()=>{const k=Math.min(jC(_),Hy),T=dC(A=>_.next(k*A).value,k,30);return k+"ms "+T}};return _}function Bv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=N=>o!==void 0&&Nl,m=N=>o===void 0?l:l===void 0||Math.abs(o-N)-y*Math.exp(-N/r),b=N=>g+E(N),_=N=>{const R=E(N),I=b(N);h.done=Math.abs(R)<=u,h.value=h.done?g:I};let k,T;const A=N=>{p(h.value)&&(k=N,T=$C({keyframes:[h.value,m(h.value)],velocity:UC(b,N,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:N=>{let R=!1;return!T&&k===void 0&&(R=!0,_(N),A(N)),k!==void 0&&N>=k?T.next(N-k):(!R&&_(N),h)}}}const fB=ld(.42,0,1,1),hB=ld(0,0,.58,1),HC=ld(.42,0,.58,1),pB=e=>Array.isArray(e)&&typeof e[0]!="number",mB={linear:Rr,easeIn:fB,easeInOut:HC,easeOut:hB,circIn:hE,circInOut:wC,circOut:xC,backIn:fE,backInOut:bC,backOut:yC,anticipate:EC},Fv=e=>{if(dE(e)){$A(e.length===4);const[t,n,r,s]=e;return ld(t,n,r,s)}else if(typeof e=="string")return mB[e];return e};function gB(e,t,n){const r=[],s=n||FC,i=e.length-1;for(let a=0;at[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=gB(t,r,s),l=o.length,u=d=>{if(a&&d1)for(;fu(ci(e[0],e[i-1],d)):u}function bB(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=hl(0,t,r);e.push(nn(n,1,s))}}function EB(e){const t=[0];return bB(t,e.length-1),t}function xB(e,t){return e.map(n=>n*t)}function wB(e,t){return e.map(()=>t||HC).splice(0,e.length-1)}function rp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=pB(r)?r.map(Fv):Fv(r),i={done:!1,value:t[0]},a=xB(n&&n.length===t.length?n:EB(t),e),o=yB(a,t,{ease:Array.isArray(s)?s:wB(t,s)});return{calculatedDuration:e,next:l=>(i.value=o(l),i.done=l>=e,i)}}const vB=e=>{const t=({timestamp:n})=>e(n);return{start:()=>$t.update(t,!0),stop:()=>qi(t),now:()=>Fn.isProcessing?Fn.timestamp:Ls.now()}},_B={decay:Bv,inertia:Bv,tween:rp,keyframes:rp,spring:$C},TB=e=>e/100;class EE extends PC{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,a=(s==null?void 0:s.KeyframeResolver)||yE,o=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new a(i,o,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=this.options,o=uE(n)?n:_B[n]||rp;let l,u;o!==rp&&typeof t[0]!="number"&&(l=cd(TB,FC(t[0],t[1])),t=[0,100]);const d=o({...this.options,keyframes:t});i==="mirror"&&(u=o({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=jC(d));const{calculatedDuration:f}=d,h=f+s,p=h*(r+1)-s;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:N}=this.options;return{done:!0,value:N[N.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:p,repeatType:m,repeatDelay:y,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),E=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,_=i;if(p){const N=Math.min(this.currentTime,d)/f;let R=Math.floor(N),I=N%1;!I&&N>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,y&&(I-=y/f)):m==="mirror"&&(_=a)),b=ci(0,1,I)*f}const k=E?{done:!1,value:l[0]}:_.next(b);o&&(k.value=o(k.value));let{done:T}=k;!E&&u!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return A&&s!==void 0&&(k.value=lm(l,this.options,s)),w&&w(k.value),A&&this.finish(),k}get duration(){const{resolved:t}=this;return t?ri(t.calculatedDuration):0}get time(){return ri(this.currentTime)}set time(t){t=ni(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ri(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vB,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const kB=new Set(["opacity","clipPath","filter","transform"]);function NB(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:o="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const d=hC(o,s);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"})}const SB=cE(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),sp=10,AB=2e4;function CB(e){return uE(e.type)||e.type==="spring"||!fC(e.ease)}function IB(e,t){const n=new EE({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&ithis.onKeyframesResolved(a,o),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:o,name:l,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof i=="string"&&tp()&&RB(i)&&(i=zC[i]),CB(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...y}=this.options,w=IB(t,y);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=NB(o.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Av(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(lm(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:s,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ri(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ri(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ni(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Rr;const{animation:r}=n;Av(r,t)}return Rr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:a,times:o}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...p}=this.options,m=new EE({...p,keyframes:r,duration:s,type:i,ease:a,times:o,isGenerator:!0}),y=ni(this.time);u.setWithVelocity(m.sample(y-sp).value,m.sample(y).value,sp)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:a,type:o}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return SB()&&r&&kB.has(r)&&!l&&!u&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}}const OB={type:"spring",stiffness:500,damping:25,restSpeed:10},LB=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MB={type:"keyframes",duration:.8},DB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PB=(e,{keyframes:t})=>t.length>2?MB:eo.has(e)?e.startsWith("scale")?LB(t[1]):OB:DB;function jB({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:o,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const xE=(e,t,n,r={},s,i)=>a=>{const o=iE(r,e)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-ni(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:s};jB(o)||(d={...d,...PB(e,d)}),d.duration&&(d.duration=ni(d.duration)),d.repeatDelay&&(d.repeatDelay=ni(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!i&&t.get()!==void 0){const h=lm(d.keyframes,o);if(h!==void 0)return $t.update(()=>{d.onUpdate(h),d.onComplete()}),new mj([])}return!i&&Uv.supports(d)?new Uv(d):new EE(d)};function BB({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function VC(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const u=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),p=l[f];if(p===void 0||d&&BB(d,f))continue;const m={delay:n,...iE(a||{},f)};let y=!1;if(window.MotionHandoffAnimation){const g=uC(e);if(g){const E=window.MotionHandoffAnimation(g,f,$t);E!==null&&(m.startTime=E,y=!0)}}Py(e,f),h.start(xE(f,h,p,e.shouldReduceMotion&&lC.has(f)?{type:!1}:m,e,y));const w=h.animation;w&&u.push(w)}return o&&Promise.all(u).then(()=>{$t.update(()=>{o&&dj(e,o)})}),u}function Ky(e,t,n={}){var r;const s=om(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const a=s?()=>Promise.all(VC(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return FB(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function FB(e,t,n=0,r=0,s=1,i){const a=[],o=(e.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(e.variantChildren).sort(UB).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(Ky(u,t,{...i,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function UB(e,t){return e.sortNodePosition(t)}function $B(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Ky(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Ky(e,t,n);else{const s=typeof t=="function"?om(e,t,n.custom):t;r=Promise.all(VC(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const HB=Wb.length;function KC(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?KC(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>$B(e,n,r)))}function YB(e){let t=KB(e),n=$v(),r=!0;const s=l=>(u,d)=>{var f;const h=om(e,d,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...y}=h;u={...u,...y,...m}}return u};function i(l){t=l(e)}function a(l){const{props:u}=e,d=KC(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;wm&&_,R=!1;const I=Array.isArray(b)?b:[b];let M=I.reduce(s(g),{});k===!1&&(M={});const{prevResolvedValues:B={}}=E,Y={...B,...M},P=L=>{N=!0,h.has(L)&&(R=!0,h.delete(L)),E.needsAnimating[L]=!0;const O=e.getValue(L);O&&(O.liveStyle=!1)};for(const L in Y){const O=M[L],j=B[L];if(p.hasOwnProperty(L))continue;let S=!1;Dy(O)&&Dy(j)?S=!oC(O,j):S=O!==j,S?O!=null?P(L):h.add(L):O!==void 0&&h.has(L)?P(L):E.protectedKeys[L]=!0}E.prevProp=b,E.prevResolvedValues=M,E.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(N=!1),N&&(!(T&&A)||R)&&f.push(...I.map(L=>({animation:L,options:{type:g}})))}if(h.size){const w={};h.forEach(g=>{const E=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),w[g]=E??null}),f.push({animation:w})}let y=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function o(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=a(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:o,setAnimateFunction:i,getState:()=>n,reset:()=>{n=$v(),r=!0}}}function WB(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!oC(t,e):!1}function la(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $v(){return{animate:la(!0),whileInView:la(),whileHover:la(),whileTap:la(),whileDrag:la(),whileFocus:la(),exit:la()}}class ea{constructor(t){this.isMounted=!1,this.node=t}update(){}}class qB extends ea{constructor(t){super(t),t.animationState||(t.animationState=YB(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();im(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let GB=0;class XB extends ea{constructor(){super(...arguments),this.id=GB++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const QB={animation:{Feature:qB},exit:{Feature:XB}},ns={x:!1,y:!1};function YC(){return ns.x||ns.y}function ZB(e){return e==="x"||e==="y"?ns[e]?null:(ns[e]=!0,()=>{ns[e]=!1}):ns.x||ns.y?null:(ns.x=ns.y=!0,()=>{ns.x=ns.y=!1})}const wE=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Ou(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ud(e){return{point:{x:e.pageX,y:e.pageY}}}const JB=e=>t=>wE(t)&&e(t,ud(t));function Yc(e,t,n,r){return Ou(e,t,JB(n),r)}const Hv=(e,t)=>Math.abs(e-t);function e8(e,t){const n=Hv(e.x,t.x),r=Hv(e.y,t.y);return Math.sqrt(n**2+r**2)}class WC{constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Rg(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=e8(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:y}=Fn;this.history.push({...m,timestamp:y});const{onStart:w,onMove:g}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Ig(h,this.transformPagePoint),$t.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Rg(f.type==="pointercancel"?this.lastMoveEventInfo:Ig(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!wE(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=ud(t),o=Ig(a,this.transformPagePoint),{point:l}=o,{timestamp:u}=Fn;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Rg(o,this.history)),this.removeListeners=cd(Yc(this.contextWindow,"pointermove",this.handlePointerMove),Yc(this.contextWindow,"pointerup",this.handlePointerUp),Yc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qi(this.updatePoint)}}function Ig(e,t){return t?{point:t(e.point)}:e}function zv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Rg({point:e},t){return{point:e,delta:zv(e,qC(t)),offset:zv(e,t8(t)),velocity:n8(t,.1)}}function t8(e){return e[0]}function qC(e){return e[e.length-1]}function n8(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=qC(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>ni(t)));)n--;if(!r)return{x:0,y:0};const i=ri(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const GC=1e-4,r8=1-GC,s8=1+GC,XC=.01,i8=0-XC,a8=0+XC;function Mr(e){return e.max-e.min}function o8(e,t,n){return Math.abs(e-t)<=n}function Vv(e,t,n,r=.5){e.origin=r,e.originPoint=nn(t.min,t.max,e.origin),e.scale=Mr(n)/Mr(t),e.translate=nn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=r8&&e.scale<=s8||isNaN(e.scale))&&(e.scale=1),(e.translate>=i8&&e.translate<=a8||isNaN(e.translate))&&(e.translate=0)}function Wc(e,t,n,r){Vv(e.x,t.x,n.x,r?r.originX:void 0),Vv(e.y,t.y,n.y,r?r.originY:void 0)}function Kv(e,t,n){e.min=n.min+t.min,e.max=e.min+Mr(t)}function l8(e,t,n){Kv(e.x,t.x,n.x),Kv(e.y,t.y,n.y)}function Yv(e,t,n){e.min=t.min-n.min,e.max=e.min+Mr(t)}function qc(e,t,n){Yv(e.x,t.x,n.x),Yv(e.y,t.y,n.y)}function c8(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?nn(n,e,r.max):Math.min(e,n)),e}function Wv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function u8(e,{top:t,left:n,bottom:r,right:s}){return{x:Wv(e.x,n,s),y:Wv(e.y,t,r)}}function qv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=hl(t.min,t.max-r,e.min):r>s&&(n=hl(e.min,e.max-s,t.min)),ci(0,1,n)}function h8(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yy=.35;function p8(e=Yy){return e===!1?e=0:e===!0&&(e=Yy),{x:Gv(e,"left","right"),y:Gv(e,"top","bottom")}}function Gv(e,t,n){return{min:Xv(e,t),max:Xv(e,n)}}function Xv(e,t){return typeof e=="number"?e:e[t]||0}const Qv=()=>({translate:0,scale:1,origin:0,originPoint:0}),jo=()=>({x:Qv(),y:Qv()}),Zv=()=>({min:0,max:0}),un=()=>({x:Zv(),y:Zv()});function Fr(e){return[e("x"),e("y")]}function QC({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function m8({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function g8(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Og(e){return e===void 0||e===1}function Wy({scale:e,scaleX:t,scaleY:n}){return!Og(e)||!Og(t)||!Og(n)}function ha(e){return Wy(e)||ZC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ZC(e){return Jv(e.x)||Jv(e.y)}function Jv(e){return e&&e!=="0%"}function ip(e,t,n){const r=e-n,s=t*r;return n+s}function e_(e,t,n,r,s){return s!==void 0&&(e=ip(e,s,r)),ip(e,n,r)+t}function qy(e,t=0,n=1,r,s){e.min=e_(e.min,t,n,r,s),e.max=e_(e.max,t,n,r,s)}function JC(e,{x:t,y:n}){qy(e.x,t.translate,t.scale,t.originPoint),qy(e.y,n.translate,n.scale,n.originPoint)}const t_=.999999999999,n_=1.0000000000001;function y8(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let o=0;ot_&&(t.x=1),t.yt_&&(t.y=1)}function Bo(e,t){e.min=e.min+t,e.max=e.max+t}function r_(e,t,n,r,s=.5){const i=nn(e.min,e.max,s);qy(e,t,n,i,r)}function Fo(e,t){r_(e.x,t.x,t.scaleX,t.scale,t.originX),r_(e.y,t.y,t.scaleY,t.scale,t.originY)}function eI(e,t){return QC(g8(e.getBoundingClientRect(),t))}function b8(e,t,n){const r=eI(e,n),{scroll:s}=t;return s&&(Bo(r.x,s.offset.x),Bo(r.y,s.offset.y)),r}const tI=({current:e})=>e?e.ownerDocument.defaultView:null,E8=new WeakMap;class x8{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=un(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ud(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ZB(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fr(w=>{let g=this.getAxisMotionValue(w).get()||0;if(Os.test(g)){const{projection:E}=this.visualElement;if(E&&E.layout){const b=E.layout.layoutBox[w];b&&(g=Mr(b)*(parseFloat(g)/100))}}this.originPoint[w]=g}),m&&$t.postRender(()=>m(d,f)),Py(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=w8(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),l=()=>Fr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new WC(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:tI(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&$t.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!pf(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=c8(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&Do(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=u8(s.layoutBox,n):this.constraints=!1,this.elastic=p8(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Fr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=h8(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Do(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=b8(r,s.root,this.visualElement.getTransformPagePoint());let a=d8(s.layout.layoutBox,i);if(n){const o=n(m8(a));this.hasMutatedConstraints=!!o,o&&(a=QC(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Fr(d=>{if(!pf(d,n,this.currentDirection))return;let f=l&&l[d]||{};a&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Py(this.visualElement,t),r.start(xE(t,r,0,n,this.visualElement,!1))}stopAnimation(){Fr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Fr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Fr(n=>{const{drag:r}=this.getProps();if(!pf(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[n];i.set(t[n]-nn(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Do(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Fr(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();s[a]=f8({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Fr(a=>{if(!pf(a,t,null))return;const o=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];o.set(nn(l,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;E8.set(this.visualElement,this);const t=this.visualElement.current,n=Yc(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Do(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),$t.read(r);const a=Ou(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Fr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=Yy,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function pf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function w8(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class v8 extends ea{constructor(t){super(t),this.removeGroupControls=Rr,this.removeListeners=Rr,this.controls=new x8(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rr}unmount(){this.removeGroupControls(),this.removeListeners()}}const s_=e=>(t,n)=>{e&&$t.postRender(()=>e(t,n))};class _8 extends ea{constructor(){super(...arguments),this.removePointerDownListener=Rr}onPointerDown(t){this.session=new WC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tI(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:s_(t),onStart:s_(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&$t.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Yc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ze.test(e))e=parseFloat(e);else return e;const n=i_(e,t.target.x),r=i_(e,t.target.y);return`${n}% ${r}%`}},T8={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Gi.parse(e);if(s.length>5)return r;const i=Gi.createTransformer(e),a=typeof s[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;s[0+a]/=o,s[1+a]/=l;const u=nn(o,l,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class k8 extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Q5(N8),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),oh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,s||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||$t.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Gb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nI(e){const[t,n]=FA(),r=v.useContext(Vb);return c.jsx(k8,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(qA),isPresent:t,safeToRemove:n})}const N8={borderRadius:{...uc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uc,borderTopRightRadius:uc,borderBottomLeftRadius:uc,borderBottomRightRadius:uc,boxShadow:T8};function S8(e,t,n){const r=qn(e)?e:Iu(e);return r.start(xE("",r,t,n)),r.animation}function A8(e){return e instanceof SVGElement&&e.tagName!=="svg"}const C8=(e,t)=>e.depth-t.depth;class I8{constructor(){this.children=[],this.isDirty=!1}add(t){aE(this.children,t),this.isDirty=!0}remove(t){oE(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(C8),this.isDirty=!1,this.children.forEach(t)}}function R8(e,t){const n=Ls.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(qi(r),e(i-t))};return $t.read(r,!0),()=>qi(r)}const rI=["TopLeft","TopRight","BottomLeft","BottomRight"],O8=rI.length,a_=e=>typeof e=="string"?parseFloat(e):e,o_=e=>typeof e=="number"||ze.test(e);function L8(e,t,n,r,s,i){s?(e.opacity=nn(0,n.opacity!==void 0?n.opacity:1,M8(r)),e.opacityExit=nn(t.opacity!==void 0?t.opacity:1,0,D8(r))):i&&(e.opacity=nn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(hl(e,t,r))}function c_(e,t){e.min=t.min,e.max=t.max}function Br(e,t){c_(e.x,t.x),c_(e.y,t.y)}function u_(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function d_(e,t,n,r,s){return e-=t,e=ip(e,1/n,r),s!==void 0&&(e=ip(e,1/s,r)),e}function P8(e,t=0,n=1,r=.5,s,i=e,a=e){if(Os.test(t)&&(t=parseFloat(t),t=nn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=nn(i.min,i.max,r);e===i&&(o-=t),e.min=d_(e.min,t,n,o,s),e.max=d_(e.max,t,n,o,s)}function f_(e,t,[n,r,s],i,a){P8(e,t[n],t[r],t[s],t.scale,i,a)}const j8=["x","scaleX","originX"],B8=["y","scaleY","originY"];function h_(e,t,n,r){f_(e.x,t,j8,n?n.x:void 0,r?r.x:void 0),f_(e.y,t,B8,n?n.y:void 0,r?r.y:void 0)}function p_(e){return e.translate===0&&e.scale===1}function iI(e){return p_(e.x)&&p_(e.y)}function m_(e,t){return e.min===t.min&&e.max===t.max}function F8(e,t){return m_(e.x,t.x)&&m_(e.y,t.y)}function g_(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aI(e,t){return g_(e.x,t.x)&&g_(e.y,t.y)}function y_(e){return Mr(e.x)/Mr(e.y)}function b_(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class U8{constructor(){this.members=[]}add(t){aE(this.members,t),t.scheduleRender()}remove(t){if(oE(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $8(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const pa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Cc=typeof window<"u"&&window.MotionDebug!==void 0,Lg=["","X","Y","Z"],H8={visibility:"hidden"},E_=1e3;let z8=0;function Mg(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function oI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=uC(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",$t,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&oI(r)}function lI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},o=t==null?void 0:t()){this.id=z8++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cc&&(pa.totalNodes=pa.resolvedTargetDeltas=pa.recalculatedProjection=0),this.nodes.forEach(Y8),this.nodes.forEach(Q8),this.nodes.forEach(Z8),this.nodes.forEach(W8),Cc&&window.MotionDebug.record(pa)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=R8(h,250),oh.hasAnimatedSinceResize&&(oh.hasAnimatedSinceResize=!1,this.nodes.forEach(w_))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||r9,{onLayoutAnimationStart:w,onLayoutAnimationComplete:g}=d.getProps(),E=!this.targetLayout||!aI(this.targetLayout,m)||p,b=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||h&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,b);const _={...iE(y,"layout"),onPlay:w,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||w_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,qi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(J8),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&oI(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const k=_/1e3;v_(f.x,a.x,k),v_(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),t9(this.relativeTarget,this.relativeTargetOrigin,h,k),b&&F8(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=un()),Br(b,this.relativeTarget)),y&&(this.animationValues=d,L8(d,u,this.latestValues,k,E,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$t.update(()=>{oh.hasAnimatedSinceResize=!0,this.currentAnimation=S8(0,E_,{...a,onUpdate:o=>{this.mixTargetDelta(o),a.onUpdate&&a.onUpdate(o)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(E_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:d}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&cI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||un();const f=Mr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const h=Mr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+h}Br(o,l),Fo(o,d),Wc(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new U8),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&Mg("z",a,u,this.animationValues);for(let d=0;d{var o;return(o=a.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(x_),this.root.sharedNodes.clear()}}}function V8(e){e.updateLayout()}function K8(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;i==="size"?Fr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Mr(h);h.min=r[f].min,h.max=h.min+p}):cI(i,n.layoutBox,r)&&Fr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Mr(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=jo();Wc(o,r,n.layoutBox);const l=jo();a?Wc(l,e.applyTransform(s,!0),n.measuredBox):Wc(l,r,n.layoutBox);const u=!iI(o);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=un();qc(m,n.layoutBox,h.layoutBox);const y=un();qc(y,r,p.layoutBox),aI(m,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Y8(e){Cc&&pa.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function W8(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function q8(e){e.clearSnapshot()}function x_(e){e.clearMeasurements()}function G8(e){e.isLayoutDirty=!1}function X8(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function w_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Q8(e){e.resolveTargetDelta()}function Z8(e){e.calcProjection()}function J8(e){e.resetSkewAndRotation()}function e9(e){e.removeLeadSnapshot()}function v_(e,t,n){e.translate=nn(t.translate,0,n),e.scale=nn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function __(e,t,n,r){e.min=nn(t.min,n.min,r),e.max=nn(t.max,n.max,r)}function t9(e,t,n,r){__(e.x,t.x,n.x,r),__(e.y,t.y,n.y,r)}function n9(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const r9={duration:.45,ease:[.4,0,.1,1]},T_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),k_=T_("applewebkit/")&&!T_("chrome/")?Math.round:Rr;function N_(e){e.min=k_(e.min),e.max=k_(e.max)}function s9(e){N_(e.x),N_(e.y)}function cI(e,t,n){return e==="position"||e==="preserve-aspect"&&!o8(y_(t),y_(n),.2)}function i9(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const a9=lI({attachResizeListener:(e,t)=>Ou(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Dg={current:void 0},uI=lI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Dg.current){const e=new a9({});e.mount(window),e.setOptions({layoutScroll:!0}),Dg.current=e}return Dg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),o9={pan:{Feature:_8},drag:{Feature:v8,ProjectionNode:uI,MeasureLayout:nI}};function l9(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const i=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function dI(e,t){const n=l9(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function S_(e){return t=>{t.pointerType==="touch"||YC()||e(t)}}function c9(e,t,n={}){const[r,s,i]=dI(e,n),a=S_(o=>{const{target:l}=o,u=t(o);if(typeof u!="function"||!l)return;const d=S_(f=>{u(f),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,s)});return r.forEach(o=>{o.addEventListener("pointerenter",a,s)}),i}function A_(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&$t.postRender(()=>i(t,ud(t)))}class u9 extends ea{mount(){const{current:t}=this.node;t&&(this.unmount=c9(t,n=>(A_(this.node,n,"Start"),r=>A_(this.node,r,"End"))))}unmount(){}}class d9 extends ea{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=cd(Ou(this.node.current,"focus",()=>this.onFocus()),Ou(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const fI=(e,t)=>t?e===t?!0:fI(e,t.parentElement):!1,f9=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function h9(e){return f9.has(e.tagName)||e.tabIndex!==-1}const Ic=new WeakSet;function C_(e){return t=>{t.key==="Enter"&&e(t)}}function Pg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const p9=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=C_(()=>{if(Ic.has(n))return;Pg(n,"down");const s=C_(()=>{Pg(n,"up")}),i=()=>Pg(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function I_(e){return wE(e)&&!YC()}function m9(e,t,n={}){const[r,s,i]=dI(e,n),a=o=>{const l=o.currentTarget;if(!I_(o)||Ic.has(l))return;Ic.add(l);const u=t(o),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!I_(p)||!Ic.has(l))&&(Ic.delete(l),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||fI(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(o=>{!h9(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,s),o.addEventListener("focus",u=>p9(u,s),s)}),i}function R_(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&$t.postRender(()=>i(t,ud(t)))}class g9 extends ea{mount(){const{current:t}=this.node;t&&(this.unmount=m9(t,n=>(R_(this.node,n,"Start"),(r,{success:s})=>R_(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Gy=new WeakMap,jg=new WeakMap,y9=e=>{const t=Gy.get(e.target);t&&t(e)},b9=e=>{e.forEach(y9)};function E9({root:e,...t}){const n=e||document;jg.has(n)||jg.set(n,{});const r=jg.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(b9,{root:e,...t})),r[s]}function x9(e,t,n){const r=E9(t);return Gy.set(e,n),r.observe(e),()=>{Gy.delete(e),r.unobserve(e)}}const w9={some:0,all:1};class v9 extends ea{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:w9[s]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(l)};return x9(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(_9(t,n))&&this.startObserver()}unmount(){}}function _9({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const T9={inView:{Feature:v9},tap:{Feature:g9},focus:{Feature:d9},hover:{Feature:u9}},k9={layout:{ProjectionNode:uI,MeasureLayout:nI}},Xy={current:null},hI={current:!1};function N9(){if(hI.current=!0,!!Kb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xy.current=e.matches;e.addListener(t),t()}else Xy.current=!1}const S9=[...MC,Yn,Gi],A9=e=>S9.find(LC(e)),O_=new WeakMap;function C9(e,t,n){for(const r in t){const s=t[r],i=n[r];if(qn(s))e.addValue(r,s);else if(qn(i))e.addValue(r,Iu(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Iu(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const L_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class I9{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ls.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),hI.current||N9(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Xy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){O_.delete(this.current),this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=eo.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&$t.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in fl){const n=fl[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):un()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Iu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(RC(s)||vC(s))?s=parseFloat(s):!A9(s)&&Gi.test(n)&&(s=AC(t,n)),this.setBaseTarget(t,qn(s)?s.get():s)),qn(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const a=Qb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(s=a[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!qn(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new lE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class pI extends I9{constructor(){super(...arguments),this.KeyframeResolver=DC}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;qn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function R9(e){return window.getComputedStyle(e)}class O9 extends pI{constructor(){super(...arguments),this.type="html",this.renderInstance=tC}readValueFromInstance(t,n){if(eo.has(n)){const r=gE(n);return r&&r.default||0}else{const r=R9(t),s=(ZA(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return eI(t,n)}build(t,n,r){eE(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return sE(t,n,r)}}class L9 extends pI{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=un}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(eo.has(n)){const r=gE(n);return r&&r.default||0}return n=nC.has(n)?n:qb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iC(t,n,r)}build(t,n,r){tE(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){rC(t,n,r,s)}mount(t){this.isSVGTag=rE(t.tagName),super.mount(t)}}const M9=(e,t)=>Xb(e)?new L9(t):new O9(t,{allowProjection:e!==v.Fragment}),D9=aj({...QB,...T9,...o9,...k9},M9),Gt=w5(D9);function _n(){return _n=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?v.useEffect:v.useLayoutEffect;function yo(e,t,n){var r=v.useRef(t);r.current=t,v.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var P9=["container"];function j9(e){var t=e.container,n=t===void 0?document.body:t,r=cm(e,P9);return $a.createPortal(et.createElement("div",_n({},r)),n)}function B9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function F9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function U9(e){return et.createElement("svg",_n({width:"44",height:"44",viewBox:"0 0 768 768"},e),et.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function $9(){return v.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function D_(e){var t=e.touches[0],n=t.clientX,r=t.clientY;if(e.touches.length>=2){var s=e.touches[1],i=s.clientX,a=s.clientY;return[(n+i)/2,(r+a)/2,Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2))]}return[n,r,0]}var ki=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,o=e;return i<=r?(s=1,o=0):e>0&&a-e<=0?(s=2,o=a):e<0&&a+e<=0&&(s=3,o=-a),[s,o]};function Bg(e,t,n,r,s,i,a,o,l,u){a===void 0&&(a=innerWidth/2),o===void 0&&(o=innerHeight/2),l===void 0&&(l=0),u===void 0&&(u=0);var d=ki(e,i,n,innerWidth)[0],f=ki(t,i,r,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-i/s*(a-(h+e))-h+(r/n>=3&&n*i===innerWidth?0:d?l/2:l),y:o-i/s*(o-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:o}}function Jy(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function Fg(e,t,n){var r=Jy(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,o=s,l=i,u=e/t*i,d=t/e*s;return e=i?o=u:e>=s&&ts/i?l=d:t/e>=3&&!r[2]?a=((l=d)-i)/2:o=u,{width:o,height:l,x:0,y:a,pause:!0}}function gf(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,o=v.useRef(e);o.current=e;var l=v.useRef(0),u=v.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=v.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){l.current=p,d(),o.current.apply(null,h)}var y=l.current,w=p-y;if(y===0&&(r&&m(),l.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){l=requestAnimationFrame(u)}}var z9={T:0,L:0,W:0,H:0,FIT:void 0},gI=function(){var e=v.useRef(!1);return v.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},V9=["className"];function K9(e){var t=e.className,n=t===void 0?"":t,r=cm(e,V9);return et.createElement("div",_n({className:"PhotoView__Spinner "+n},r),et.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},et.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),et.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var Y9=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function W9(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,o=e.brokenElement,l=cm(e,Y9),u=gI();return t&&!r?et.createElement(et.Fragment,null,et.createElement("img",_n({className:"PhotoView__Photo"+(s?" "+s:""),src:t,onLoad:function(d){var f=d.target;u.current&&i({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&i({broken:!0})},draggable:!1,alt:""},l)),!n&&(a?et.createElement("span",{className:"PhotoView__icon"},a):et.createElement(K9,{className:"PhotoView__icon"}))):o?et.createElement("span",{className:"PhotoView__icon"},typeof o=="function"?o({src:t}):o):null}var q9={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function G9(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,o=a===void 0?0:a,l=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,y=e.loadingElement,w=e.brokenElement,g=e.onPhotoTap,E=e.onMaskTap,b=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,T=e.isActive,A=e.expose,N=ap(q9),R=N[0],I=N[1],M=v.useRef(0),B=gI(),Y=R.naturalWidth,P=Y===void 0?i:Y,U=R.naturalHeight,C=U===void 0?o:U,L=R.width,O=L===void 0?i:L,j=R.height,S=j===void 0?o:j,H=R.loaded,V=H===void 0?!n:H,D=R.broken,ne=R.x,ee=R.y,re=R.touched,de=R.stopRaf,G=R.maskTouched,W=R.rotate,oe=R.scale,he=R.CX,J=R.CY,ce=R.lastX,Ce=R.lastY,Ee=R.lastCX,ge=R.lastCY,Le=R.lastScale,ve=R.touchTime,Ue=R.touchLength,Ie=R.pause,ae=R.reach,wt=Ra({onScale:function(ue){return we(mf(ue))},onRotate:function(ue){W!==ue&&(A({rotate:ue}),I(_n({rotate:ue},Fg(P,C,ue))))}});function we(ue,Oe,Qe){oe!==ue&&(A({scale:ue}),I(_n({scale:ue},Bg(ne,ee,O,S,oe,ue,Oe,Qe),ue<=1&&{x:0,y:0})))}var vt=gf(function(ue,Oe,Qe){if(Qe===void 0&&(Qe=0),(re||G)&&T){var cn=Jy(W,O,S),an=cn[0],ie=cn[1];if(Qe===0&&M.current===0){var _e=Math.abs(ue-he)<=20,ye=Math.abs(Oe-J)<=20;if(_e&&ye)return void I({lastCX:ue,lastCY:Oe});M.current=_e?Oe>J?3:2:1}var Pe,$e=ue-Ee,qe=Oe-ge;if(Qe===0){var gt=ki($e+ce,oe,an,innerWidth)[0],It=ki(qe+Ce,oe,ie,innerHeight);Pe=function(gn,yn,zt,Nn){return yn&&gn===1||Nn==="x"?"x":zt&&gn>1||Nn==="y"?"y":void 0}(M.current,gt,It[0],ae),Pe!==void 0&&b(Pe,ue,Oe,oe)}if(Pe==="x"||G)return void I({reach:"x"});var Rt=mf(oe+(Qe-Ue)/100/2*oe,P/O,.2);A({scale:Rt}),I(_n({touchLength:Qe,reach:Pe,scale:Rt},Bg(ne,ee,O,S,oe,Rt,ue,Oe,$e,qe)))}},{maxWait:8});function ct(ue){return!de&&!re&&(B.current&&I(_n({},ue,{pause:u})),B.current)}var K,X,le,ke,Re,ut,We,ot,Zt=(Re=function(ue){return ct({x:ue})},ut=function(ue){return ct({y:ue})},We=function(ue){return B.current&&(A({scale:ue}),I({scale:ue})),!re&&B.current},ot=Ra({X:function(ue){return Re(ue)},Y:function(ue){return ut(ue)},S:function(ue){return We(ue)}}),function(ue,Oe,Qe,cn,an,ie,_e,ye,Pe,$e,qe){var gt=Jy($e,an,ie),It=gt[0],Rt=gt[1],gn=ki(ue,ye,It,innerWidth),yn=gn[0],zt=gn[1],Nn=ki(Oe,ye,Rt,innerHeight),Jn=Nn[0],_r=Nn[1],Dn=Date.now()-qe;if(Dn>=200||ye!==_e||Math.abs(Pe-_e)>1){var Hn=Bg(ue,Oe,an,ie,_e,ye),er=Hn.x,Tr=Hn.y,Vt=yn?zt:er!==ue?er:null,Sn=Jn?_r:Tr!==Oe?Tr:null;return Vt!==null&&ba(ue,Vt,ot.X),Sn!==null&&ba(Oe,Sn,ot.Y),void(ye!==_e&&ba(_e,ye,ot.S))}var Pn=(ue-Qe)/Dn,tr=(Oe-cn)/Dn,zn=Math.sqrt(Math.pow(Pn,2)+Math.pow(tr,2)),An=!1,st=!1;(function(Cn,Bt){var Jt,In=Cn,jn=0,wn=0,nr=function(Ne){Jt||(Jt=Ne);var Me=Ne-Jt,He=Math.sign(Cn),Lt=-.001*He,yt=Math.sign(-In)*Math.pow(In,2)*2e-4,Kt=In*Me+(Lt+yt)*Math.pow(Me,2)/2;jn+=Kt,Jt=Ne,He*(In+=(Lt+yt)*Me)<=0?Z():Bt(jn)?Ot():Z()};function Ot(){wn=requestAnimationFrame(nr)}function Z(){cancelAnimationFrame(wn)}Ot()})(zn,function(Cn){var Bt=ue+Cn*(Pn/zn),Jt=Oe+Cn*(tr/zn),In=ki(Bt,_e,It,innerWidth),jn=In[0],wn=In[1],nr=ki(Jt,_e,Rt,innerHeight),Ot=nr[0],Z=nr[1];if(jn&&!An&&(An=!0,yn?ba(Bt,wn,ot.X):P_(wn,Bt+(Bt-wn),ot.X)),Ot&&!st&&(st=!0,Jn?ba(Jt,Z,ot.Y):P_(Z,Jt+(Jt-Z),ot.Y)),An&&st)return!1;var Ne=An||ot.X(wn),Me=st||ot.Y(Z);return Ne&&Me})}),Ct=(K=g,X=function(ue,Oe){ae||we(oe!==1?1:Math.max(2,P/O),ue,Oe)},le=v.useRef(0),ke=gf(function(){le.current=0,K.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var ue=[].slice.call(arguments);le.current+=1,ke.apply(void 0,ue),le.current>=2&&(ke.cancel(),le.current=0,X.apply(void 0,ue))});function Ge(ue,Oe){if(M.current=0,(re||G)&&T){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Qe=mf(oe,P/O);if(Zt(ne,ee,ce,Ce,O,S,oe,Qe,Le,W,ve),_(ue,Oe),he===ue&&J===Oe){if(re)return void Ct(ue,Oe);G&&E(ue,Oe)}}}function Et(ue,Oe,Qe){Qe===void 0&&(Qe=0),I({touched:!0,CX:ue,CY:Oe,lastCX:ue,lastCY:Oe,lastX:ne,lastY:ee,lastScale:oe,touchLength:Qe,touchTime:Date.now()})}function Ht(ue){I({maskTouched:!0,CX:ue.clientX,CY:ue.clientY,lastX:ne,lastY:ee})}yo(Ks?void 0:"mousemove",function(ue){ue.preventDefault(),vt(ue.clientX,ue.clientY)}),yo(Ks?void 0:"mouseup",function(ue){Ge(ue.clientX,ue.clientY)}),yo(Ks?"touchmove":void 0,function(ue){ue.preventDefault();var Oe=D_(ue);vt.apply(void 0,Oe)},{passive:!1}),yo(Ks?"touchend":void 0,function(ue){var Oe=ue.changedTouches[0];Ge(Oe.clientX,Oe.clientY)},{passive:!1}),yo("resize",gf(function(){V&&!re&&(I(Fg(P,C,W)),k())},{maxWait:8})),Zy(function(){T&&A(_n({scale:oe,rotate:W},wt))},[T]);var kn=function(ue,Oe,Qe,cn,an,ie,_e,ye,Pe,$e){var qe=function(er,Tr,Vt,Sn,Pn){var tr=v.useRef(!1),zn=ap({lead:!0,scale:Vt}),An=zn[0],st=An.lead,Cn=An.scale,Bt=zn[1],Jt=gf(function(In){try{return Pn(!0),Bt({lead:!1,scale:In}),Promise.resolve()}catch(jn){return Promise.reject(jn)}},{wait:Sn});return Zy(function(){tr.current?(Pn(!1),Bt({lead:!0}),Jt(Vt)):tr.current=!0},[Vt]),st?[er*Cn,Tr*Cn,Vt/Cn]:[er*Vt,Tr*Vt,1]}(ie,_e,ye,Pe,$e),gt=qe[0],It=qe[1],Rt=qe[2],gn=function(er,Tr,Vt,Sn,Pn){var tr=v.useState(z9),zn=tr[0],An=tr[1],st=v.useState(0),Cn=st[0],Bt=st[1],Jt=v.useRef(),In=Ra({OK:function(){return er&&Bt(4)}});function jn(wn){Pn(!1),Bt(wn)}return v.useEffect(function(){if(Jt.current||(Jt.current=Date.now()),Vt){if(function(wn,nr){var Ot=wn&&wn.current;if(Ot&&Ot.nodeType===1){var Z=Ot.getBoundingClientRect();nr({T:Z.top,L:Z.left,W:Z.width,H:Z.height,FIT:Ot.tagName==="IMG"?getComputedStyle(Ot).objectFit:void 0})}}(Tr,An),er)return Date.now()-Jt.current<250?(Bt(1),requestAnimationFrame(function(){Bt(2),requestAnimationFrame(function(){return jn(3)})}),void setTimeout(In.OK,Sn)):void Bt(4);jn(5)}},[er,Vt]),[Cn,zn]}(ue,Oe,Qe,Pe,$e),yn=gn[0],zt=gn[1],Nn=zt.W,Jn=zt.FIT,_r=innerWidth/2,Dn=innerHeight/2,Hn=yn<3||yn>4;return[Hn?Nn?zt.L:_r:cn+(_r-ie*ye/2),Hn?Nn?zt.T:Dn:an+(Dn-_e*ye/2),gt,Hn&&Jn?gt*(zt.H/Nn):It,yn===0?Rt:Hn?Nn/(ie*ye)||.01:Rt,Hn?Jn?1:0:1,yn,Jn]}(u,l,V,ne,ee,O,S,oe,d,function(ue){return I({pause:ue})}),Fe=kn[4],rt=kn[6],tt="transform "+d+"ms "+f,mt={className:p,onMouseDown:Ks?void 0:function(ue){ue.stopPropagation(),ue.button===0&&Et(ue.clientX,ue.clientY,0)},onTouchStart:Ks?function(ue){ue.stopPropagation(),Et.apply(void 0,D_(ue))}:void 0,onWheel:function(ue){if(!ae){var Oe=mf(oe-ue.deltaY/100/2,P/O);I({stopRaf:!0}),we(Oe,ue.clientX,ue.clientY)}},style:{width:kn[2]+"px",height:kn[3]+"px",opacity:kn[5],objectFit:rt===4?void 0:kn[7],transform:W?"rotate("+W+"deg)":void 0,transition:rt>2?tt+", opacity "+d+"ms ease, height "+(rt<4?d/2:rt>4?d:0)+"ms "+f:void 0}};return et.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Ks&&T?Ht:void 0,onTouchStart:Ks&&T?function(ue){return Ht(ue.touches[0])}:void 0},et.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Fe+", 0, 0, "+Fe+", "+kn[0]+", "+kn[1]+")",transition:re||Ie?void 0:tt,willChange:T?"transform":void 0}},n?et.createElement(W9,_n({src:n,loaded:V,broken:D},mt,{onPhotoLoad:function(ue){I(_n({},ue,ue.loaded&&Fg(ue.naturalWidth||0,ue.naturalHeight||0,W)))},loadingElement:y,brokenElement:w})):r&&r({attrs:mt,scale:Fe,rotate:W})))}var j_={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function X9(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,o=a===void 0||a,l=e.maskOpacity,u=l===void 0?1:l,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,y=e.toolbarRender,w=e.className,g=e.maskClassName,E=e.photoClassName,b=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,T=e.images,A=e.index,N=A===void 0?0:A,R=e.onIndexChange,I=e.visible,M=e.onClose,B=e.afterClose,Y=e.portalContainer,P=ap(j_),U=P[0],C=P[1],L=v.useState(0),O=L[0],j=L[1],S=U.x,H=U.touched,V=U.pause,D=U.lastCX,ne=U.lastCY,ee=U.bg,re=ee===void 0?u:ee,de=U.lastBg,G=U.overlay,W=U.minimal,oe=U.scale,he=U.rotate,J=U.onScale,ce=U.onRotate,Ce=e.hasOwnProperty("index"),Ee=Ce?N:O,ge=Ce?R:j,Le=v.useRef(Ee),ve=T.length,Ue=T[Ee],Ie=typeof n=="boolean"?n:ve>n,ae=function(Fe,rt){var tt=v.useReducer(function(Qe){return!Qe},!1)[1],mt=v.useRef(0),ue=function(Qe){var cn=v.useRef(Qe);function an(ie){cn.current=ie}return v.useMemo(function(){(function(ie){Fe?(ie(Fe),mt.current=1):mt.current=2})(an)},[Qe]),[cn.current,an]}(Fe),Oe=ue[1];return[ue[0],mt.current,function(){tt(),mt.current===2&&(Oe(!1),rt&&rt()),mt.current=0}]}(I,B),wt=ae[0],we=ae[1],vt=ae[2];Zy(function(){if(wt)return C({pause:!0,x:Ee*-(innerWidth+uo)}),void(Le.current=Ee);C(j_)},[wt]);var ct=Ra({close:function(Fe){ce&&ce(0),C({overlay:!0,lastBg:re}),M(Fe)},changeIndex:function(Fe,rt){rt===void 0&&(rt=!1);var tt=Ie?Le.current+(Fe-Ee):Fe,mt=ve-1,ue=Qy(tt,0,mt),Oe=Ie?tt:ue,Qe=innerWidth+uo;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-Qe*Oe,pause:rt}),Le.current=Oe,ge&&ge(Ie?Fe<0?mt:Fe>mt?0:Fe:ue)}}),K=ct.close,X=ct.changeIndex;function le(Fe){return Fe?K():C({overlay:!G})}function ke(){C({x:-(innerWidth+uo)*Ee,lastCX:void 0,lastCY:void 0,pause:!0}),Le.current=Ee}function Re(Fe,rt,tt,mt){Fe==="x"?function(ue){if(D!==void 0){var Oe=ue-D,Qe=Oe;!Ie&&(Ee===0&&Oe>0||Ee===ve-1&&Oe<0)&&(Qe=Oe/2),C({touched:!0,lastCX:D,x:-(innerWidth+uo)*Le.current+Qe,pause:!1})}else C({touched:!0,lastCX:ue,x:S,pause:!1})}(rt):Fe==="y"&&function(ue,Oe){if(ne!==void 0){var Qe=u===null?null:Qy(u,.01,u-Math.abs(ue-ne)/100/4);C({touched:!0,lastCY:ne,bg:Oe===1?Qe:u,minimal:Oe===1})}else C({touched:!0,lastCY:ue,bg:re,minimal:!0})}(tt,mt)}function ut(Fe,rt){var tt=Fe-(D??Fe),mt=rt-(ne??rt),ue=!1;if(tt<-40)X(Ee+1);else if(tt>40)X(Ee-1);else{var Oe=-(innerWidth+uo)*Le.current;Math.abs(mt)>100&&W&&f&&(ue=!0,K()),C({touched:!1,x:Oe,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!ue||G})}}yo("keydown",function(Fe){if(I)switch(Fe.key){case"ArrowLeft":X(Ee-1,!0);break;case"ArrowRight":X(Ee+1,!0);break;case"Escape":K()}});var We=function(Fe,rt,tt){return v.useMemo(function(){var mt=Fe.length;return tt?Fe.concat(Fe).concat(Fe).slice(mt+rt-1,mt+rt+2):Fe.slice(Math.max(rt-1,0),Math.min(rt+2,mt+1))},[Fe,rt,tt])}(T,Ee,Ie);if(!wt)return null;var ot=G&&!we,Zt=I?re:de,Ct=J&&ce&&{images:T,index:Ee,visible:I,onClose:K,onIndexChange:X,overlayVisible:ot,overlay:Ue&&Ue.overlay,scale:oe,rotate:he,onScale:J,onRotate:ce},Ge=r?r(we):400,Et=s?s(we):M_,Ht=r?r(3):600,kn=s?s(3):M_;return et.createElement(j9,{className:"PhotoView-Portal"+(ot?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(Fe){return Fe.stopPropagation()},container:Y},I&&et.createElement($9,null),et.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(we===1?" PhotoView-Slider__fadeIn":we===2?" PhotoView-Slider__fadeOut":""),style:{background:Zt?"rgba(0, 0, 0, "+Zt+")":void 0,transitionTimingFunction:Et,transitionDuration:(H?0:Ge)+"ms",animationDuration:Ge+"ms"},onAnimationEnd:vt}),p&&et.createElement("div",{className:"PhotoView-Slider__BannerWrap"},et.createElement("div",{className:"PhotoView-Slider__Counter"},Ee+1," / ",ve),et.createElement("div",{className:"PhotoView-Slider__BannerRight"},y&&Ct&&y(Ct),et.createElement(B9,{className:"PhotoView-Slider__toolbarIcon",onClick:K}))),We.map(function(Fe,rt){var tt=Ie||Ee!==0?Le.current-1+rt:Ee+rt;return et.createElement(G9,{key:Ie?Fe.key+"/"+Fe.src+"/"+tt:Fe.key,item:Fe,speed:Ge,easing:Et,visible:I,onReachMove:Re,onReachUp:ut,onPhotoTap:function(){return le(i)},onMaskTap:function(){return le(o)},wrapClassName:b,className:E,style:{left:(innerWidth+uo)*tt+"px",transform:"translate3d("+S+"px, 0px, 0)",transition:H||V?void 0:"transform "+Ht+"ms "+kn},loadingElement:_,brokenElement:k,onPhotoResize:ke,isActive:Le.current===tt,expose:C})}),!Ks&&p&&et.createElement(et.Fragment,null,(Ie||Ee!==0)&&et.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return X(Ee-1,!0)}},et.createElement(F9,null)),(Ie||Ee+1-1){var g=u.slice();return g.splice(w,1,y),void o({images:g})}o(function(E){return{images:E.images.concat(y)}})},remove:function(y){o(function(w){var g=w.images.filter(function(E){return E.key!==y});return{images:g,index:Math.min(g.length-1,f)}})},show:function(y){var w=u.findIndex(function(g){return g.key===y});o({visible:!0,index:w}),r&&r(!0,w,a)}}),p=Ra({close:function(){o({visible:!1}),r&&r(!1,f,a)},changeIndex:function(y){o({index:y}),n&&n(y,a)}}),m=v.useMemo(function(){return _n({},a,h)},[a,h]);return et.createElement(mI.Provider,{value:m},t,et.createElement(X9,_n({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var yI=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,o=e.height,l=e.triggers,u=l===void 0?["onClick"]:l,d=e.children,f=v.useContext(mI),h=(t=function(){return f.nextId()},(n=v.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=v.useRef(null);v.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),v.useEffect(function(){return function(){f.remove(h)}},[]);var m=Ra({render:function(w){return s&&s(w)},show:function(w,g){f.show(h),function(E,b){if(d){var _=d.props[E];_&&_(b)}}(w,g)}}),y=v.useMemo(function(){var w={};return u.forEach(function(g){w[g]=m.show.bind(null,g)}),w},[]);return v.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:o})},[r]),d?v.Children.only(v.cloneElement(d,_n({},y,{ref:p}))):null};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -141,7 +141,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xn=Te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const lr=Te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -166,17 +166,17 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _E=Te("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const vE=Te("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TE=Te("Copy",[["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"}]]);/** + */const _E=Te("Copy",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NI=Te("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const kI=Te("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -186,7 +186,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NE=Te("Download",[["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"}]]);/** + */const TE=Te("Download",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -206,7 +206,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kI=Te("Eye",[["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"}]]);/** + */const NI=Te("Eye",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -251,7 +251,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SE=Te("FolderUp",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** + */const NE=Te("FolderUp",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -316,12 +316,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NF=Te("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** + */const kF=Te("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kF=Te("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** + */const NF=Te("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -396,7 +396,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dm=Te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const SE=Te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -416,7 +416,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const t1=Te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const e1=Te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -484,117 +484,117 @@ Error generating stack: `+i.message+` */const Xr=Te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),U_="veadk_auth_qs";let dc=null;function VF(){if(dc!==null)return dc;const e=window.location.search.replace(/^\?/,"");return e?(sessionStorage.setItem(U_,e),window.history.replaceState(null,"",window.location.pathname+window.location.hash),dc=e):dc=sessionStorage.getItem(U_)??"",dc}function Ms(e){const t=VF();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((r,s)=>{n.searchParams.has(s)||n.searchParams.set(s,r)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const KF=/\brun_sse\s*failed\s*:\s*404\b/i,$_="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function yf(e){const t=String(e);return!KF.test(t)||t.includes($_)?t:`${t} ${$_}`}async function*IE(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let r="";try{for(;;){const{done:s,value:i}=await t.read();if(s)break;r+=n.decode(i,{stream:!0});let a=r.match(/\r?\n\r?\n/);for(;(a==null?void 0:a.index)!==void 0;){const o=r.slice(0,a.index);r=r.slice(a.index+a[0].length);const l=o.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` -`);if(l)try{yield JSON.parse(l)}catch{l!=="[DONE]"&&l!=="ping"&&console.debug(`parseSSE: dropping unparseable frame (${l.length} chars):`,l.slice(0,200))}a=r.match(/\r?\n\r?\n/)}}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const dd=3e4,YF=12e4,jI=1e4;function Ds(e,t=dd){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const lp="veadk_local_user",cp="veadk_local_user_tab",WF=/^[A-Za-z0-9]{1,16}$/;function BI(){try{const e=sessionStorage.getItem(cp);if(e)return e;const t=localStorage.getItem(lp);return t&&sessionStorage.setItem(cp,t),t}catch{try{return localStorage.getItem(lp)}catch{return null}}}function H_(e){try{sessionStorage.setItem(cp,e)}catch{}try{localStorage.setItem(lp,e)}catch{}}function qF(){try{sessionStorage.removeItem(cp)}catch{}try{localStorage.removeItem(lp)}catch{}}function fm(e){const t=new Headers(e),n=BI();return n&&t.set("X-VeADK-Local-User",n),t}async function GF(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:Ds(void 0,jI)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error("无法加载登录配置,请检查网络后重试。")}if(!e.ok)throw new Error(`登录配置服务异常(HTTP ${e.status}),请稍后重试。`);try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error("登录配置服务返回了无法解析的响应,请稍后重试。")}}function XF(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function QF(){window.location.assign("/oauth2/logout")}async function ZF(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:Ds(void 0,jI)})}catch(n){throw console.warn("[identity] /oauth2/userinfo is unreachable:",n),new Error("无法连接身份服务,请检查网络后重试。")}if(e.ok){let n;try{n=await e.json()}catch(s){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",s),new Error("身份服务返回了无法解析的响应,请稍后重试。")}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(`身份服务异常(HTTP ${e.status}),请稍后重试。`);const t=BI();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function JF(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function eU(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const ch="",RE=new Map;function FI(e,t){RE.set(e,t)}function UI(){RE.clear()}function ys(e){const t=RE.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}function Nt(e,t={},n={},r=dd){const s={...t,headers:fm(t.headers),signal:Ds(t.signal,r)};if(n.runtimeId){const i=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Ms(`${ch}/web/runtime-proxy/${n.runtimeId}${e}${i}`),s)}if(n.base){const i=new Headers(s.headers);return i.set("X-AgentKit-Base",n.base),n.apiKey&&i.set("X-AgentKit-Key",n.apiKey),fetch(Ms(`${ch}/agentkit-proxy${e}`),{...s,headers:i})}return fetch(Ms(`${ch}${e}`),s)}function tU(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const r=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",s=String(t.msg??"");return r?`${r}: ${s}`:s}return String(t)}).filter(Boolean).join(` -`):e&&typeof e=="object"?JSON.stringify(e):""}async function Jr(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return tU(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function $I(){const e=await Nt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class fd extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Lu extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}async function nU(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function hm(e,t,n){const r=await Nt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await nU(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new fd;if(n!=null&&n.runtimeId&&r.status===404)throw new Lu("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new Lu("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await Jr(r,"读取 Agent 列表失败"));return r.json()}async function up(e,t){const{app:n,ep:r}=ys(e),s=await Nt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok)throw new Error(`create session failed: ${s.status}`);return(await s.json()).id}async function OE(e,t){const{app:n,ep:r}=ys(e),s=await Nt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function dp(e,t,n){const{app:r,ep:s}=ys(e),i=await Nt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{},s);if(!i.ok)throw new Error(`get session failed: ${i.status}`);return i.json()}async function n1(e,t,n){const{app:r,ep:s}=ys(e),i=await Nt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}async function rU(e){const t=await Nt("/web/media/capabilities");if(!t.ok)throw new Error(await Jr(t,"media capabilities failed"));return t.json()}async function HI(e,t,n,r){const{app:s}=ys(e),i=new FormData;i.set("app_name",s),i.set("user_id",t),i.set("session_id",n),i.set("file",r);const a=await Nt("/web/media",{method:"POST",body:i},{},YF);if(!a.ok)throw new Error(await Jr(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function r1(e,t,n){const{app:r}=ys(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await Nt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await Jr(i,"media cleanup failed"))}function zI(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((r,s)=>![1,3,5].includes(s)).join("/")}`}catch{return}}async function uh(e,t){const n=zI(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await Nt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await Jr(r,"media cleanup failed"))}function VI(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=zI(t);if(!n)return t;const r=`${n}/content`;return Ms(`${ch}${r}`)}async function KI(e,t){const{app:n,ep:r}=ys(e),s=await Nt(`/dev/apps/${encodeURIComponent(n)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(`trace failed: ${s.status}`);const i=s.headers.get("content-type")??"";if(!i.includes("application/json")){const o=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${o}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}async function YI(e,t){const n=await Nt(`/web/agent-info/${e}`,{},t);if(!n.ok)throw new Error(`agent-info failed: ${n.status}`);const r=await n.json();return{name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph}}async function hd(e){const{app:t,ep:n}=ys(e);return YI(t,n)}async function WI(e,t){const n={runtimeId:e,region:t},s=(await hm("","",n))[0];if(!s)throw new Error("该 Runtime 未提供可预览的 Agent。");return YI(s,n)}async function qI(e,t,n,r){const{app:s,ep:i}=ys(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),o=await Nt(`/web/search?${a.toString()}`,{},i);if(!o.ok)throw new Error(await Jr(o,"Agent 检索失败"));return o.json()}async function GI(e,t){const{app:n}=ys(e),r=await Nt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!r.ok)throw new Error(`web search failed: ${r.status}`);return r.json()}async function*Mu({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:o}){const{app:l,ep:u}=ys(e),d=s.flatMap(m=>m.status&&m.status!=="ready"?[]:m.uri?[{fileData:{mimeType:m.mimeType,fileUri:m.uri,displayName:m.name},partMetadata:{veadkMedia:{id:m.id,uri:m.uri,name:m.name,mimeType:m.mimeType,sizeBytes:m.sizeBytes}}}]:m.data?[{inlineData:{mimeType:m.mimeType,data:m.data,displayName:m.name}}]:[]),f=i&&(i.skills.length>0||i.targetAgent)?i:void 0,h=[...d,...a.map(m=>({functionResponse:{id:m.id,name:m.name,response:m.response}})),...r.trim()?[{text:r}]:[]];if(f&&h.length>0){const m=h[0],y=m.partMetadata;h[0]={...m,partMetadata:{...y,veadkInvocation:f}}}const p=await Nt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:l,user_id:t,session_id:n,new_message:{role:"user",parts:h},streaming:!0,custom_metadata:f?{veadkInvocation:f}:void 0}),signal:o},u,0);if(!p.ok)throw new Error(yf(`run_sse failed: ${p.status}`));for await(const m of IE(p)){const y=m;typeof y.error=="string"&&(y.error=yf(y.error)),typeof y.errorMessage=="string"&&(y.errorMessage=yf(y.errorMessage)),typeof y.error_message=="string"&&(y.error_message=yf(y.error_message)),yield y}}const Xc=new Map;async function LE(e,t,n,r){var u;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&Xc.set(s,i);const a=()=>{s&&Xc.get(s)===i&&Xc.delete(s)};let o;try{o=await Nt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:i==null?void 0:i.signal,body:JSON.stringify({name:e,files:t,config:n,taskId:s,im:r==null?void 0:r.im,envs:r==null?void 0:r.envs})},{},0)}catch(d){throw a(),d}if(!o.ok){const d=await o.text().catch(()=>"");throw a(),new Error(d||`部署失败 (${o.status})`)}let l=null;try{for await(const d of IE(o)){const f=d;if(f&&f.done){l=f;break}f&&f.message&&((u=r==null?void 0:r.onStage)==null||u.call(r,f))}}catch(d){throw a(),d}if(a(),!l)throw new Error("部署失败:连接中断");if(!l.success)throw new Error(l.error||"部署失败");if(!l.agentName)throw new Error("部署失败:返回缺少 Agent 名称");if(!l.runtimeId&&!l.url)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:l.apikey??"",url:l.url??"",agentName:l.agentName,runtimeId:l.runtimeId,consoleUrl:l.consoleUrl,region:l.region,feishuChannel:l.feishuChannel}}async function XI(e){var n;const t=await Nt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(r||`取消部署失败 (${t.status})`)}(n=Xc.get(e))==null||n.abort(),Xc.delete(e)}async function QI(e="cn-beijing"){const t=await Nt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Du={title:"VeADK Studio",logoUrl:""},$g={studio:!1,branding:Du,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function ZI(){var e,t;try{const n=await Nt("/web/ui-config");if(!n.ok)return $g;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Du.logoUrl;return{studio:r.studio??!1,branding:{title:typeof((t=r.branding)==null?void 0:t.title)=="string"?r.branding.title:Du.title,logoUrl:s?Ms(s):""},features:{...$g.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return $g}}const JI={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function eR(){var n,r,s;const e=await Nt("/web/access");if(!e.ok)throw new Error(`加载权限失败 (${e.status})`);const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.capabilities)==null?void 0:n.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.manageAgents)!="boolean"||!["all","mine"].includes((s=t.capabilities)==null?void 0:s.runtimeScope))throw new Error("权限服务返回了无法解析的响应");return t}async function dh(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await Nt(`/web/runtimes?${t.toString()}`);if(!n.ok)throw new Error(`加载 Runtime 失败 (${n.status})`);const r=await n.json();return{runtimes:r.runtimes??[],nextToken:r.nextToken??""}}async function tR(e,t="cn-beijing"){try{return await hm("","",{runtimeId:e,region:t})}catch(n){if(n instanceof fd||n instanceof Lu)throw n;return null}}async function nR(e,t="cn-beijing"){const n=await Nt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(r||`删除失败 (${n.status})`)}}async function ME(e,t="cn-beijing"){const n=await Nt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Jr(n,"加载 Runtime 详情失败"));return n.json()}async function fp(e){const t=await Nt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Jr(t,"生成项目失败"));return t.json()}async function rR(e){const t=await Nt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Jr(t,"创建调试运行失败"));return t.json()}async function sR(e,t){const n=await Nt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Jr(n,"创建调试会话失败"));return(await n.json()).id}async function*iR({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await Nt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:i},streaming:!0}),signal:s},{},0);if(!a.ok)throw new Error(await Jr(a,"调试运行失败"));for await(const o of IE(a))yield o}async function s1(e){const t=await Nt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Jr(t,"清理调试运行失败"))}const sU=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Du,DEFAULT_STUDIO_ACCESS:JI,RuntimeAccessDeniedError:fd,RuntimeProbeError:Lu,cancelAgentkitDeployment:XI,clearRemoteApps:UI,componentSearch:qI,createGeneratedAgentTestRun:rR,createGeneratedAgentTestSession:sR,createSession:up,deleteGeneratedAgentTestRun:s1,deleteMedia:uh,deleteRuntime:nR,deleteSession:n1,deleteSessionMedia:r1,deployAgentkitProject:LE,fetchRemoteApps:hm,generateAgentProject:fp,getAgentInfo:hd,getMediaCapabilities:rU,getMyRuntimes:QI,getRuntimeAgentInfo:WI,getRuntimeDetail:ME,getRuntimes:dh,getSession:dp,getSessionTrace:KI,getStudioAccess:eR,getUiConfig:ZI,listApps:$I,listSessions:OE,mediaContentUrl:VI,probeRuntimeApps:tR,registerRemoteApp:FI,runGeneratedAgentTestSSE:iR,runSSE:Mu,uploadMedia:HI,webSearch:GI},Symbol.toStringTag,{value:"Module"})),iU="send_a2ui_json_to_client",aU="validated_a2ui_json",i1="adk_request_credential";function oU(e){var r,s,i,a;const t=e,n=((r=t==null?void 0:t.exchangedAuthCredential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.exchanged_auth_credential)==null?void 0:s.oauth2)??((i=t==null?void 0:t.rawAuthCredential)==null?void 0:i.oauth2)??((a=t==null?void 0:t.raw_auth_credential)==null?void 0:a.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function Qs(){return{blocks:[],liveStart:0}}const z_=e=>e.functionCall??e.function_call,a1=e=>e.functionResponse??e.function_response;function lU(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function aR(e){const t=[];for(const[n,r]of e.entries()){const s=r.partMetadata??r.part_metadata,i=s==null?void 0:s.veadkTransport;if((i==null?void 0:i.hidden)===!0)continue;const a=s==null?void 0:s.veadkMedia;if(typeof(a==null?void 0:a.uri)=="string"){t.push({id:String(a.id??a.uri),mimeType:typeof a.mimeType=="string"?a.mimeType:void 0,uri:a.uri,name:typeof a.name=="string"?a.name:void 0,sizeBytes:typeof a.sizeBytes=="number"?a.sizeBytes:void 0});continue}const o=r.inlineData??r.inline_data;if(o&&o.data){t.push({id:`inline-${n}-${o.displayName??o.display_name??"media"}`,mimeType:o.mimeType??o.mime_type,data:lU(o.data),name:o.displayName??o.display_name});continue}const l=r.fileData??r.file_data,u=(l==null?void 0:l.fileUri)??(l==null?void 0:l.file_uri);l&&u&&t.push({id:u,mimeType:l.mimeType??l.mime_type,uri:u,name:l.displayName??l.display_name})}return t}function o1(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const cU=new Set(["llm","sequential","parallel","loop","a2a"]);function uU(e){var t;for(const n of e){const r=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!r||typeof r!="object")continue;const s=r,i=Array.isArray(s.skills)?s.skills.flatMap(l=>{if(!l||typeof l!="object")return[];const u=l;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let a;const o=s.targetAgent;if(o&&typeof o=="object"){const l=o,u=l.type;typeof l.name=="string"&&typeof u=="string"&&cU.has(u)&&Array.isArray(l.path)&&(a={name:l.name,description:typeof l.description=="string"?l.description:"",type:u,path:l.path.filter(d=>typeof d=="string")})}if(i.length>0||a)return{skills:i,targetAgent:a}}}function dU(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function V_(e,t,n){const r=e[e.length-1];r&&r.kind===t?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function bf(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function ml(e,t){var a,o;const n=e.blocks.map(l=>({...l}));let r=e.liveStart;const s=((a=t.content)==null?void 0:a.parts)??[],i=s.some(l=>z_(l)||a1(l));if(t.partial&&!i){for(const l of s){const u=o1(l);typeof u=="string"&&u&&V_(n,l.thought?"thinking":"text",u)}return{blocks:n,liveStart:r}}n.length=r;for(const l of s){const u=z_(l),d=a1(l),f=aR([l]),h=o1(l);if(typeof h=="string"&&h)V_(n,l.thought?"thinking":"text",h);else if(f.length)bf(n),dU(n,f);else if(u)if(bf(n),u.name===i1){const p=u.args??{},m=p.authConfig??p.auth_config??p,w=String(p.functionCallId??p.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:u.id??"",label:w,authUri:oU(m),authConfig:m,done:!1})}else n.push({kind:"tool",name:u.name??"",args:u.args,done:!1});else if(d){if(bf(n),d.name===i1)for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="auth"&&!m.done){m.done=!0;break}}for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="tool"&&!m.done&&m.name===d.name){m.done=!0,m.response=d.response;break}}if(d.name===iU){const p=((o=d.response)==null?void 0:o[aU])??[];if(p.length){const m=n[n.length-1];m&&m.kind==="a2ui"?m.messages.push(...p):n.push({kind:"a2ui",messages:p})}}}}return bf(n),r=n.length,{blocks:n,liveStart:r}}function fU(e){var r;const t=[];let n=Qs();for(const s of e)if(s.author==="user"){const a=((r=s.content)==null?void 0:r.parts)??[];if(a.some(f=>{var h;return((h=a1(f))==null?void 0:h.name)===i1})){for(let f=t.length-1;f>=0;f--)if(t[f].role==="assistant"){for(let h=t[f].blocks.length-1;h>=0;h--){const p=t[f].blocks[h];if(p.kind==="auth"){p.done=!0;break}}break}}const o=a.map(o1).filter(f=>!!f).join(""),l=aR(a),u=uU(a);if(!o&&!l.length&&!u){n=Qs();continue}const d=[];u&&d.push({kind:"invocation",value:u}),l.length&&d.push({kind:"attachment",files:l}),o&&d.push({kind:"text",text:o}),t.push({role:"user",blocks:d,meta:{ts:s.timestamp}}),n=Qs()}else{let a=t[t.length-1];(!a||a.role!=="assistant")&&(a={role:"assistant",blocks:[],meta:{}},t.push(a),n=Qs()),n=ml(n,s),a.blocks=n.blocks;const o=s.usageMetadata??s.usage_metadata,l=a.meta??(a.meta={});o!=null&&o.totalTokenCount&&(l.tokens=o.totalTokenCount),s.timestamp&&(l.ts=s.timestamp)}return t}function oR(e){var t,n;for(const r of e??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const s=(((n=r.content)==null?void 0:n.parts)??[]).map(i=>i.text).find(Boolean);if(s)return s}return"新会话"}async function pd(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ds(void 0,dd)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 AgentKit Skills 中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit Skills 中心");if(t.status===404)throw new Error("技能不存在或无 SKILL.md 内容");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function hU(){return(await pd("/web/skill-spaces?region=all")).items||[]}async function pU(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),pd(`/web/skill-spaces?${t.toString()}`)}async function mU(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function gU(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function yU(e,t,n,r,s){const i=[];n&&i.push(`version=${encodeURIComponent(n)}`),r&&i.push(`region=${encodeURIComponent(r)}`),s&&i.push(`project=${encodeURIComponent(s)}`);const a=i.length>0?`?${i.join("&")}`:"";return pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function bU(e,t){return{source:"skillspace",id:`ss:${e.id}/${t.skillId}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:t.skillId,version:t.version}}function EU(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}function ade(){}function K_(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&t.push(a),s=r+1,r=n.indexOf(",",s)}return t}function lR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const xU=/[$_\p{ID_Start}]/u,wU=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,vU=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,_U=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cR={};function ode(e){return e?xU.test(String.fromCodePoint(e)):!1}function lde(e,t){const r=(t||cR).jsx?vU:wU;return e?r.test(String.fromCodePoint(e)):!1}function Y_(e,t){return(cR.jsx?TU:_U).test(e)}const NU=/[ \t\n\f\r]/g;function kU(e){return typeof e=="object"?e.type==="text"?W_(e.value):!1:W_(e)}function W_(e){return e.replace(NU,"")===""}let md=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};md.prototype.normal={};md.prototype.property={};md.prototype.space=void 0;function uR(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new md(n,r,t)}function Pu(e){return e.toLowerCase()}class vr{constructor(t,n){this.attribute=n,this.property=t}}vr.prototype.attribute="";vr.prototype.booleanish=!1;vr.prototype.boolean=!1;vr.prototype.commaOrSpaceSeparated=!1;vr.prototype.commaSeparated=!1;vr.prototype.defined=!1;vr.prototype.mustUseProperty=!1;vr.prototype.number=!1;vr.prototype.overloadedBoolean=!1;vr.prototype.property="";vr.prototype.spaceSeparated=!1;vr.prototype.space=void 0;let SU=0;const Je=to(),bn=to(),l1=to(),be=to(),Dt=to(),Zo=to(),kr=to();function to(){return 2**++SU}const c1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:bn,commaOrSpaceSeparated:kr,commaSeparated:Zo,number:be,overloadedBoolean:l1,spaceSeparated:Dt},Symbol.toStringTag,{value:"Module"})),Hg=Object.keys(c1);class DE extends vr{constructor(t,n,r,s){let i=-1;if(super(t,n),q_(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&OU.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(G_,MU);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!G_.test(i)){let a=i.replace(RU,LU);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=DE}return new s(r,t)}function LU(e){return"-"+e.toLowerCase()}function MU(e){return e.charAt(1).toUpperCase()}const gd=uR([dR,AU,pR,mR,gR],"html"),ta=uR([dR,CU,pR,mR,gR],"svg");function X_(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function yR(e){return e.join(" ").trim()}var PE={},Q_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,DU=/\n/g,PU=/^\s*/,jU=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,BU=/^:\s*/,FU=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,UU=/^[;\s]*/,$U=/^\s+|\s+$/g,HU=` -`,Z_="/",J_="*",Ea="",zU="comment",VU="declaration";function KU(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var y=m.match(DU);y&&(n+=y.length);var w=m.lastIndexOf(HU);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new a(m),u(),y}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var w=y[0];return s(w),e=e.slice(w.length),y}}function u(){l(PU)}function d(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=i();if(!(Z_!=e.charAt(0)||J_!=e.charAt(1))){for(var y=2;Ea!=e.charAt(y)&&(J_!=e.charAt(y)||Z_!=e.charAt(y+1));)++y;if(y+=2,Ea===e.charAt(y-1))return o("End of comment missing");var w=e.slice(2,y-2);return r+=2,s(w),e=e.slice(y),r+=2,m({type:zU,comment:w})}}function h(){var m=i(),y=l(jU);if(y){if(f(),!l(BU))return o("property missing ':'");var w=l(FU),g=m({type:VU,property:eT(y[0].replace(Q_,Ea)),value:w?eT(w[0].replace(Q_,Ea)):Ea});return l(UU),g}}function p(){var m=[];d(m);for(var y;y=h();)y!==!1&&(m.push(y),d(m));return m}return u(),p()}function eT(e){return e?e.replace($U,Ea):Ea}var YU=KU,WU=Ah&&Ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PE,"__esModule",{value:!0});PE.default=GU;const qU=WU(YU);function GU(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,qU.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:o}=i;s?t(a,o,i):o&&(n=n||{},n[a]=o)}),n}var mm={};Object.defineProperty(mm,"__esModule",{value:!0});mm.camelCase=void 0;var XU=/^--[a-zA-Z0-9_-]+$/,QU=/-([a-z])/g,ZU=/^[^-]+$/,JU=/^-(webkit|moz|ms|o|khtml)-/,e7=/^-(ms)-/,t7=function(e){return!e||ZU.test(e)||XU.test(e)},n7=function(e,t){return t.toUpperCase()},tT=function(e,t){return"".concat(t,"-")},r7=function(e,t){return t===void 0&&(t={}),t7(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(e7,tT):e=e.replace(JU,tT),e.replace(QU,n7))};mm.camelCase=r7;var s7=Ah&&Ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i7=s7(PE),a7=mm;function u1(e,t){var n={};return!e||typeof e!="string"||(0,i7.default)(e,function(r,s){r&&s&&(n[(0,a7.camelCase)(r,t)]=s)}),n}u1.default=u1;var o7=u1;const l7=td(o7),gm=bR("end"),Fs=bR("start");function bR(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function c7(e){const t=Fs(e),n=gm(e);if(t&&n)return{start:t,end:n}}function Qc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nT(e.position):"start"in e||"end"in e?nT(e):"line"in e||"column"in e?d1(e):""}function d1(e){return rT(e&&e.line)+":"+rT(e&&e.column)}function nT(e){return d1(e&&e.start)+"-"+d1(e&&e.end)}function rT(e){return e&&typeof e=="number"?e:1}class Zn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(a=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Qc(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zn.prototype.file="";Zn.prototype.name="";Zn.prototype.reason="";Zn.prototype.message="";Zn.prototype.stack="";Zn.prototype.column=void 0;Zn.prototype.line=void 0;Zn.prototype.ancestors=void 0;Zn.prototype.cause=void 0;Zn.prototype.fatal=void 0;Zn.prototype.place=void 0;Zn.prototype.ruleId=void 0;Zn.prototype.source=void 0;const jE={}.hasOwnProperty,u7=new Map,d7=/[A-Z]/g,f7=new Set(["table","tbody","thead","tfoot","tr"]),h7=new Set(["td","th"]),ER="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function p7(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=v7(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=w7(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ta:gd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=xR(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function xR(e,t,n){if(t.type==="element")return m7(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return g7(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return b7(e,t,n);if(t.type==="mdxjsEsm")return y7(e,t);if(t.type==="root")return E7(e,t,n);if(t.type==="text")return x7(e,t)}function m7(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ta,e.schema=s),e.ancestors.push(t);const i=vR(e,t.tagName,!1),a=_7(e,t);let o=FE(e,t);return f7.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!kU(l):!0})),wR(e,a,i,t),BE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function g7(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ju(e,t.position)}function y7(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ju(e,t.position)}function b7(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ta,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:vR(e,t.name,!0),a=T7(e,t),o=FE(e,t);return wR(e,a,i,t),BE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function E7(e,t,n){const r={};return BE(r,FE(e,t)),e.create(t,e.Fragment,r,n)}function x7(e,t){return t.value}function wR(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function BE(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function w7(e,t,n){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?n:t;return o?u(i,a,o):u(i,a)}}function v7(e,t){return n;function n(r,s,i,a){const o=Array.isArray(i.children),l=Fs(r);return t(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function _7(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&jE.call(t.properties,s)){const i=N7(e,s,t.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&h7.has(t.tagName)?r=o:n[a]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function T7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ju(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else ju(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function FE(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:u7;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i0?(Or(e,e.length,0,t),e):t}const aT={}.hasOwnProperty;function TR(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function fs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const or=na(/[A-Za-z]/),Gn=na(/[\dA-Za-z]/),M7=na(/[#-'*+\--9=?A-Z^-~]/);function hp(e){return e!==null&&(e<32||e===127)}const f1=na(/\d/),D7=na(/[\dA-Fa-f]/),P7=na(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function At(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const ym=na(new RegExp("\\p{P}|\\p{S}","u")),Va=na(/\s/);function na(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $l(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function dt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return it(l)?(e.enter(n),o(l)):t(l)}function o(l){return it(l)&&i++a))return;const A=t.events.length;let k=A,R,I;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(R){I=t.events[k][1].end;break}R=!0}for(g(r),T=A;Tb;){const N=n[_];t.containerState=N[1],N[0].exit.call(t,e)}n.length=b}function E(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function $7(e,t,n){return dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gl(e){if(e===null||At(e)||Va(e))return 1;if(ym(e))return 2}function bm(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};lT(f,-l),lT(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Hr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Hr(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Hr(u,bm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Hr(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Hr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Or(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&it(T)?dt(e,E,"linePrefix",i+1)(T):E(T)}function E(T){return T===null||Be(T)?e.check(cT,y,_)(T):(e.enter("codeFlowValue"),b(T))}function b(T){return T===null||Be(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),b)}function _(T){return e.exit("codeFenced"),t(T)}function N(T,A,k){let R=0;return I;function I(U){return T.enter("lineEnding"),T.consume(U),T.exit("lineEnding"),M}function M(U){return T.enter("codeFencedFence"),it(U)?dt(T,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):B(U)}function B(U){return U===o?(T.enter("codeFencedFenceSequence"),Y(U)):k(U)}function Y(U){return U===o?(R++,T.consume(U),Y):R>=a?(T.exit("codeFencedFenceSequence"),it(U)?dt(T,P,"whitespace")(U):P(U)):k(U)}function P(U){return U===null||Be(U)?(T.exit("codeFencedFence"),A(U)):k(U)}}}function J7(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Vg={name:"codeIndented",tokenize:t$},e$={partial:!0,tokenize:n$};function t$(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),dt(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):Be(u)?e.attempt(e$,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Be(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function n$(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):dt(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):Be(a)?s(a):n(a)}}const r$={name:"codeText",previous:i$,resolve:s$,tokenize:a$};function s$(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&fc(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function IR(e,t,n,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||hp(g)?n(g):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(o),h(g)):g===null||g===60||Be(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!d&&(g===null||g===41||At(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):d999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):Be(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Be(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!it(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function OR(e,t,n,r,s,i){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===a?(e.exit(i),l(a)):h===null?n(h):Be(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),dt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Be(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Zc(e,t){let n;return r;function r(s){return Be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):it(s)?dt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const p$={name:"definition",tokenize:g$},m$={partial:!0,tokenize:y$};function g$(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return RR.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return s=fs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return At(p)?Zc(e,u)(p):u(p)}function u(p){return IR(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(m$,f,f)(p)}function f(p){return it(p)?dt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Be(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function y$(e,t,n){return r;function r(o){return At(o)?Zc(e,s)(o):n(o)}function s(o){return OR(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return it(o)?dt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Be(o)?t(o):n(o)}}const b$={name:"hardBreakEscape",tokenize:E$};function E$(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Be(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const x$={name:"headingAtx",resolve:w$,tokenize:v$};function w$(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Or(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function v$(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||At(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Be(d)?(e.exit("atxHeading"),t(d)):it(d)?dt(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||At(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const _$=["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"],dT=["pre","script","style","textarea"],T$={concrete:!0,name:"htmlFlow",resolveTo:S$,tokenize:A$},N$={partial:!0,tokenize:I$},k$={partial:!0,tokenize:C$};function S$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function A$(e,t,n){const r=this;let s,i,a,o,l;return u;function u(D){return d(D)}function d(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),f}function f(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),i=!0,y):D===63?(e.consume(D),s=3,r.interrupt?t:S):or(D)?(e.consume(D),a=String.fromCharCode(D),w):n(D)}function h(D){return D===45?(e.consume(D),s=2,p):D===91?(e.consume(D),s=5,o=0,m):or(D)?(e.consume(D),s=4,r.interrupt?t:S):n(D)}function p(D){return D===45?(e.consume(D),r.interrupt?t:S):n(D)}function m(D){const ne="CDATA[";return D===ne.charCodeAt(o++)?(e.consume(D),o===ne.length?r.interrupt?t:B:m):n(D)}function y(D){return or(D)?(e.consume(D),a=String.fromCharCode(D),w):n(D)}function w(D){if(D===null||D===47||D===62||At(D)){const ne=D===47,ee=a.toLowerCase();return!ne&&!i&&dT.includes(ee)?(s=1,r.interrupt?t(D):B(D)):_$.includes(a.toLowerCase())?(s=6,ne?(e.consume(D),g):r.interrupt?t(D):B(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):i?E(D):b(D))}return D===45||Gn(D)?(e.consume(D),a+=String.fromCharCode(D),w):n(D)}function g(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function E(D){return it(D)?(e.consume(D),E):I(D)}function b(D){return D===47?(e.consume(D),I):D===58||D===95||or(D)?(e.consume(D),_):it(D)?(e.consume(D),b):I(D)}function _(D){return D===45||D===46||D===58||D===95||Gn(D)?(e.consume(D),_):N(D)}function N(D){return D===61?(e.consume(D),T):it(D)?(e.consume(D),N):b(D)}function T(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),l=D,A):it(D)?(e.consume(D),T):k(D)}function A(D){return D===l?(e.consume(D),l=null,R):D===null||Be(D)?n(D):(e.consume(D),A)}function k(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||At(D)?N(D):(e.consume(D),k)}function R(D){return D===47||D===62||it(D)?b(D):n(D)}function I(D){return D===62?(e.consume(D),M):n(D)}function M(D){return D===null||Be(D)?B(D):it(D)?(e.consume(D),M):n(D)}function B(D){return D===45&&s===2?(e.consume(D),C):D===60&&s===1?(e.consume(D),L):D===62&&s===4?(e.consume(D),H):D===63&&s===3?(e.consume(D),S):D===93&&s===5?(e.consume(D),j):Be(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(N$,V,Y)(D)):D===null||Be(D)?(e.exit("htmlFlowData"),Y(D)):(e.consume(D),B)}function Y(D){return e.check(k$,P,V)(D)}function P(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return D===null||Be(D)?Y(D):(e.enter("htmlFlowData"),B(D))}function C(D){return D===45?(e.consume(D),S):B(D)}function L(D){return D===47?(e.consume(D),a="",O):B(D)}function O(D){if(D===62){const ne=a.toLowerCase();return dT.includes(ne)?(e.consume(D),H):B(D)}return or(D)&&a.length<8?(e.consume(D),a+=String.fromCharCode(D),O):B(D)}function j(D){return D===93?(e.consume(D),S):B(D)}function S(D){return D===62?(e.consume(D),H):D===45&&s===2?(e.consume(D),S):B(D)}function H(D){return D===null||Be(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),H)}function V(D){return e.exit("htmlFlow"),t(D)}}function C$(e,t,n){const r=this;return s;function s(a){return Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function I$(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(yd,t,n)}}const R$={name:"htmlText",tokenize:O$};function O$(e,t,n){const r=this;let s,i,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),u):S===47?(e.consume(S),N):S===63?(e.consume(S),b):or(S)?(e.consume(S),k):n(S)}function u(S){return S===45?(e.consume(S),d):S===91?(e.consume(S),i=0,m):or(S)?(e.consume(S),E):n(S)}function d(S){return S===45?(e.consume(S),p):n(S)}function f(S){return S===null?n(S):S===45?(e.consume(S),h):Be(S)?(a=f,L(S)):(e.consume(S),f)}function h(S){return S===45?(e.consume(S),p):f(S)}function p(S){return S===62?C(S):S===45?h(S):f(S)}function m(S){const H="CDATA[";return S===H.charCodeAt(i++)?(e.consume(S),i===H.length?y:m):n(S)}function y(S){return S===null?n(S):S===93?(e.consume(S),w):Be(S)?(a=y,L(S)):(e.consume(S),y)}function w(S){return S===93?(e.consume(S),g):y(S)}function g(S){return S===62?C(S):S===93?(e.consume(S),g):y(S)}function E(S){return S===null||S===62?C(S):Be(S)?(a=E,L(S)):(e.consume(S),E)}function b(S){return S===null?n(S):S===63?(e.consume(S),_):Be(S)?(a=b,L(S)):(e.consume(S),b)}function _(S){return S===62?C(S):b(S)}function N(S){return or(S)?(e.consume(S),T):n(S)}function T(S){return S===45||Gn(S)?(e.consume(S),T):A(S)}function A(S){return Be(S)?(a=A,L(S)):it(S)?(e.consume(S),A):C(S)}function k(S){return S===45||Gn(S)?(e.consume(S),k):S===47||S===62||At(S)?R(S):n(S)}function R(S){return S===47?(e.consume(S),C):S===58||S===95||or(S)?(e.consume(S),I):Be(S)?(a=R,L(S)):it(S)?(e.consume(S),R):C(S)}function I(S){return S===45||S===46||S===58||S===95||Gn(S)?(e.consume(S),I):M(S)}function M(S){return S===61?(e.consume(S),B):Be(S)?(a=M,L(S)):it(S)?(e.consume(S),M):R(S)}function B(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),s=S,Y):Be(S)?(a=B,L(S)):it(S)?(e.consume(S),B):(e.consume(S),P)}function Y(S){return S===s?(e.consume(S),s=void 0,U):S===null?n(S):Be(S)?(a=Y,L(S)):(e.consume(S),Y)}function P(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||At(S)?R(S):(e.consume(S),P)}function U(S){return S===47||S===62||At(S)?R(S):n(S)}function C(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function L(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),O}function O(S){return it(S)?dt(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):j(S)}function j(S){return e.enter("htmlTextData"),a(S)}}const HE={name:"labelEnd",resolveAll:P$,resolveTo:j$,tokenize:B$},L$={tokenize:F$},M$={tokenize:U$},D$={tokenize:$$};function P$(e){let t=-1;const n=[];for(;++t=3&&(u===null||Be(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),it(u)?dt(e,o,"whitespace")(u):o(u))}}const pr={continuation:{tokenize:Q$},exit:J$,name:"list",tokenize:X$},q$={partial:!0,tokenize:eH},G$={partial:!0,tokenize:Z$};function X$(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:f1(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(fh,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return f1(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yd,r.interrupt?n:d,e.attempt(q$,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return it(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Q$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yd,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,dt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!it(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(G$,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,dt(e,e.attempt(pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Z$(e,t,n){const r=this;return dt(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function J$(e){e.exit(this.containerState.type)}function eH(e,t,n){const r=this;return dt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!it(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const fT={name:"setextUnderline",resolveTo:tH,tokenize:nH};function tH(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function nH(e,t,n){const r=this;let s;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),it(u)?dt(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Be(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const rH={tokenize:sH};function sH(e){const t=this,n=e.attempt(yd,r,e.attempt(this.parser.constructs.flowInitial,s,dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(c$,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const iH={resolveAll:MR()},aH=LR("string"),oH=LR("text");function LR(e){return{resolveAll:MR(e==="text"?lH:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,o);return a;function a(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=s[d];let h=-1;if(f)for(;++h-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function wH(e,t){let n=-1;const r=[];let s;for(;++n{var n;if(t&&typeof t=="object"&&"msg"in t){const r=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",s=String(t.msg??"");return r?`${r}: ${s}`:s}return String(t)}).filter(Boolean).join(` +`):e&&typeof e=="object"?JSON.stringify(e):""}async function Jr(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return tU(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function $I(){const e=await kt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class fd extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Lu extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}async function nU(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function fm(e,t,n){const r=await kt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await nU(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new fd;if(n!=null&&n.runtimeId&&r.status===404)throw new Lu("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new Lu("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await Jr(r,"读取 Agent 列表失败"));return r.json()}async function up(e,t){const{app:n,ep:r}=ys(e),s=await kt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok)throw new Error(`create session failed: ${s.status}`);return(await s.json()).id}async function OE(e,t){const{app:n,ep:r}=ys(e),s=await kt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function dp(e,t,n){const{app:r,ep:s}=ys(e),i=await kt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{},s);if(!i.ok)throw new Error(`get session failed: ${i.status}`);return i.json()}async function t1(e,t,n){const{app:r,ep:s}=ys(e),i=await kt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}async function rU(e){const t=await kt("/web/media/capabilities");if(!t.ok)throw new Error(await Jr(t,"media capabilities failed"));return t.json()}async function HI(e,t,n,r){const{app:s}=ys(e),i=new FormData;i.set("app_name",s),i.set("user_id",t),i.set("session_id",n),i.set("file",r);const a=await kt("/web/media",{method:"POST",body:i},{},YF);if(!a.ok)throw new Error(await Jr(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function n1(e,t,n){const{app:r}=ys(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await kt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await Jr(i,"media cleanup failed"))}function zI(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((r,s)=>![1,3,5].includes(s)).join("/")}`}catch{return}}async function uh(e,t){const n=zI(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await kt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await Jr(r,"media cleanup failed"))}function VI(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=zI(t);if(!n)return t;const r=`${n}/content`;return Ms(`${ch}${r}`)}async function KI(e,t){const{app:n,ep:r}=ys(e),s=await kt(`/dev/apps/${encodeURIComponent(n)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(`trace failed: ${s.status}`);const i=s.headers.get("content-type")??"";if(!i.includes("application/json")){const o=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${o}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}async function YI(e,t){const n=await kt(`/web/agent-info/${e}`,{},t);if(!n.ok)throw new Error(`agent-info failed: ${n.status}`);const r=await n.json();return{name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph}}async function hd(e){const{app:t,ep:n}=ys(e);return YI(t,n)}async function WI(e,t){const n={runtimeId:e,region:t},s=(await fm("","",n))[0];if(!s)throw new Error("该 Runtime 未提供可预览的 Agent。");return YI(s,n)}async function qI(e,t,n,r){const{app:s,ep:i}=ys(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),o=await kt(`/web/search?${a.toString()}`,{},i);if(!o.ok)throw new Error(await Jr(o,"Agent 检索失败"));return o.json()}async function GI(e,t){const{app:n}=ys(e),r=await kt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!r.ok)throw new Error(`web search failed: ${r.status}`);return r.json()}async function*Mu({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:o}){const{app:l,ep:u}=ys(e),d=s.flatMap(m=>m.status&&m.status!=="ready"?[]:m.uri?[{fileData:{mimeType:m.mimeType,fileUri:m.uri,displayName:m.name},partMetadata:{veadkMedia:{id:m.id,uri:m.uri,name:m.name,mimeType:m.mimeType,sizeBytes:m.sizeBytes}}}]:m.data?[{inlineData:{mimeType:m.mimeType,data:m.data,displayName:m.name}}]:[]),f=i&&(i.skills.length>0||i.targetAgent)?i:void 0,h=[...d,...a.map(m=>({functionResponse:{id:m.id,name:m.name,response:m.response}})),...r.trim()?[{text:r}]:[]];if(f&&h.length>0){const m=h[0],y=m.partMetadata;h[0]={...m,partMetadata:{...y,veadkInvocation:f}}}const p=await kt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:l,user_id:t,session_id:n,new_message:{role:"user",parts:h},streaming:!0,custom_metadata:f?{veadkInvocation:f}:void 0}),signal:o},u,0);if(!p.ok)throw new Error(yf(`run_sse failed: ${p.status}`));for await(const m of IE(p)){const y=m;typeof y.error=="string"&&(y.error=yf(y.error)),typeof y.errorMessage=="string"&&(y.errorMessage=yf(y.errorMessage)),typeof y.error_message=="string"&&(y.error_message=yf(y.error_message)),yield y}}const Xc=new Map;async function LE(e,t,n,r){var u;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&Xc.set(s,i);const a=()=>{s&&Xc.get(s)===i&&Xc.delete(s)};let o;try{o=await kt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:i==null?void 0:i.signal,body:JSON.stringify({name:e,files:t,config:n,taskId:s,im:r==null?void 0:r.im,envs:r==null?void 0:r.envs})},{},0)}catch(d){throw a(),d}if(!o.ok){const d=await o.text().catch(()=>"");throw a(),new Error(d||`部署失败 (${o.status})`)}let l=null;try{for await(const d of IE(o)){const f=d;if(f&&f.done){l=f;break}f&&f.message&&((u=r==null?void 0:r.onStage)==null||u.call(r,f))}}catch(d){throw a(),d}if(a(),!l)throw new Error("部署失败:连接中断");if(!l.success)throw new Error(l.error||"部署失败");if(!l.agentName)throw new Error("部署失败:返回缺少 Agent 名称");if(!l.runtimeId&&!l.url)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:l.apikey??"",url:l.url??"",agentName:l.agentName,runtimeId:l.runtimeId,consoleUrl:l.consoleUrl,region:l.region,feishuChannel:l.feishuChannel}}async function XI(e){var n;const t=await kt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(r||`取消部署失败 (${t.status})`)}(n=Xc.get(e))==null||n.abort(),Xc.delete(e)}async function QI(e="cn-beijing"){const t=await kt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Du={title:"VeADK Studio",logoUrl:""},Ug={studio:!1,branding:Du,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function ZI(){var e,t;try{const n=await kt("/web/ui-config");if(!n.ok)return Ug;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Du.logoUrl;return{studio:r.studio??!1,branding:{title:typeof((t=r.branding)==null?void 0:t.title)=="string"?r.branding.title:Du.title,logoUrl:s?Ms(s):""},features:{...Ug.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return Ug}}const JI={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function eR(){var n,r,s;const e=await kt("/web/access");if(!e.ok)throw new Error(`加载权限失败 (${e.status})`);const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.capabilities)==null?void 0:n.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.manageAgents)!="boolean"||!["all","mine"].includes((s=t.capabilities)==null?void 0:s.runtimeScope))throw new Error("权限服务返回了无法解析的响应");return t}async function dh(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await kt(`/web/runtimes?${t.toString()}`);if(!n.ok)throw new Error(`加载 Runtime 失败 (${n.status})`);const r=await n.json();return{runtimes:r.runtimes??[],nextToken:r.nextToken??""}}async function tR(e,t="cn-beijing"){try{return await fm("","",{runtimeId:e,region:t})}catch(n){if(n instanceof fd||n instanceof Lu)throw n;return null}}async function nR(e,t="cn-beijing"){const n=await kt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(r||`删除失败 (${n.status})`)}}async function ME(e,t="cn-beijing"){const n=await kt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Jr(n,"加载 Runtime 详情失败"));return n.json()}async function fp(e){const t=await kt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Jr(t,"生成项目失败"));return t.json()}async function rR(e){const t=await kt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Jr(t,"创建调试运行失败"));return t.json()}async function sR(e,t){const n=await kt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Jr(n,"创建调试会话失败"));return(await n.json()).id}async function*iR({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await kt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:i},streaming:!0}),signal:s},{},0);if(!a.ok)throw new Error(await Jr(a,"调试运行失败"));for await(const o of IE(a))yield o}async function r1(e){const t=await kt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Jr(t,"清理调试运行失败"))}const sU=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Du,DEFAULT_STUDIO_ACCESS:JI,RuntimeAccessDeniedError:fd,RuntimeProbeError:Lu,cancelAgentkitDeployment:XI,clearRemoteApps:UI,componentSearch:qI,createGeneratedAgentTestRun:rR,createGeneratedAgentTestSession:sR,createSession:up,deleteGeneratedAgentTestRun:r1,deleteMedia:uh,deleteRuntime:nR,deleteSession:t1,deleteSessionMedia:n1,deployAgentkitProject:LE,fetchRemoteApps:fm,generateAgentProject:fp,getAgentInfo:hd,getMediaCapabilities:rU,getMyRuntimes:QI,getRuntimeAgentInfo:WI,getRuntimeDetail:ME,getRuntimes:dh,getSession:dp,getSessionTrace:KI,getStudioAccess:eR,getUiConfig:ZI,listApps:$I,listSessions:OE,mediaContentUrl:VI,probeRuntimeApps:tR,registerRemoteApp:FI,runGeneratedAgentTestSSE:iR,runSSE:Mu,uploadMedia:HI,webSearch:GI},Symbol.toStringTag,{value:"Module"})),iU="send_a2ui_json_to_client",aU="validated_a2ui_json",s1="adk_request_credential";function oU(e){var r,s,i,a;const t=e,n=((r=t==null?void 0:t.exchangedAuthCredential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.exchanged_auth_credential)==null?void 0:s.oauth2)??((i=t==null?void 0:t.rawAuthCredential)==null?void 0:i.oauth2)??((a=t==null?void 0:t.raw_auth_credential)==null?void 0:a.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function Qs(){return{blocks:[],liveStart:0}}const z_=e=>e.functionCall??e.function_call,i1=e=>e.functionResponse??e.function_response;function lU(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function aR(e){const t=[];for(const[n,r]of e.entries()){const s=r.partMetadata??r.part_metadata,i=s==null?void 0:s.veadkTransport;if((i==null?void 0:i.hidden)===!0)continue;const a=s==null?void 0:s.veadkMedia;if(typeof(a==null?void 0:a.uri)=="string"){t.push({id:String(a.id??a.uri),mimeType:typeof a.mimeType=="string"?a.mimeType:void 0,uri:a.uri,name:typeof a.name=="string"?a.name:void 0,sizeBytes:typeof a.sizeBytes=="number"?a.sizeBytes:void 0});continue}const o=r.inlineData??r.inline_data;if(o&&o.data){t.push({id:`inline-${n}-${o.displayName??o.display_name??"media"}`,mimeType:o.mimeType??o.mime_type,data:lU(o.data),name:o.displayName??o.display_name});continue}const l=r.fileData??r.file_data,u=(l==null?void 0:l.fileUri)??(l==null?void 0:l.file_uri);l&&u&&t.push({id:u,mimeType:l.mimeType??l.mime_type,uri:u,name:l.displayName??l.display_name})}return t}function a1(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const cU=new Set(["llm","sequential","parallel","loop","a2a"]);function uU(e){var t;for(const n of e){const r=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!r||typeof r!="object")continue;const s=r,i=Array.isArray(s.skills)?s.skills.flatMap(l=>{if(!l||typeof l!="object")return[];const u=l;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let a;const o=s.targetAgent;if(o&&typeof o=="object"){const l=o,u=l.type;typeof l.name=="string"&&typeof u=="string"&&cU.has(u)&&Array.isArray(l.path)&&(a={name:l.name,description:typeof l.description=="string"?l.description:"",type:u,path:l.path.filter(d=>typeof d=="string")})}if(i.length>0||a)return{skills:i,targetAgent:a}}}function dU(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function V_(e,t,n){const r=e[e.length-1];r&&r.kind===t?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function bf(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function ml(e,t){var a,o;const n=e.blocks.map(l=>({...l}));let r=e.liveStart;const s=((a=t.content)==null?void 0:a.parts)??[],i=s.some(l=>z_(l)||i1(l));if(t.partial&&!i){for(const l of s){const u=a1(l);typeof u=="string"&&u&&V_(n,l.thought?"thinking":"text",u)}return{blocks:n,liveStart:r}}n.length=r;for(const l of s){const u=z_(l),d=i1(l),f=aR([l]),h=a1(l);if(typeof h=="string"&&h)V_(n,l.thought?"thinking":"text",h);else if(f.length)bf(n),dU(n,f);else if(u)if(bf(n),u.name===s1){const p=u.args??{},m=p.authConfig??p.auth_config??p,w=String(p.functionCallId??p.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:u.id??"",label:w,authUri:oU(m),authConfig:m,done:!1})}else n.push({kind:"tool",name:u.name??"",args:u.args,done:!1});else if(d){if(bf(n),d.name===s1)for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="auth"&&!m.done){m.done=!0;break}}for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="tool"&&!m.done&&m.name===d.name){m.done=!0,m.response=d.response;break}}if(d.name===iU){const p=((o=d.response)==null?void 0:o[aU])??[];if(p.length){const m=n[n.length-1];m&&m.kind==="a2ui"?m.messages.push(...p):n.push({kind:"a2ui",messages:p})}}}}return bf(n),r=n.length,{blocks:n,liveStart:r}}function fU(e){var r;const t=[];let n=Qs();for(const s of e)if(s.author==="user"){const a=((r=s.content)==null?void 0:r.parts)??[];if(a.some(f=>{var h;return((h=i1(f))==null?void 0:h.name)===s1})){for(let f=t.length-1;f>=0;f--)if(t[f].role==="assistant"){for(let h=t[f].blocks.length-1;h>=0;h--){const p=t[f].blocks[h];if(p.kind==="auth"){p.done=!0;break}}break}}const o=a.map(a1).filter(f=>!!f).join(""),l=aR(a),u=uU(a);if(!o&&!l.length&&!u){n=Qs();continue}const d=[];u&&d.push({kind:"invocation",value:u}),l.length&&d.push({kind:"attachment",files:l}),o&&d.push({kind:"text",text:o}),t.push({role:"user",blocks:d,meta:{ts:s.timestamp}}),n=Qs()}else{let a=t[t.length-1];(!a||a.role!=="assistant")&&(a={role:"assistant",blocks:[],meta:{}},t.push(a),n=Qs()),n=ml(n,s),a.blocks=n.blocks;const o=s.usageMetadata??s.usage_metadata,l=a.meta??(a.meta={});o!=null&&o.totalTokenCount&&(l.tokens=o.totalTokenCount),s.timestamp&&(l.ts=s.timestamp)}return t}function oR(e){var t,n;for(const r of e??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const s=(((n=r.content)==null?void 0:n.parts)??[]).map(i=>i.text).find(Boolean);if(s)return s}return"新会话"}async function pd(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ds(void 0,dd)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 AgentKit Skills 中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit Skills 中心");if(t.status===404)throw new Error("技能不存在或无 SKILL.md 内容");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function hU(){return(await pd("/web/skill-spaces?region=all")).items||[]}async function pU(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),pd(`/web/skill-spaces?${t.toString()}`)}async function mU(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function gU(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function yU(e,t,n,r,s){const i=[];n&&i.push(`version=${encodeURIComponent(n)}`),r&&i.push(`region=${encodeURIComponent(r)}`),s&&i.push(`project=${encodeURIComponent(s)}`);const a=i.length>0?`?${i.join("&")}`:"";return pd(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function bU(e,t){return{source:"skillspace",id:`ss:${e.id}/${t.skillId}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:t.skillId,version:t.version}}function EU(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}function lde(){}function K_(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&t.push(a),s=r+1,r=n.indexOf(",",s)}return t}function lR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const xU=/[$_\p{ID_Start}]/u,wU=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,vU=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,_U=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cR={};function cde(e){return e?xU.test(String.fromCodePoint(e)):!1}function ude(e,t){const r=(t||cR).jsx?vU:wU;return e?r.test(String.fromCodePoint(e)):!1}function Y_(e,t){return(cR.jsx?TU:_U).test(e)}const kU=/[ \t\n\f\r]/g;function NU(e){return typeof e=="object"?e.type==="text"?W_(e.value):!1:W_(e)}function W_(e){return e.replace(kU,"")===""}let md=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};md.prototype.normal={};md.prototype.property={};md.prototype.space=void 0;function uR(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new md(n,r,t)}function Pu(e){return e.toLowerCase()}class vr{constructor(t,n){this.attribute=n,this.property=t}}vr.prototype.attribute="";vr.prototype.booleanish=!1;vr.prototype.boolean=!1;vr.prototype.commaOrSpaceSeparated=!1;vr.prototype.commaSeparated=!1;vr.prototype.defined=!1;vr.prototype.mustUseProperty=!1;vr.prototype.number=!1;vr.prototype.overloadedBoolean=!1;vr.prototype.property="";vr.prototype.spaceSeparated=!1;vr.prototype.space=void 0;let SU=0;const Je=to(),bn=to(),o1=to(),be=to(),Dt=to(),Zo=to(),Nr=to();function to(){return 2**++SU}const l1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:bn,commaOrSpaceSeparated:Nr,commaSeparated:Zo,number:be,overloadedBoolean:o1,spaceSeparated:Dt},Symbol.toStringTag,{value:"Module"})),$g=Object.keys(l1);class DE extends vr{constructor(t,n,r,s){let i=-1;if(super(t,n),q_(this,"space",s),typeof r=="number")for(;++i<$g.length;){const a=$g[i];q_(this,$g[i],(r&l1[a])===l1[a])}}}DE.prototype.defined=!0;function q_(e,t,n){n&&(e[t]=n)}function Ul(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new DE(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Pu(r)]=r,n[Pu(i.attribute)]=r}return new md(t,n,e.space)}const dR=Ul({properties:{ariaActiveDescendant:null,ariaAtomic:bn,ariaAutoComplete:null,ariaBusy:bn,ariaChecked:bn,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:Dt,ariaCurrent:null,ariaDescribedBy:Dt,ariaDetails:null,ariaDisabled:bn,ariaDropEffect:Dt,ariaErrorMessage:null,ariaExpanded:bn,ariaFlowTo:Dt,ariaGrabbed:bn,ariaHasPopup:null,ariaHidden:bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Dt,ariaLevel:be,ariaLive:null,ariaModal:bn,ariaMultiLine:bn,ariaMultiSelectable:bn,ariaOrientation:null,ariaOwns:Dt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:bn,ariaReadOnly:bn,ariaRelevant:null,ariaRequired:bn,ariaRoleDescription:Dt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:bn,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function fR(e,t){return t in e?e[t]:t}function hR(e,t){return fR(e,t.toLowerCase())}const AU=Ul({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zo,acceptCharset:Dt,accessKey:Dt,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:Dt,autoFocus:Je,autoPlay:Je,blocking:Dt,capture:null,charSet:null,checked:Je,cite:null,className:Dt,cols:be,colSpan:null,content:null,contentEditable:bn,controls:Je,controlsList:Dt,coords:be|Zo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:o1,draggable:bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:Dt,height:be,hidden:o1,high:be,href:null,hrefLang:null,htmlFor:Dt,httpEquiv:Dt,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:Dt,itemRef:Dt,itemScope:Je,itemType:Dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Je,optimum:be,pattern:null,ping:Dt,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:Dt,required:Je,reversed:Je,rows:be,rowSpan:be,sandbox:Dt,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:bn,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Dt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:bn,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Je,disableRemotePlayback:Je,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:hR}),CU=Ul({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Nr,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:Dt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zo,g2:Zo,glyphName:Zo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Nr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Nr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Nr,rev:Nr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Nr,requiredFeatures:Nr,requiredFonts:Nr,requiredFormats:Nr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Nr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Nr,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Nr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fR}),pR=Ul({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),mR=Ul({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hR}),gR=Ul({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),IU={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},RU=/[A-Z]/g,G_=/-[a-z]/g,OU=/^data[-\w.:]+$/i;function hm(e,t){const n=Pu(t);let r=t,s=vr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&OU.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(G_,MU);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!G_.test(i)){let a=i.replace(RU,LU);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=DE}return new s(r,t)}function LU(e){return"-"+e.toLowerCase()}function MU(e){return e.charAt(1).toUpperCase()}const gd=uR([dR,AU,pR,mR,gR],"html"),ta=uR([dR,CU,pR,mR,gR],"svg");function X_(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function yR(e){return e.join(" ").trim()}var PE={},Q_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,DU=/\n/g,PU=/^\s*/,jU=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,BU=/^:\s*/,FU=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,UU=/^[;\s]*/,$U=/^\s+|\s+$/g,HU=` +`,Z_="/",J_="*",Ea="",zU="comment",VU="declaration";function KU(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var y=m.match(DU);y&&(n+=y.length);var w=m.lastIndexOf(HU);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new a(m),u(),y}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var w=y[0];return s(w),e=e.slice(w.length),y}}function u(){l(PU)}function d(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=i();if(!(Z_!=e.charAt(0)||J_!=e.charAt(1))){for(var y=2;Ea!=e.charAt(y)&&(J_!=e.charAt(y)||Z_!=e.charAt(y+1));)++y;if(y+=2,Ea===e.charAt(y-1))return o("End of comment missing");var w=e.slice(2,y-2);return r+=2,s(w),e=e.slice(y),r+=2,m({type:zU,comment:w})}}function h(){var m=i(),y=l(jU);if(y){if(f(),!l(BU))return o("property missing ':'");var w=l(FU),g=m({type:VU,property:eT(y[0].replace(Q_,Ea)),value:w?eT(w[0].replace(Q_,Ea)):Ea});return l(UU),g}}function p(){var m=[];d(m);for(var y;y=h();)y!==!1&&(m.push(y),d(m));return m}return u(),p()}function eT(e){return e?e.replace($U,Ea):Ea}var YU=KU,WU=Ah&&Ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PE,"__esModule",{value:!0});PE.default=GU;const qU=WU(YU);function GU(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,qU.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:o}=i;s?t(a,o,i):o&&(n=n||{},n[a]=o)}),n}var pm={};Object.defineProperty(pm,"__esModule",{value:!0});pm.camelCase=void 0;var XU=/^--[a-zA-Z0-9_-]+$/,QU=/-([a-z])/g,ZU=/^[^-]+$/,JU=/^-(webkit|moz|ms|o|khtml)-/,e7=/^-(ms)-/,t7=function(e){return!e||ZU.test(e)||XU.test(e)},n7=function(e,t){return t.toUpperCase()},tT=function(e,t){return"".concat(t,"-")},r7=function(e,t){return t===void 0&&(t={}),t7(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(e7,tT):e=e.replace(JU,tT),e.replace(QU,n7))};pm.camelCase=r7;var s7=Ah&&Ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i7=s7(PE),a7=pm;function c1(e,t){var n={};return!e||typeof e!="string"||(0,i7.default)(e,function(r,s){r&&s&&(n[(0,a7.camelCase)(r,t)]=s)}),n}c1.default=c1;var o7=c1;const l7=td(o7),mm=bR("end"),Fs=bR("start");function bR(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function c7(e){const t=Fs(e),n=mm(e);if(t&&n)return{start:t,end:n}}function Qc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nT(e.position):"start"in e||"end"in e?nT(e):"line"in e||"column"in e?u1(e):""}function u1(e){return rT(e&&e.line)+":"+rT(e&&e.column)}function nT(e){return u1(e&&e.start)+"-"+u1(e&&e.end)}function rT(e){return e&&typeof e=="number"?e:1}class Qn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(a=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Qc(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qn.prototype.file="";Qn.prototype.name="";Qn.prototype.reason="";Qn.prototype.message="";Qn.prototype.stack="";Qn.prototype.column=void 0;Qn.prototype.line=void 0;Qn.prototype.ancestors=void 0;Qn.prototype.cause=void 0;Qn.prototype.fatal=void 0;Qn.prototype.place=void 0;Qn.prototype.ruleId=void 0;Qn.prototype.source=void 0;const jE={}.hasOwnProperty,u7=new Map,d7=/[A-Z]/g,f7=new Set(["table","tbody","thead","tfoot","tr"]),h7=new Set(["td","th"]),ER="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function p7(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=v7(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=w7(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ta:gd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=xR(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function xR(e,t,n){if(t.type==="element")return m7(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return g7(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return b7(e,t,n);if(t.type==="mdxjsEsm")return y7(e,t);if(t.type==="root")return E7(e,t,n);if(t.type==="text")return x7(e,t)}function m7(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ta,e.schema=s),e.ancestors.push(t);const i=vR(e,t.tagName,!1),a=_7(e,t);let o=FE(e,t);return f7.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!NU(l):!0})),wR(e,a,i,t),BE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function g7(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ju(e,t.position)}function y7(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ju(e,t.position)}function b7(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ta,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:vR(e,t.name,!0),a=T7(e,t),o=FE(e,t);return wR(e,a,i,t),BE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function E7(e,t,n){const r={};return BE(r,FE(e,t)),e.create(t,e.Fragment,r,n)}function x7(e,t){return t.value}function wR(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function BE(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function w7(e,t,n){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?n:t;return o?u(i,a,o):u(i,a)}}function v7(e,t){return n;function n(r,s,i,a){const o=Array.isArray(i.children),l=Fs(r);return t(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function _7(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&jE.call(t.properties,s)){const i=k7(e,s,t.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&h7.has(t.tagName)?r=o:n[a]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function T7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ju(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else ju(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function FE(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:u7;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i0?(Or(e,e.length,0,t),e):t}const aT={}.hasOwnProperty;function TR(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function fs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ar=na(/[A-Za-z]/),Gn=na(/[\dA-Za-z]/),M7=na(/[#-'*+\--9=?A-Z^-~]/);function hp(e){return e!==null&&(e<32||e===127)}const d1=na(/\d/),D7=na(/[\dA-Fa-f]/),P7=na(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function At(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const gm=na(new RegExp("\\p{P}|\\p{S}","u")),Va=na(/\s/);function na(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $l(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function dt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return it(l)?(e.enter(n),o(l)):t(l)}function o(l){return it(l)&&i++a))return;const A=t.events.length;let N=A,R,I;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(R){I=t.events[N][1].end;break}R=!0}for(g(r),T=A;Tb;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=b}function E(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function $7(e,t,n){return dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gl(e){if(e===null||At(e)||Va(e))return 1;if(gm(e))return 2}function ym(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};lT(f,-l),lT(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Hr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Hr(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Hr(u,ym(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Hr(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Hr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Or(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&it(T)?dt(e,E,"linePrefix",i+1)(T):E(T)}function E(T){return T===null||Be(T)?e.check(cT,y,_)(T):(e.enter("codeFlowValue"),b(T))}function b(T){return T===null||Be(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),b)}function _(T){return e.exit("codeFenced"),t(T)}function k(T,A,N){let R=0;return I;function I(U){return T.enter("lineEnding"),T.consume(U),T.exit("lineEnding"),M}function M(U){return T.enter("codeFencedFence"),it(U)?dt(T,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):B(U)}function B(U){return U===o?(T.enter("codeFencedFenceSequence"),Y(U)):N(U)}function Y(U){return U===o?(R++,T.consume(U),Y):R>=a?(T.exit("codeFencedFenceSequence"),it(U)?dt(T,P,"whitespace")(U):P(U)):N(U)}function P(U){return U===null||Be(U)?(T.exit("codeFencedFence"),A(U)):N(U)}}}function J7(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const zg={name:"codeIndented",tokenize:t$},e$={partial:!0,tokenize:n$};function t$(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),dt(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):Be(u)?e.attempt(e$,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Be(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function n$(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):dt(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):Be(a)?s(a):n(a)}}const r$={name:"codeText",previous:i$,resolve:s$,tokenize:a$};function s$(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&fc(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function IR(e,t,n,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||hp(g)?n(g):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(o),h(g)):g===null||g===60||Be(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!d&&(g===null||g===41||At(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):d999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):Be(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Be(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!it(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function OR(e,t,n,r,s,i){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===a?(e.exit(i),l(a)):h===null?n(h):Be(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),dt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Be(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Zc(e,t){let n;return r;function r(s){return Be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):it(s)?dt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const p$={name:"definition",tokenize:g$},m$={partial:!0,tokenize:y$};function g$(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return RR.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return s=fs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return At(p)?Zc(e,u)(p):u(p)}function u(p){return IR(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(m$,f,f)(p)}function f(p){return it(p)?dt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Be(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function y$(e,t,n){return r;function r(o){return At(o)?Zc(e,s)(o):n(o)}function s(o){return OR(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return it(o)?dt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Be(o)?t(o):n(o)}}const b$={name:"hardBreakEscape",tokenize:E$};function E$(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Be(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const x$={name:"headingAtx",resolve:w$,tokenize:v$};function w$(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Or(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function v$(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||At(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Be(d)?(e.exit("atxHeading"),t(d)):it(d)?dt(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||At(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const _$=["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"],dT=["pre","script","style","textarea"],T$={concrete:!0,name:"htmlFlow",resolveTo:S$,tokenize:A$},k$={partial:!0,tokenize:I$},N$={partial:!0,tokenize:C$};function S$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function A$(e,t,n){const r=this;let s,i,a,o,l;return u;function u(D){return d(D)}function d(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),f}function f(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),i=!0,y):D===63?(e.consume(D),s=3,r.interrupt?t:S):ar(D)?(e.consume(D),a=String.fromCharCode(D),w):n(D)}function h(D){return D===45?(e.consume(D),s=2,p):D===91?(e.consume(D),s=5,o=0,m):ar(D)?(e.consume(D),s=4,r.interrupt?t:S):n(D)}function p(D){return D===45?(e.consume(D),r.interrupt?t:S):n(D)}function m(D){const ne="CDATA[";return D===ne.charCodeAt(o++)?(e.consume(D),o===ne.length?r.interrupt?t:B:m):n(D)}function y(D){return ar(D)?(e.consume(D),a=String.fromCharCode(D),w):n(D)}function w(D){if(D===null||D===47||D===62||At(D)){const ne=D===47,ee=a.toLowerCase();return!ne&&!i&&dT.includes(ee)?(s=1,r.interrupt?t(D):B(D)):_$.includes(a.toLowerCase())?(s=6,ne?(e.consume(D),g):r.interrupt?t(D):B(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):i?E(D):b(D))}return D===45||Gn(D)?(e.consume(D),a+=String.fromCharCode(D),w):n(D)}function g(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function E(D){return it(D)?(e.consume(D),E):I(D)}function b(D){return D===47?(e.consume(D),I):D===58||D===95||ar(D)?(e.consume(D),_):it(D)?(e.consume(D),b):I(D)}function _(D){return D===45||D===46||D===58||D===95||Gn(D)?(e.consume(D),_):k(D)}function k(D){return D===61?(e.consume(D),T):it(D)?(e.consume(D),k):b(D)}function T(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),l=D,A):it(D)?(e.consume(D),T):N(D)}function A(D){return D===l?(e.consume(D),l=null,R):D===null||Be(D)?n(D):(e.consume(D),A)}function N(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||At(D)?k(D):(e.consume(D),N)}function R(D){return D===47||D===62||it(D)?b(D):n(D)}function I(D){return D===62?(e.consume(D),M):n(D)}function M(D){return D===null||Be(D)?B(D):it(D)?(e.consume(D),M):n(D)}function B(D){return D===45&&s===2?(e.consume(D),C):D===60&&s===1?(e.consume(D),L):D===62&&s===4?(e.consume(D),H):D===63&&s===3?(e.consume(D),S):D===93&&s===5?(e.consume(D),j):Be(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(k$,V,Y)(D)):D===null||Be(D)?(e.exit("htmlFlowData"),Y(D)):(e.consume(D),B)}function Y(D){return e.check(N$,P,V)(D)}function P(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return D===null||Be(D)?Y(D):(e.enter("htmlFlowData"),B(D))}function C(D){return D===45?(e.consume(D),S):B(D)}function L(D){return D===47?(e.consume(D),a="",O):B(D)}function O(D){if(D===62){const ne=a.toLowerCase();return dT.includes(ne)?(e.consume(D),H):B(D)}return ar(D)&&a.length<8?(e.consume(D),a+=String.fromCharCode(D),O):B(D)}function j(D){return D===93?(e.consume(D),S):B(D)}function S(D){return D===62?(e.consume(D),H):D===45&&s===2?(e.consume(D),S):B(D)}function H(D){return D===null||Be(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),H)}function V(D){return e.exit("htmlFlow"),t(D)}}function C$(e,t,n){const r=this;return s;function s(a){return Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function I$(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(yd,t,n)}}const R$={name:"htmlText",tokenize:O$};function O$(e,t,n){const r=this;let s,i,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),u):S===47?(e.consume(S),k):S===63?(e.consume(S),b):ar(S)?(e.consume(S),N):n(S)}function u(S){return S===45?(e.consume(S),d):S===91?(e.consume(S),i=0,m):ar(S)?(e.consume(S),E):n(S)}function d(S){return S===45?(e.consume(S),p):n(S)}function f(S){return S===null?n(S):S===45?(e.consume(S),h):Be(S)?(a=f,L(S)):(e.consume(S),f)}function h(S){return S===45?(e.consume(S),p):f(S)}function p(S){return S===62?C(S):S===45?h(S):f(S)}function m(S){const H="CDATA[";return S===H.charCodeAt(i++)?(e.consume(S),i===H.length?y:m):n(S)}function y(S){return S===null?n(S):S===93?(e.consume(S),w):Be(S)?(a=y,L(S)):(e.consume(S),y)}function w(S){return S===93?(e.consume(S),g):y(S)}function g(S){return S===62?C(S):S===93?(e.consume(S),g):y(S)}function E(S){return S===null||S===62?C(S):Be(S)?(a=E,L(S)):(e.consume(S),E)}function b(S){return S===null?n(S):S===63?(e.consume(S),_):Be(S)?(a=b,L(S)):(e.consume(S),b)}function _(S){return S===62?C(S):b(S)}function k(S){return ar(S)?(e.consume(S),T):n(S)}function T(S){return S===45||Gn(S)?(e.consume(S),T):A(S)}function A(S){return Be(S)?(a=A,L(S)):it(S)?(e.consume(S),A):C(S)}function N(S){return S===45||Gn(S)?(e.consume(S),N):S===47||S===62||At(S)?R(S):n(S)}function R(S){return S===47?(e.consume(S),C):S===58||S===95||ar(S)?(e.consume(S),I):Be(S)?(a=R,L(S)):it(S)?(e.consume(S),R):C(S)}function I(S){return S===45||S===46||S===58||S===95||Gn(S)?(e.consume(S),I):M(S)}function M(S){return S===61?(e.consume(S),B):Be(S)?(a=M,L(S)):it(S)?(e.consume(S),M):R(S)}function B(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),s=S,Y):Be(S)?(a=B,L(S)):it(S)?(e.consume(S),B):(e.consume(S),P)}function Y(S){return S===s?(e.consume(S),s=void 0,U):S===null?n(S):Be(S)?(a=Y,L(S)):(e.consume(S),Y)}function P(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||At(S)?R(S):(e.consume(S),P)}function U(S){return S===47||S===62||At(S)?R(S):n(S)}function C(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function L(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),O}function O(S){return it(S)?dt(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):j(S)}function j(S){return e.enter("htmlTextData"),a(S)}}const HE={name:"labelEnd",resolveAll:P$,resolveTo:j$,tokenize:B$},L$={tokenize:F$},M$={tokenize:U$},D$={tokenize:$$};function P$(e){let t=-1;const n=[];for(;++t=3&&(u===null||Be(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),it(u)?dt(e,o,"whitespace")(u):o(u))}}const pr={continuation:{tokenize:Q$},exit:J$,name:"list",tokenize:X$},q$={partial:!0,tokenize:eH},G$={partial:!0,tokenize:Z$};function X$(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:d1(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(fh,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return d1(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yd,r.interrupt?n:d,e.attempt(q$,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return it(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Q$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yd,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,dt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!it(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(G$,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,dt(e,e.attempt(pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Z$(e,t,n){const r=this;return dt(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function J$(e){e.exit(this.containerState.type)}function eH(e,t,n){const r=this;return dt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!it(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const fT={name:"setextUnderline",resolveTo:tH,tokenize:nH};function tH(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function nH(e,t,n){const r=this;let s;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),it(u)?dt(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Be(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const rH={tokenize:sH};function sH(e){const t=this,n=e.attempt(yd,r,e.attempt(this.parser.constructs.flowInitial,s,dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(c$,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const iH={resolveAll:MR()},aH=LR("string"),oH=LR("text");function LR(e){return{resolveAll:MR(e==="text"?lH:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,o);return a;function a(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=s[d];let h=-1;if(f)for(;++h-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function wH(e,t){let n=-1;const r=[];let s;for(;++n0){const ut=le.tokenStack[le.tokenStack.length-1];(ut[1]||pT).call(le,void 0,ut[0])}for(X.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})},Re=-1;++Re0){const ut=le.tokenStack[le.tokenStack.length-1];(ut[1]||pT).call(le,void 0,ut[0])}for(X.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})},Re=-1;++Re0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function DH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=$l(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function BH(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FH(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function jR(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function UH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jR(e,t);const s={src:$l(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function $H(e,t){const n={src:$l(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function HH(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function zH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jR(e,t);const s={href:$l(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function VH(e,t){const n={href:$l(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KH(e,t,n){const r=e.all(t),s=n?YH(n):BR(t),i={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function WH(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Fs(t.children[1]),l=gm(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function ZH(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(yT(t.slice(s),s>0,!1)),i.join("")}function yT(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===mT||i===gT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===mT||i===gT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function tz(e,t){const n={type:"text",value:ez(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rz={blockquote:OH,break:LH,code:MH,delete:DH,emphasis:PH,footnoteReference:jH,heading:BH,html:FH,imageReference:UH,image:$H,inlineCode:HH,linkReference:zH,link:VH,listItem:KH,list:WH,paragraph:qH,root:GH,strong:XH,table:QH,tableCell:JH,tableRow:ZH,text:tz,thematicBreak:nz,toml:Ef,yaml:Ef,definition:Ef,footnoteDefinition:Ef};function Ef(){}const FR=-1,Em=0,Jc=1,pp=2,zE=3,VE=4,KE=5,YE=6,UR=7,$R=8,sz=typeof self=="object"?self:globalThis,bT=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new sz[e](t)},iz=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=t[s];switch(i){case Em:case FR:return n(a,s);case Jc:{const o=n([],s);for(const l of a)o.push(r(l));return o}case pp:{const o=n({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case zE:return n(new Date(a),s);case VE:{const{source:o,flags:l}=a;return n(new RegExp(o,l),s)}case KE:{const o=n(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case YE:{const o=n(new Set,s);for(const l of a)o.add(r(l));return o}case UR:{const{name:o,message:l}=a;return n(bT(o,l),s)}case $R:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(bT(i,a),s)};return r},ET=e=>iz(new Map,e)(0),fo="",{toString:az}={},{keys:oz}=Object,hc=e=>{const t=typeof e;if(t!=="object"||!e)return[Em,t];const n=az.call(e).slice(8,-1);switch(n){case"Array":return[Jc,fo];case"Object":return[pp,fo];case"Date":return[zE,fo];case"RegExp":return[VE,fo];case"Map":return[KE,fo];case"Set":return[YE,fo];case"DataView":return[Jc,n]}return n.includes("Array")?[Jc,n]:n.includes("Error")?[UR,n]:[pp,n]},xf=([e,t])=>e===Em&&(t==="function"||t==="symbol"),lz=(e,t,n,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},i=a=>{if(n.has(a))return n.get(a);let[o,l]=hc(a);switch(o){case Em:{let d=a;switch(l){case"bigint":o=$R,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return s([FR],a)}return s([o,d],a)}case Jc:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),s([l,[...h]],a)}const d=[],f=s([o,d],a);for(const h of a)d.push(i(h));return f}case pp:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],f=s([o,d],a);for(const h of oz(a))(e||!xf(hc(a[h])))&&d.push([i(h),i(a[h])]);return f}case zE:return s([o,a.toISOString()],a);case VE:{const{source:d,flags:f}=a;return s([o,{source:d,flags:f}],a)}case KE:{const d=[],f=s([o,d],a);for(const[h,p]of a)(e||!(xf(hc(h))||xf(hc(p))))&&d.push([i(h),i(p)]);return f}case YE:{const d=[],f=s([o,d],a);for(const h of a)(e||!xf(hc(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xT=(e,{json:t,lossy:n}={})=>{const r=[];return lz(!(t||n),!!t,new Map,r)(e),r},yl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ET(xT(e,t)):structuredClone(e):(e,t)=>ET(xT(e,t));function cz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function uz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function dz(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||cz,r=e.options.footnoteBackLabel||uz,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&m.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const E=w.children[w.children.length-1];E&&E.type==="text"?E.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...yl(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)}function YH(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r1}function WH(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Fs(t.children[1]),l=mm(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function ZH(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(yT(t.slice(s),s>0,!1)),i.join("")}function yT(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===mT||i===gT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===mT||i===gT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function tz(e,t){const n={type:"text",value:ez(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rz={blockquote:OH,break:LH,code:MH,delete:DH,emphasis:PH,footnoteReference:jH,heading:BH,html:FH,imageReference:UH,image:$H,inlineCode:HH,linkReference:zH,link:VH,listItem:KH,list:WH,paragraph:qH,root:GH,strong:XH,table:QH,tableCell:JH,tableRow:ZH,text:tz,thematicBreak:nz,toml:Ef,yaml:Ef,definition:Ef,footnoteDefinition:Ef};function Ef(){}const FR=-1,bm=0,Jc=1,pp=2,zE=3,VE=4,KE=5,YE=6,UR=7,$R=8,sz=typeof self=="object"?self:globalThis,bT=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new sz[e](t)},iz=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=t[s];switch(i){case bm:case FR:return n(a,s);case Jc:{const o=n([],s);for(const l of a)o.push(r(l));return o}case pp:{const o=n({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case zE:return n(new Date(a),s);case VE:{const{source:o,flags:l}=a;return n(new RegExp(o,l),s)}case KE:{const o=n(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case YE:{const o=n(new Set,s);for(const l of a)o.add(r(l));return o}case UR:{const{name:o,message:l}=a;return n(bT(o,l),s)}case $R:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(bT(i,a),s)};return r},ET=e=>iz(new Map,e)(0),fo="",{toString:az}={},{keys:oz}=Object,hc=e=>{const t=typeof e;if(t!=="object"||!e)return[bm,t];const n=az.call(e).slice(8,-1);switch(n){case"Array":return[Jc,fo];case"Object":return[pp,fo];case"Date":return[zE,fo];case"RegExp":return[VE,fo];case"Map":return[KE,fo];case"Set":return[YE,fo];case"DataView":return[Jc,n]}return n.includes("Array")?[Jc,n]:n.includes("Error")?[UR,n]:[pp,n]},xf=([e,t])=>e===bm&&(t==="function"||t==="symbol"),lz=(e,t,n,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},i=a=>{if(n.has(a))return n.get(a);let[o,l]=hc(a);switch(o){case bm:{let d=a;switch(l){case"bigint":o=$R,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return s([FR],a)}return s([o,d],a)}case Jc:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),s([l,[...h]],a)}const d=[],f=s([o,d],a);for(const h of a)d.push(i(h));return f}case pp:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],f=s([o,d],a);for(const h of oz(a))(e||!xf(hc(a[h])))&&d.push([i(h),i(a[h])]);return f}case zE:return s([o,a.toISOString()],a);case VE:{const{source:d,flags:f}=a;return s([o,{source:d,flags:f}],a)}case KE:{const d=[],f=s([o,d],a);for(const[h,p]of a)(e||!(xf(hc(h))||xf(hc(p))))&&d.push([i(h),i(p)]);return f}case YE:{const d=[],f=s([o,d],a);for(const h of a)(e||!xf(hc(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xT=(e,{json:t,lossy:n}={})=>{const r=[];return lz(!(t||n),!!t,new Map,r)(e),r},yl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ET(xT(e,t)):structuredClone(e):(e,t)=>ET(xT(e,t));function cz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function uz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function dz(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||cz,r=e.options.footnoteBackLabel||uz,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&m.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const E=w.children[w.children.length-1];E&&E.type==="text"?E.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...yl(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const bd=function(e){if(e==null)return mz;if(typeof e=="function")return xm(e);if(typeof e=="object")return Array.isArray(e)?fz(e):hz(e);if(typeof e=="string")return pz(e);throw new Error("Expected function, string, or object as test")};function fz(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=HR,m,y,w;if((!t||i(l,u,d[d.length-1]||void 0))&&(p=Ez(n(l,d)),p[0]===p1))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==bz)for(y=(r?g.children.length:-1)+a,w=d.concat(g);y>-1&&y":""))+")"})}return h;function h(){let p=HR,m,y,w;if((!t||i(l,u,d[d.length-1]||void 0))&&(p=Ez(n(l,d)),p[0]===h1))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==bz)for(y=(r?g.children.length:-1)+a,w=d.concat(g);y>-1&&y0&&n.push({type:"text",value:` `}),n}function wT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vT(e,t){const n=wz(e,t),r=n.one(e,void 0),s=dz(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function kz(e,t){return e&&"run"in e?async function(n,r){const s=vT(n,{file:r,...t});await e.run(s,r)}:function(n,r){return vT(n,{file:r,...e||t})}}function _T(e){if(e)throw e}var hh=Object.prototype.hasOwnProperty,VR=Object.prototype.toString,TT=Object.defineProperty,NT=Object.getOwnPropertyDescriptor,kT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):VR.call(t)==="[object Array]"},ST=function(t){if(!t||VR.call(t)!=="[object Object]")return!1;var n=hh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&hh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||hh.call(t,s)},AT=function(t,n){TT&&n.name==="__proto__"?TT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},CT=function(t,n){if(n==="__proto__")if(hh.call(t,n)){if(NT)return NT(t,n).value}else return;return t[n]},Sz=function e(){var t,n,r,s,i,a,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});la.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return s(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){n||(n=!0,t(a,...o))}function i(a){s(null,a)}}const ks={basename:Iz,dirname:Rz,extname:Oz,join:Lz,sep:"/"};function Iz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xd(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===t.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Rz(e){if(xd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Oz(e){xd(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function Lz(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Dz(e,t){let n="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return n}function xd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Pz={cwd:jz};function jz(){return"/"}function y1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Bz(e){if(typeof e=="string")e=new URL(e);else if(!y1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Fz(e)}function Fz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...m]=d;const y=r[h][1];g1(y)&&g1(p)&&(p=Yg(!0,y,p)),r[h]=[u,p,...m]}}}}const zz=new WE().freeze();function Xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Zg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RT(e){if(!g1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wf(e){return Vz(e)?e:new KR(e)}function Vz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Kz(e){return typeof e=="string"||Yz(e)}function Yz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",LT=[],MT={allowDangerousHtml:!0},qz=/^(https?|ircs?|mailto|xmpp)$/i,Gz=[{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:"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 Xz(e){const t=Qz(e),n=Zz(e);return Jz(t.runSync(t.parse(n),n),e)}function Qz(e){const t=e.rehypePlugins||LT,n=e.remarkPlugins||LT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...MT}:MT;return zz().use(RH).use(n).use(kz,r).use(t)}function Zz(e){const t=e.children||"",n=new KR;return typeof t=="string"&&(n.value=t),n}function Jz(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||eV;for(const d of Gz)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Wz+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Ed(e,u),p7(e,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in zg)if(Object.hasOwn(zg,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],y=zg[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=l(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function eV(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||qz.test(e.slice(0,t))?e:""}function DT(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function tV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function nV(e,t,n){const s=bd((n||{}).ignore||[]),i=rV(t);let a=-1;for(;++a0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=_+1:(m!==_&&E.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(T)?E.push(...T):T&&E.push(T),m=_+b[0].length,g=!0),!h.global)break;b=h.exec(u.value)}return g?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=DT(e,"(");let i=DT(e,")");for(;r!==-1&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function YR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Va(n)||ym(n))&&(!t||n!==47)}WR.peek=kV;function bV(){this.buffer()}function EV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function xV(){this.buffer()}function wV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _V(e){this.exit(e)}function TV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NV(e){this.exit(e)}function kV(){return"["}function WR(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function SV(){return{enter:{gfmFootnoteCallString:bV,gfmFootnoteCall:EV,gfmFootnoteDefinitionLabelString:xV,gfmFootnoteDefinition:wV},exit:{gfmFootnoteCallString:vV,gfmFootnoteCall:_V,gfmFootnoteDefinitionLabelString:TV,gfmFootnoteDefinition:NV}}}function AV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:WR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?qR:CV))),u(),l}}function CV(e,t,n){return t===0?e:qR(e,t,n)}function qR(e,t,n){return(n?"":" ")+e}const IV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];GR.peek=DV;function RV(){return{canContainEols:["delete"],enter:{strikethrough:LV},exit:{strikethrough:MV}}}function OV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:IV}],handlers:{delete:GR}}}function LV(e){this.enter({type:"delete",children:[]},e)}function MV(e){this.exit(e)}function GR(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function DV(){return"~"}function PV(e){return e.length}function jV(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||PV,i=[],a=[],o=[],l=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++gl[g])&&(l[g]=b)}y.push(E)}a[d]=y,o[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=E),p[f]=E),h[f]=b}a.splice(1,0,h),o.splice(1,0,p),d=-1;const m=[];for(;++d"u"||hh.call(t,s)},AT=function(t,n){TT&&n.name==="__proto__"?TT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},CT=function(t,n){if(n==="__proto__")if(hh.call(t,n)){if(kT)return kT(t,n).value}else return;return t[n]},Sz=function e(){var t,n,r,s,i,a,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});la.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return s(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){n||(n=!0,t(a,...o))}function i(a){s(null,a)}}const Ns={basename:Iz,dirname:Rz,extname:Oz,join:Lz,sep:"/"};function Iz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xd(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===t.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Rz(e){if(xd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Oz(e){xd(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function Lz(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Dz(e,t){let n="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return n}function xd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Pz={cwd:jz};function jz(){return"/"}function g1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Bz(e){if(typeof e=="string")e=new URL(e);else if(!g1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Fz(e)}function Fz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...m]=d;const y=r[h][1];m1(y)&&m1(p)&&(p=Kg(!0,y,p)),r[h]=[u,p,...m]}}}}const zz=new WE().freeze();function Gg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RT(e){if(!m1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wf(e){return Vz(e)?e:new KR(e)}function Vz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Kz(e){return typeof e=="string"||Yz(e)}function Yz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",LT=[],MT={allowDangerousHtml:!0},qz=/^(https?|ircs?|mailto|xmpp)$/i,Gz=[{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:"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 Xz(e){const t=Qz(e),n=Zz(e);return Jz(t.runSync(t.parse(n),n),e)}function Qz(e){const t=e.rehypePlugins||LT,n=e.remarkPlugins||LT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...MT}:MT;return zz().use(RH).use(n).use(Nz,r).use(t)}function Zz(e){const t=e.children||"",n=new KR;return typeof t=="string"&&(n.value=t),n}function Jz(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||eV;for(const d of Gz)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Wz+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Ed(e,u),p7(e,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in Hg)if(Object.hasOwn(Hg,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],y=Hg[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=l(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function eV(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||qz.test(e.slice(0,t))?e:""}function DT(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function tV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function nV(e,t,n){const s=bd((n||{}).ignore||[]),i=rV(t);let a=-1;for(;++a0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=_+1:(m!==_&&E.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(T)?E.push(...T):T&&E.push(T),m=_+b[0].length,g=!0),!h.global)break;b=h.exec(u.value)}return g?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=DT(e,"(");let i=DT(e,")");for(;r!==-1&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function YR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Va(n)||gm(n))&&(!t||n!==47)}WR.peek=NV;function bV(){this.buffer()}function EV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function xV(){this.buffer()}function wV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _V(e){this.exit(e)}function TV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function kV(e){this.exit(e)}function NV(){return"["}function WR(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function SV(){return{enter:{gfmFootnoteCallString:bV,gfmFootnoteCall:EV,gfmFootnoteDefinitionLabelString:xV,gfmFootnoteDefinition:wV},exit:{gfmFootnoteCallString:vV,gfmFootnoteCall:_V,gfmFootnoteDefinitionLabelString:TV,gfmFootnoteDefinition:kV}}}function AV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:WR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?` +`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?qR:CV))),u(),l}}function CV(e,t,n){return t===0?e:qR(e,t,n)}function qR(e,t,n){return(n?"":" ")+e}const IV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];GR.peek=DV;function RV(){return{canContainEols:["delete"],enter:{strikethrough:LV},exit:{strikethrough:MV}}}function OV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:IV}],handlers:{delete:GR}}}function LV(e){this.enter({type:"delete",children:[]},e)}function MV(e){this.exit(e)}function GR(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function DV(){return"~"}function PV(e){return e.length}function jV(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||PV,i=[],a=[],o=[],l=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++gl[g])&&(l[g]=b)}y.push(E)}a[d]=y,o[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=E),p[f]=E),h[f]=b}a.splice(1,0,h),o.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),UV);return s(),a}function UV(e,t,n){return">"+(n?"":" ")+e}function $V(e,t){return BT(e,t.inConstruct,!0)&&!BT(e,t.notInConstruct,!1)}function BT(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ra&&(a=i):i=1,s=r+t.length,r=n.indexOf(t,s);return a}function zV(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function VV(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function KV(e,t,n,r){const s=VV(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(zV(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,YV);return f(),h}const o=n.createTracker(r),l=s.repeat(Math.max(HV(i,s)+1,3)),u=n.enter("codeFenced");let d=o.move(l);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...o.current()})),f()}return d+=o.move(` `),i&&(d+=o.move(i+` `)),d+=o.move(l),u(),d}function YV(e,t,n){return(n?"":" ")+e}function qE(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function WV(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function qV(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Bu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mp(e,t,n){const r=gl(e),s=gl(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}QR.peek=GV;function QR(e,t,n,r){const s=qV(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=mp(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Bu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=mp(r.after.charCodeAt(0),f,s);h.inside&&(l=l.slice(0,-1)+Bu(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function GV(e,t,n){return n.options.emphasis||"*"}function XV(e,t){let n=!1;return Ed(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,p1}),!!((!e.depth||e.depth<3)&&UE(e)&&(t.options.setext||n))}function QV(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(XV(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:` +`,...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function qV(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Bu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mp(e,t,n){const r=gl(e),s=gl(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}QR.peek=GV;function QR(e,t,n,r){const s=qV(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=mp(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Bu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=mp(r.after.charCodeAt(0),f,s);h.inside&&(l=l.slice(0,-1)+Bu(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function GV(e,t,n){return n.options.emphasis||"*"}function XV(e,t){let n=!1;return Ed(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,h1}),!!((!e.depth||e.depth<3)&&UE(e)&&(t.options.setext||n))}function QV(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(XV(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:` `,after:` `});return f(),d(),h+` `+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const a="#".repeat(s),o=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=Bu(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}ZR.peek=ZV;function ZR(e){return e.value||""}function ZV(){return"<"}JR.peek=JV;function JR(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function JV(){return"!"}eO.peek=eK;function eO(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function eK(){return"!"}tO.peek=tK;function tO(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}rO.peek=nK;function rO(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(nO(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function nK(e,t,n){return nO(e,n)?"<":"["}sO.peek=rK;function sO(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function rK(){return"["}function GE(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function sK(e){const t=GE(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function iK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function iO(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function aK(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?iK(n):GE(n);const o=e.ordered?a==="."?")":".":sK(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),iO(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return l(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?i:i+" ".repeat(a-i.length))+f}}function cK(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const uK=bd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function dK(e,t,n,r){return(e.children.some(function(a){return uK(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function fK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aO.peek=hK;function aO(e,t,n,r){const s=fK(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=mp(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Bu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=mp(r.after.charCodeAt(0),f,s);h.inside&&(l=l.slice(0,-1)+Bu(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function hK(e,t,n){return n.options.strong||"*"}function pK(e,t,n,r){return n.safe(e.value,r)}function mK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function gK(e,t,n){const r=(iO(n)+(n.options.ruleSpaces?" ":"")).repeat(mK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const oO={blockquote:FV,break:FT,code:KV,definition:WV,emphasis:QR,hardBreak:FT,heading:QV,html:ZR,image:JR,imageReference:eO,inlineCode:tO,link:rO,linkReference:sO,list:aK,listItem:lK,paragraph:cK,root:dK,strong:aO,text:pK,thematicBreak:gK};function yK(){return{enter:{table:bK,tableData:UT,tableHeader:UT,tableRow:xK},exit:{codeText:wK,table:EK,tableData:n0,tableHeader:n0,tableRow:n0}}}function bK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function EK(e){this.exit(e),this.data.inTable=void 0}function xK(e){this.enter({type:"tableRow",children:[]},e)}function n0(e){this.exit(e)}function UT(e){this.enter({type:"tableCell",children:[]},e)}function wK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vK(e,t){return t==="|"?t:e}function _K(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=Bu(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}ZR.peek=ZV;function ZR(e){return e.value||""}function ZV(){return"<"}JR.peek=JV;function JR(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function JV(){return"!"}eO.peek=eK;function eO(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function eK(){return"!"}tO.peek=tK;function tO(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}rO.peek=nK;function rO(e,t,n,r){const s=qE(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(nO(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function nK(e,t,n){return nO(e,n)?"<":"["}sO.peek=rK;function sO(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function rK(){return"["}function GE(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function sK(e){const t=GE(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function iK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function iO(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function aK(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?iK(n):GE(n);const o=e.ordered?a==="."?")":".":sK(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),iO(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return l(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?i:i+" ".repeat(a-i.length))+f}}function cK(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const uK=bd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function dK(e,t,n,r){return(e.children.some(function(a){return uK(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function fK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aO.peek=hK;function aO(e,t,n,r){const s=fK(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=mp(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Bu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=mp(r.after.charCodeAt(0),f,s);h.inside&&(l=l.slice(0,-1)+Bu(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function hK(e,t,n){return n.options.strong||"*"}function pK(e,t,n,r){return n.safe(e.value,r)}function mK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function gK(e,t,n){const r=(iO(n)+(n.options.ruleSpaces?" ":"")).repeat(mK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const oO={blockquote:FV,break:FT,code:KV,definition:WV,emphasis:QR,hardBreak:FT,heading:QV,html:ZR,image:JR,imageReference:eO,inlineCode:tO,link:rO,linkReference:sO,list:aK,listItem:lK,paragraph:cK,root:dK,strong:aO,text:pK,thematicBreak:gK};function yK(){return{enter:{table:bK,tableData:UT,tableHeader:UT,tableRow:xK},exit:{codeText:wK,table:EK,tableData:t0,tableHeader:t0,tableRow:t0}}}function bK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function EK(e){this.exit(e),this.data.inTable=void 0}function xK(e){this.enter({type:"tableRow",children:[]},e)}function t0(e){this.exit(e)}function UT(e){this.enter({type:"tableCell",children:[]},e)}function wK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vK(e,t){return t==="|"?t:e}function _K(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";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:h,table:a,tableCell:l,tableRow:o}};function a(p,m,y,w){return u(d(p,y,w),p.align)}function o(p,m,y,w){const g=f(p,y,w),E=u([g]);return E.slice(0,E.indexOf(` -`))}function l(p,m,y,w){const g=y.enter("tableCell"),E=y.enter("phrasing"),b=y.containerPhrasing(p,{...w,before:i,after:i});return E(),g(),b}function u(p,m){return jV(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,y){const w=p.children;let g=-1;const E=[],b=m.enter("table");for(;++g0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const $K={tokenize:GK,partial:!0};function HK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:YK,continuation:{tokenize:WK},exit:qK}},text:{91:{name:"gfmFootnoteCall",tokenize:KK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zK,resolveTo:VK}}}}function zK(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=fs(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function VK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function KK(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!a||f===null||f===91||At(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(fs(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return At(f)||(a=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function YK(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(a>999||m===93&&!o||m===null||m===91||At(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return i=fs(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return At(m)||(o=!0),a++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(i)||s.push(i),dt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function WK(e,t,n){return e.check(yd,t,e.attempt($K,t,n))}function qK(e){e.exit("gfmFootnoteDefinition")}function GK(e,t,n){const r=this;return dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function XK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(m):(a.consume(m),f++,p);if(f<2&&!n)return l(m);const w=a.exit("strikethroughSequenceTemporary"),g=gl(m);return w._open=!g||g===2&&!!y,w._close=!y||y===2&&!!g,o(m)}}}class QK{constructor(){this.map=[]}add(t,n,r){ZK(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function ZK(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const P=r.events[M][1].type;if(P==="lineEnding"||P==="linePrefix")M--;else break}const B=M>-1?r.events[M][1].type:null,Y=B==="tableHead"||B==="tableRow"?T:l;return Y===T&&r.parser.lazy[r.now().line]?n(I):Y(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):Be(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):it(I)?dt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||At(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,it(I)?dt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):N(I)}function y(I){return it(I)?dt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),g):I===45?(i+=1,g(I)):I===null||Be(I)?_(I):N(I)}function g(I){return I===45?(e.enter("tableDelimiterFiller"),E(I)):N(I)}function E(I){return I===45?(e.consume(I),E):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(I))}function b(I){return it(I)?dt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||Be(I)?!a||s!==i?N(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):N(I)}function N(I){return n(I)}function T(I){return e.enter("tableRow"),A(I)}function A(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),A):I===null||Be(I)?(e.exit("tableRow"),t(I)):it(I)?dt(e,A,"whitespace")(I):(e.enter("data"),k(I))}function k(I){return I===null||I===124||At(I)?(e.exit("data"),A(I)):(e.consume(I),I===92?R:k)}function R(I){return I===92||I===124?(e.consume(I),k):k(I)}}function nY(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,d,f;const h=new QK;for(;++nn[2]+1){const m=n[2]+1,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},bo(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function HT(e,t,n,r,s){const i=[],a=bo(t.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function bo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const rY={name:"tasklistCheck",tokenize:iY};function sY(){return{text:{91:rY}}}function iY(e,t,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return At(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Be(l)?t(l):it(l)?e.check({tokenize:aY},t,n)(l):n(l)}}function aY(e,t,n){return dt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function oY(e){return TR([OK(),HK(),XK(e),eY(),sY()])}const lY={};function cY(e){const t=this,n=e||lY,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(oY(n)),i.push(AK()),a.push(CK(n))}const zT=function(e,t,n){const r=bd(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&l.push(` -`.repeat(u)||" "),u=-1,l.push(d))}return l.join("")}function yO(e,t,n){return e.type==="element"?yY(e,t,n):e.type==="text"?n.whitespace==="normal"?bO(e,n):bY(e):[]}function yY(e,t,n){const r=EO(e,n),s=e.children||[];let i=-1,a=[];if(mY(e))return a;let o,l;for(E1(e)||WT(e)&&zT(t,e,WT)?l=` -`:pY(e)?(o=2,l=2):gO(e)&&(o=1,l=1);++i]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],y=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},N={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[N,f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function NY(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=TY(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function xO(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(o);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],g={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],N=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:y,literal:w,built_in:[...E,...b,"set","shopt",..._,...N]},contains:[p,e.SHEBANG(),m,f,i,a,g,o,l,u,d,n]}}function kY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},g=[f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:g.concat([{begin:/\(/,end:/\)/,keywords:w,contains:g.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function SY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],y=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},N={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[N,f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function AY(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:t,literal:r},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=e.inherit(h,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[u,y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const CY=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),IY=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],RY=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],OY=[...IY,...RY],LY=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),MY=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),DY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),PY=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function jY(e){const t=e.regex,n=CY(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+MY.join("|")+")"},{begin:":(:)?("+DY.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+PY.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:LY.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+OY.join("|")+")\\b"}]}}function BY(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function FY(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"vO(e,t,n-1))}function $Y(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+vO("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,qT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},qT,u]}}const GT="[A-Za-z$_][0-9A-Za-z$_]*",HY=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zY=["true","false","null","undefined","NaN","Infinity"],_O=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],TO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],VY=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],KY=[].concat(NO,_O,TO);function kO(e){const t=e.regex,n=(O,{after:j})=>{const S="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const S=O[0].length+O.index,H=O.input[S];if(H==="<"||H===","){j.ignoreMatch();return}H===">"&&(n(O,{after:S})||j.ignoreMatch());let V;const D=O.input.substring(S);if(V=D.match(/^\s*=/)){j.ignoreMatch();return}if((V=D.match(/^\s+extends\s+/))&&V.index===0){j.ignoreMatch();return}}},o={$pattern:GT,keyword:HY,literal:zY,built_in:KY,"variable.language":VY},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(E,h.contains),N=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._O,...TO]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,B([...NO,"super","import"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,E,{match:/\$\d+/},f,k,{scope:"attr",match:r+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,M,A,U,{match:/\$[(.]/}]}}function SO(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var xo="[0-9](_*[0-9])*",Nf=`\\.(${xo})`,kf="[0-9a-fA-F](_*[0-9a-fA-F])*",YY={className:"number",variants:[{begin:`(\\b(${xo})((${Nf})|\\.)?|(${Nf}))[eE][+-]?(${xo})[fFdD]?\\b`},{begin:`\\b(${xo})((${Nf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Nf})[fFdD]?\\b`},{begin:`\\b(${xo})[fFdD]\\b`},{begin:`\\b0[xX]((${kf})\\.?|(${kf})?\\.(${kf}))[pP][+-]?(${xo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${kf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function WY(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,s]}]};s.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=YY,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,o,l,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const qY=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),GY=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],XY=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],QY=[...GY,...XY],ZY=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),AO=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),CO=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JY=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),eW=AO.concat(CO).sort().reverse();function tW(e){const t=qY(e),n=eW,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],o=[],l=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},u=function(b,_,N){return{className:b,begin:_,relevance:N}},d={$pattern:/[a-z-]+/,keyword:r,attribute:ZY.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:d,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+s,10),u("variable","@\\{"+s+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JY.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},y={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:o,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+s+"\\}"),{begin:"\\b("+QY.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",i,0),u("selector-id","#"+i),u("selector-class","\\."+i,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+AO.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+CO.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,w,E,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function nW(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function IO(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,l];return[u,d,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,i,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},s,r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rW(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function sW(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,i,l],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(y,w,g="\\1")=>{const E=g==="\\1"?g:t.concat(g,w);return t.concat(t.concat("(?:",y,")"),w,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,g,r)},p=(y,w,g)=>t.concat(t.concat("(?:",y,")"),w,/(?:\\.|[^\\\/])*?/,g,r),m=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:m}}function iW(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(P,U)=>{U.data._beginMatch=P[1]||P[2]},"on:end":(P,U)=>{U.data._beginMatch!==P[1]&&U.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,m={scope:"string",variants:[d,u,f,h]},y={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:g,literal:(P=>{const U=[];return P.forEach(C=>{U.push(C),C.toLowerCase()===C?U.push(C.toUpperCase()):U.push(C.toLowerCase())}),U})(w),built_in:E},N=P=>P.map(U=>U.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",N(E).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(r,"\\b(?!\\()"),k={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,k,e.C_BLOCK_COMMENT_MODE,m,y,T]},M={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",N(g).join("\\b|"),"|",N(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(M);const B=[R,k,e.C_BLOCK_COMMENT_MODE,m,y,T],Y={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},a,M,k,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",Y,a,k,e.C_BLOCK_COMMENT_MODE,m,y]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,y]}}function aW(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function oW(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function OO(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${r.join("|")}`,y={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,y,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,y,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[y,g,f]}]}}function lW(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function cW(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function uW(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},y={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},T=[f,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);d.contains=T,y.contains=T;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:T}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(I).concat(u).concat(T)}}function dW(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:o,literal:l,built_in:u},illegal:""},i]}}const fW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),hW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],pW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],mW=[...hW,...pW],gW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),yW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),bW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),EW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xW(e){const t=fW(e),n=bW,r=yW,s="@[a-z-]+",i="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+mW.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+EW.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:gW.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function wW(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function vW(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...l].filter(N=>!d.includes(N)),y={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(N){return t.concat(/\b/,t.either(...N.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:E(h),relevance:0};function _(N,{exceptions:T,when:A}={}){const k=A;return T=T||[],N.map(R=>R.match(/\|\d+$/)||T.includes(R)?R:k(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:N=>N.length<3}),literal:i,type:o,built_in:f},contains:[{scope:"type",match:E(a)},b,g,y,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function LO(e){return e?typeof e=="string"?e:e.source:null}function pc(e){return Tt("(?=",e,")")}function Tt(...e){return e.map(n=>LO(n)).join("")}function _W(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function sr(...e){return"("+(_W(e).capture?"":"?:")+e.map(r=>LO(r)).join("|")+")"}const ZE=e=>Tt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),TW=["Protocol","Type"].map(ZE),XT=["init","self"].map(ZE),NW=["Any","Self"],r0=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],QT=["false","nil","true"],kW=["assignment","associativity","higherThan","left","lowerThan","none","right"],SW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ZT=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],MO=sr(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),DO=sr(MO,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),s0=Tt(MO,DO,"*"),PO=sr(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),gp=sr(PO,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ts=Tt(PO,gp,"*"),Sf=Tt(/[A-Z]/,gp,"*"),AW=["attached","autoclosure",Tt(/convention\(/,sr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Tt(/objc\(/,Ts,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],CW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function IW(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,sr(...TW,...XT)],className:{2:"keyword"}},i={match:Tt(/\./,sr(...r0)),relevance:0},a=r0.filter(ge=>typeof ge=="string").concat(["_|0"]),o=r0.filter(ge=>typeof ge!="string").concat(NW).map(ZE),l={variants:[{className:"keyword",match:sr(...o,...XT)}]},u={$pattern:sr(/\b\w+/,/#\w+/),keyword:a.concat(SW),literal:QT},d=[s,i,l],f={match:Tt(/\./,sr(...ZT)),relevance:0},h={className:"built_in",match:Tt(/\b/,sr(...ZT),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},y={className:"operator",relevance:0,variants:[{match:s0},{match:`\\.(\\.|${DO})+`}]},w=[m,y],g="([0-9]_*)+",E="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(ge="")=>({className:"subst",variants:[{match:Tt(/\\/,ge,/[0\\tnr"']/)},{match:Tt(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),N=(ge="")=>({className:"subst",match:Tt(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(ge="")=>({className:"subst",label:"interpol",begin:Tt(/\\/,ge,/\(/),end:/\)/}),A=(ge="")=>({begin:Tt(ge,/"""/),end:Tt(/"""/,ge),contains:[_(ge),N(ge),T(ge)]}),k=(ge="")=>({begin:Tt(ge,/"/),end:Tt(/"/,ge),contains:[_(ge),T(ge)]}),R={className:"string",variants:[A(),A("#"),A("##"),A("###"),k(),k("#"),k("##"),k("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],M={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},B=ge=>{const Le=Tt(ge,/\//),ve=Tt(/\//,ge);return{begin:Le,end:ve,contains:[...I,{scope:"comment",begin:`#(?!.*${ve})`,end:/$/}]}},Y={scope:"regexp",variants:[B("###"),B("##"),B("#"),M]},P={match:Tt(/`/,Ts,/`/)},U={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${gp}+`},L=[P,U,C],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:CW,contains:[...w,b,R]}]}},j={scope:"keyword",match:Tt(/@/,sr(...AW),pc(sr(/\(/,/\s+/)))},S={scope:"meta",match:Tt(/@/,Ts)},H=[O,j,S],V={match:pc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Tt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,gp,"+")},{className:"type",match:Sf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Tt(/\s+&\s+/,pc(Sf)),relevance:0}]},D={begin://,keywords:u,contains:[...r,...d,...H,m,V]};V.contains.push(D);const ne={match:Tt(Ts,/\s*:/),keywords:"_|0",relevance:0},ee={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ne,...r,Y,...d,...p,...w,b,R,...L,...H,V]},re={begin://,keywords:"repeat each",contains:[...r,V]},de={begin:sr(pc(Tt(Ts,/\s*:/)),pc(Tt(Ts,/\s+/,Ts,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ts}]},G={begin:/\(/,end:/\)/,keywords:u,contains:[de,...r,...d,...w,b,R,...H,V,ee],endsParent:!0,illegal:/["']/},W={match:[/(func|macro)/,/\s+/,sr(P.match,Ts,s0)],className:{1:"keyword",3:"title.function"},contains:[re,G,t],illegal:[/\[/,/%/]},oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[re,G,t],illegal:/\[|%/},he={match:[/operator/,/\s+/,s0],className:{1:"keyword",3:"title"}},J={begin:[/precedencegroup/,/\s+/,Sf],className:{1:"keyword",3:"title"},contains:[V],keywords:[...kW,...QT],end:/}/},ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ts,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[re,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Sf},...d],relevance:0}]};for(const ge of R.variants){const Le=ge.contains.find(Ue=>Ue.label==="interpol");Le.keywords=u;const ve=[...d,...p,...w,b,R,...L];Le.contains=[...ve,{begin:/\(/,end:/\)/,contains:["self",...ve]}]}return{name:"Swift",keywords:u,contains:[...r,W,oe,ce,Ce,Ee,he,J,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Y,...d,...p,...w,b,R,...L,...H,V,ee]}}const yp="[A-Za-z$_][0-9A-Za-z$_]*",jO=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],BO=["true","false","null","undefined","NaN","Infinity"],FO=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],UO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$O=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],HO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zO=[].concat($O,FO,UO);function RW(e){const t=e.regex,n=(O,{after:j})=>{const S="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const S=O[0].length+O.index,H=O.input[S];if(H==="<"||H===","){j.ignoreMatch();return}H===">"&&(n(O,{after:S})||j.ignoreMatch());let V;const D=O.input.substring(S);if(V=D.match(/^\s*=/)){j.ignoreMatch();return}if((V=D.match(/^\s+extends\s+/))&&V.index===0){j.ignoreMatch();return}}},o={$pattern:yp,keyword:jO,literal:BO,built_in:zO,"variable.language":HO},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(E,h.contains),N=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...FO,...UO]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,B([...$O,"super","import"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,E,{match:/\$\d+/},f,k,{scope:"attr",match:r+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,M,A,U,{match:/\$[(.]/}]}}function VO(e){const t=e.regex,n=RW(e),r=yp,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:yp,keyword:jO.concat(l),literal:BO,built_in:zO.concat(s),"variable.language":HO},d={className:"meta",begin:"@"+r},f=(y,w,g)=>{const E=y.contains.findIndex(b=>b.label===w);if(E===-1)throw new Error("can not find mode to replace");y.contains.splice(E,1,g)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(y=>y.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,i,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);const m=n.contains.find(y=>y.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function OW(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,o),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function LW(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,a,s,e.QUOTE_STRING_MODE,l,u,o]}}function MW(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,l,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function KO(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,y,i,a],g=[...w];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const DW={arduino:NY,bash:xO,c:kY,cpp:SY,csharp:AY,css:jY,diff:BY,go:FY,graphql:UY,ini:wO,java:$Y,javascript:kO,json:SO,kotlin:WY,less:tW,lua:nW,makefile:IO,markdown:RO,objectivec:rW,perl:sW,php:iW,"php-template":aW,plaintext:oW,python:OO,"python-repl":lW,r:cW,ruby:uW,rust:dW,scss:xW,shell:wW,sql:vW,swift:IW,typescript:VO,vbnet:OW,wasm:LW,xml:MW,yaml:KO};function YO(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&YO(n)}),e}let JT=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function WO(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Oi(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const PW="
",eN=e=>!!e.scope,jW=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class BW{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=WO(t)}openNode(t){if(!eN(t))return;const n=jW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){eN(t)&&(this.buffer+=PW)}value(){return this.buffer}span(t){this.buffer+=``}}const tN=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class JE{constructor(){this.rootNode=tN(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=tN({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{JE._collapse(n)}))}}class FW extends JE{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new BW(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Fu(e){return e?typeof e=="string"?e:e.source:null}function qO(e){return ro("(?=",e,")")}function UW(e){return ro("(?:",e,")*")}function $W(e){return ro("(?:",e,")?")}function ro(...e){return e.map(n=>Fu(n)).join("")}function HW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ex(...e){return"("+(HW(e).capture?"":"?:")+e.map(r=>Fu(r)).join("|")+")"}function GO(e){return new RegExp(e.toString()+"|").exec("").length-1}function zW(e,t){const n=e&&e.exec(t);return n&&n.index===0}const VW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function tx(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Fu(r),a="";for(;i.length>0;){const o=VW.exec(i);if(!o){a+=i;break}a+=i.substring(0,o.index),i=i.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+s):(a+=o[0],o[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const KW=/\b\B/,XO="[a-zA-Z]\\w*",nx="[a-zA-Z_]\\w*",QO="\\b\\d+(\\.\\d+)?",ZO="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",JO="\\b(0b[01]+)",YW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",WW=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=ro(t,/.*\b/,e.binary,/\b.*/)),Oi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Uu={begin:"\\\\[\\s\\S]",relevance:0},qW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Uu]},GW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Uu]},XW={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},wm=function(e,t,n={}){const r=Oi({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=ex("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ro(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},QW=wm("//","$"),ZW=wm("/\\*","\\*/"),JW=wm("#","$"),eq={scope:"number",begin:QO,relevance:0},tq={scope:"number",begin:ZO,relevance:0},nq={scope:"number",begin:JO,relevance:0},rq={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Uu,{begin:/\[/,end:/\]/,relevance:0,contains:[Uu]}]},sq={scope:"title",begin:XO,relevance:0},iq={scope:"title",begin:nx,relevance:0},aq={begin:"\\.\\s*"+nx,relevance:0},oq=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var Af=Object.freeze({__proto__:null,APOS_STRING_MODE:qW,BACKSLASH_ESCAPE:Uu,BINARY_NUMBER_MODE:nq,BINARY_NUMBER_RE:JO,COMMENT:wm,C_BLOCK_COMMENT_MODE:ZW,C_LINE_COMMENT_MODE:QW,C_NUMBER_MODE:tq,C_NUMBER_RE:ZO,END_SAME_AS_BEGIN:oq,HASH_COMMENT_MODE:JW,IDENT_RE:XO,MATCH_NOTHING_RE:KW,METHOD_GUARD:aq,NUMBER_MODE:eq,NUMBER_RE:QO,PHRASAL_WORDS_MODE:XW,QUOTE_STRING_MODE:GW,REGEXP_MODE:rq,RE_STARTERS_RE:YW,SHEBANG:WW,TITLE_MODE:sq,UNDERSCORE_IDENT_RE:nx,UNDERSCORE_TITLE_MODE:iq});function lq(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function cq(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function uq(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=lq,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function dq(e,t){Array.isArray(e.illegal)&&(e.illegal=ex(...e.illegal))}function fq(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function hq(e,t){e.relevance===void 0&&(e.relevance=1)}const pq=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=ro(n.beforeMatch,qO(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},mq=["of","and","for","in","not","or","if","then","parent","list","value"],gq="keyword";function eL(e,t,n=gq){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(i){Object.assign(r,eL(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const l=o.split("|");r[l[0]]=[i,yq(l[0],l[1])]})}}function yq(e,t){return t?Number(t):bq(e)?0:1}function bq(e){return mq.includes(e.toLowerCase())}const nN={},Oa=e=>{console.error(e)},rN=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ho=(e,t)=>{nN[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),nN[`${e}/${t}`]=!0)},bp=new Error;function tL(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let o=1;o<=t.length;o++)a[o+r]=s[o],i[o+r]=!0,r+=GO(t[o-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function Eq(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Oa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),bp;if(typeof e.beginScope!="object"||e.beginScope===null)throw Oa("beginScope must be object"),bp;tL(e,e.begin,{key:"beginScope"}),e.begin=tx(e.begin,{joinWith:""})}}function xq(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Oa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),bp;if(typeof e.endScope!="object"||e.endScope===null)throw Oa("endScope must be object"),bp;tL(e,e.end,{key:"endScope"}),e.end=tx(e.end,{joinWith:""})}}function wq(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function vq(e){wq(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Eq(e),xq(e)}function _q(e){function t(a,o){return new RegExp(Fu(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=GO(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=t(tx(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const u=l.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new n;return this.rules.slice(o).forEach(([u,d])=>l.addRule(u,d)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const o=new r;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function i(a,o){const l=a;if(a.isCompiled)return l;[cq,fq,vq,pq].forEach(d=>d(a,o)),e.compilerExtensions.forEach(d=>d(a,o)),a.__beforeBegin=null,[uq,dq,hq].forEach(d=>d(a,o)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=eL(a.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=Fu(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Tq(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,l)}),a.starts&&i(a.starts,o),l.matcher=s(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Oi(e.classNameAliases||{}),i(e)}function nL(e){return e?e.endsWithParent||nL(e.starts):!1}function Tq(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Oi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:nL(e)?Oi(e,{starts:e.starts?Oi(e.starts):null}):Object.isFrozen(e)?Oi(e):e}var Nq="11.11.1";class kq extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const i0=WO,sN=Oi,iN=Symbol("nomatch"),Sq=7,rL=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:FW};function l(C){return o.noHighlightRe.test(C)}function u(C){let L=C.className+" ";L+=C.parentNode?C.parentNode.className:"";const O=o.languageDetectRe.exec(L);if(O){const j=k(O[1]);return j||(rN(i.replace("{}",O[1])),rN("Falling back to no-highlight mode for this block.",C)),j?O[1]:"no-highlight"}return L.split(/\s+/).find(j=>l(j)||k(j))}function d(C,L,O){let j="",S="";typeof L=="object"?(j=C,O=L.ignoreIllegals,S=L.language):(ho("10.7.0","highlight(lang, code, ...args) has been deprecated."),ho("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),S=C,j=L),O===void 0&&(O=!0);const H={code:j,language:S};P("before:highlight",H);const V=H.result?H.result:f(H.language,H.code,O);return V.code=H.code,P("after:highlight",V),V}function f(C,L,O,j){const S=Object.create(null);function H(K,X){return K.keywords[X]}function V(){if(!ve.keywords){Ie.addText(ae);return}let K=0;ve.keywordPatternRe.lastIndex=0;let X=ve.keywordPatternRe.exec(ae),le="";for(;X;){le+=ae.substring(K,X.index);const Ne=Ee.case_insensitive?X[0].toLowerCase():X[0],Re=H(ve,Ne);if(Re){const[ut,We]=Re;if(Ie.addText(le),le="",S[Ne]=(S[Ne]||0)+1,S[Ne]<=Sq&&(wt+=We),ut.startsWith("_"))le+=X[0];else{const ot=Ee.classNameAliases[ut]||ut;ee(X[0],ot)}}else le+=X[0];K=ve.keywordPatternRe.lastIndex,X=ve.keywordPatternRe.exec(ae)}le+=ae.substring(K),Ie.addText(le)}function D(){if(ae==="")return;let K=null;if(typeof ve.subLanguage=="string"){if(!t[ve.subLanguage]){Ie.addText(ae);return}K=f(ve.subLanguage,ae,!0,Ue[ve.subLanguage]),Ue[ve.subLanguage]=K._top}else K=p(ae,ve.subLanguage.length?ve.subLanguage:null);ve.relevance>0&&(wt+=K.relevance),Ie.__addSublanguage(K._emitter,K.language)}function ne(){ve.subLanguage!=null?D():V(),ae=""}function ee(K,X){K!==""&&(Ie.startScope(X),Ie.addText(K),Ie.endScope())}function re(K,X){let le=1;const Ne=X.length-1;for(;le<=Ne;){if(!K._emit[le]){le++;continue}const Re=Ee.classNameAliases[K[le]]||K[le],ut=X[le];Re?ee(ut,Re):(ae=ut,V(),ae=""),le++}}function de(K,X){return K.scope&&typeof K.scope=="string"&&Ie.openNode(Ee.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(ee(ae,Ee.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),ae=""):K.beginScope._multi&&(re(K.beginScope,X),ae="")),ve=Object.create(K,{parent:{value:ve}}),ve}function G(K,X,le){let Ne=zW(K.endRe,le);if(Ne){if(K["on:end"]){const Re=new JT(K);K["on:end"](X,Re),Re.isMatchIgnored&&(Ne=!1)}if(Ne){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return G(K.parent,X,le)}function W(K){return ve.matcher.regexIndex===0?(ae+=K[0],1):(ct=!0,0)}function oe(K){const X=K[0],le=K.rule,Ne=new JT(le),Re=[le.__beforeBegin,le["on:begin"]];for(const ut of Re)if(ut&&(ut(K,Ne),Ne.isMatchIgnored))return W(X);return le.skip?ae+=X:(le.excludeBegin&&(ae+=X),ne(),!le.returnBegin&&!le.excludeBegin&&(ae=X)),de(le,K),le.returnBegin?0:X.length}function he(K){const X=K[0],le=L.substring(K.index),Ne=G(ve,K,le);if(!Ne)return iN;const Re=ve;ve.endScope&&ve.endScope._wrap?(ne(),ee(X,ve.endScope._wrap)):ve.endScope&&ve.endScope._multi?(ne(),re(ve.endScope,K)):Re.skip?ae+=X:(Re.returnEnd||Re.excludeEnd||(ae+=X),ne(),Re.excludeEnd&&(ae=X));do ve.scope&&Ie.closeNode(),!ve.skip&&!ve.subLanguage&&(wt+=ve.relevance),ve=ve.parent;while(ve!==Ne.parent);return Ne.starts&&de(Ne.starts,K),Re.returnEnd?0:X.length}function J(){const K=[];for(let X=ve;X!==Ee;X=X.parent)X.scope&&K.unshift(X.scope);K.forEach(X=>Ie.openNode(X))}let ce={};function Ce(K,X){const le=X&&X[0];if(ae+=K,le==null)return ne(),0;if(ce.type==="begin"&&X.type==="end"&&ce.index===X.index&&le===""){if(ae+=L.slice(X.index,X.index+1),!s){const Ne=new Error(`0 width match regex (${C})`);throw Ne.languageName=C,Ne.badRule=ce.rule,Ne}return 1}if(ce=X,X.type==="begin")return oe(X);if(X.type==="illegal"&&!O){const Ne=new Error('Illegal lexeme "'+le+'" for mode "'+(ve.scope||"")+'"');throw Ne.mode=ve,Ne}else if(X.type==="end"){const Ne=he(X);if(Ne!==iN)return Ne}if(X.type==="illegal"&&le==="")return ae+=` -`,1;if(vt>1e5&&vt>X.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ae+=le,le.length}const Ee=k(C);if(!Ee)throw Oa(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const ge=_q(Ee);let Le="",ve=j||ge;const Ue={},Ie=new o.__emitter(o);J();let ae="",wt=0,we=0,vt=0,ct=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(L,Ie);else{for(ve.matcher.considerAll();;){vt++,ct?ct=!1:ve.matcher.considerAll(),ve.matcher.lastIndex=we;const K=ve.matcher.exec(L);if(!K)break;const X=L.substring(we,K.index),le=Ce(X,K);we=K.index+le}Ce(L.substring(we))}return Ie.finalize(),Le=Ie.toHTML(),{language:C,value:Le,relevance:wt,illegal:!1,_emitter:Ie,_top:ve}}catch(K){if(K.message&&K.message.includes("Illegal"))return{language:C,value:i0(L),illegal:!0,relevance:0,_illegalBy:{message:K.message,index:we,context:L.slice(we-100,we+100),mode:K.mode,resultSoFar:Le},_emitter:Ie};if(s)return{language:C,value:i0(L),illegal:!1,relevance:0,errorRaised:K,_emitter:Ie,_top:ve};throw K}}function h(C){const L={value:i0(C),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return L._emitter.addText(C),L}function p(C,L){L=L||o.languages||Object.keys(t);const O=h(C),j=L.filter(k).filter(I).map(ne=>f(ne,C,!1));j.unshift(O);const S=j.sort((ne,ee)=>{if(ne.relevance!==ee.relevance)return ee.relevance-ne.relevance;if(ne.language&&ee.language){if(k(ne.language).supersetOf===ee.language)return 1;if(k(ee.language).supersetOf===ne.language)return-1}return 0}),[H,V]=S,D=H;return D.secondBest=V,D}function m(C,L,O){const j=L&&n[L]||O;C.classList.add("hljs"),C.classList.add(`language-${j}`)}function y(C){let L=null;const O=u(C);if(l(O))return;if(P("before:highlightElement",{el:C,language:O}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),o.throwUnescapedHTML))throw new kq("One of your code blocks includes unescaped HTML.",C.innerHTML);L=C;const j=L.textContent,S=O?d(j,{language:O,ignoreIllegals:!0}):p(j);C.innerHTML=S.value,C.dataset.highlighted="yes",m(C,O,S.language),C.result={language:S.language,re:S.relevance,relevance:S.relevance},S.secondBest&&(C.secondBest={language:S.secondBest.language,relevance:S.secondBest.relevance}),P("after:highlightElement",{el:C,result:S,text:j})}function w(C){o=sN(o,C)}const g=()=>{_(),ho("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){_(),ho("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function _(){function C(){_()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",C,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(y)}function N(C,L){let O=null;try{O=L(e)}catch(j){if(Oa("Language definition for '{}' could not be registered.".replace("{}",C)),s)Oa(j);else throw j;O=a}O.name||(O.name=C),t[C]=O,O.rawDefinition=L.bind(null,e),O.aliases&&R(O.aliases,{languageName:C})}function T(C){delete t[C];for(const L of Object.keys(n))n[L]===C&&delete n[L]}function A(){return Object.keys(t)}function k(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:L}){typeof C=="string"&&(C=[C]),C.forEach(O=>{n[O.toLowerCase()]=L})}function I(C){const L=k(C);return L&&!L.disableAutodetect}function M(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=L=>{C["before:highlightBlock"](Object.assign({block:L.el},L))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=L=>{C["after:highlightBlock"](Object.assign({block:L.el},L))})}function B(C){M(C),r.push(C)}function Y(C){const L=r.indexOf(C);L!==-1&&r.splice(L,1)}function P(C,L){const O=C;r.forEach(function(j){j[O]&&j[O](L)})}function U(C){return ho("10.7.0","highlightBlock will be removed entirely in v12.0"),ho("10.7.0","Please use highlightElement now."),y(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:y,highlightBlock:U,configure:w,initHighlighting:g,initHighlightingOnLoad:E,registerLanguage:N,unregisterLanguage:T,listLanguages:A,getLanguage:k,registerAliases:R,autoDetection:I,inherit:sN,addPlugin:B,removePlugin:Y}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Nq,e.regex={concat:ro,lookahead:qO,either:ex,optional:$W,anyNumberOfTimes:UW};for(const C in Af)typeof Af[C]=="object"&&YO(Af[C]);return Object.assign(e,Af),e},bl=rL({});bl.newInstance=()=>rL({});var Aq=bl;bl.HighlightJS=bl;bl.default=bl;const wr=td(Aq),aN={},Cq="hljs-";function Iq(e){const t=wr.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:o};function n(l,u,d){const f=d||aN,h=typeof f.prefix=="string"?f.prefix:Cq;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:Rq,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,y=m.data;return y.language=p.language,y.relevance=p.relevance,m}function r(l,u){const f=(u||aN).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let d;for(d in l)Object.hasOwn(l,d)&&t.registerLanguage(d,l[d])}}function a(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let d;for(d in l)if(Object.hasOwn(l,d)){const f=l[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function o(l){return!!t.getLanguage(l)}}class Rq{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],s=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):r.children.push(...s)}openNode(t){const n=this,r=t.split(".").map(function(a,o){return o?a+"_".repeat(o):n.options.classPrefix+a}),s=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Oq={};function oN(e){const t=e||Oq,n=t.aliases,r=t.detect||!1,s=t.languages||DW,i=t.plainText,a=t.prefix,o=t.subset;let l="hljs";const u=Iq(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");l=d===-1?a:a.slice(0,d)}return function(d,f){Ed(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const y=Lq(h);if(y===!1||!y&&!r||y&&i&&i.includes(y))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(l)||h.properties.className.unshift(l);const w=gY(h,{whitespace:"pre"});let g;try{g=y?u.highlight(y,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:o})}catch(E){const b=E;if(y&&/Unknown language/.test(b.message)){f.message("Cannot highlight as `"+y+"`, it’s not registered",{ancestors:[m,h],cause:b,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!y&&g.data&&g.data.language&&h.properties.className.push("language-"+g.data.language),g.children.length>0&&(h.children=g.children)})}}function Lq(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n-1&&i<=t.length){let a=0;for(;;){let o=n[a];if(o===void 0){const l=uN(t,n[a-1]);o=l===-1?t.length+1:l+1,n[a]=o}if(o>i)return{line:a+1,column:i-(a>0?n[a-1]:0)+1,offset:i};a++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length1?n[i.line-2]:0)+i.column-1;if(a=55296&&e<=57343}function iG(e){return e>=56320&&e<=57343}function aG(e,t){return(e-55296)*1024+9216+t}function cL(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function uL(e){return e>=64976&&e<=65007||sG.has(e)}var se;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(se||(se={}));const oG=65536;class lG{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=oG,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:i}=this,a=s+n,o=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(iG(n))return this.pos++,this._addGap(),aG(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,F.EOF;return this._err(se.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;const r=this.html.charCodeAt(n);return r===F.CARRIAGE_RETURN?F.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;let t=this.html.charCodeAt(this.pos);return t===F.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,F.LINE_FEED):t===F.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,lL(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===F.LINE_FEED||t===F.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){cL(t)?this._err(se.controlCharacterInInputStream):uL(t)&&this._err(se.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const cG=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),uG=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function dG(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=uG.get(e))!==null&&t!==void 0?t:e}var Ln;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ln||(Ln={}));const fG=32;var Li;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Li||(Li={}));function w1(e){return e>=Ln.ZERO&&e<=Ln.NINE}function hG(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_F||e>=Ln.LOWER_A&&e<=Ln.LOWER_F}function pG(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_Z||e>=Ln.LOWER_A&&e<=Ln.LOWER_Z||w1(e)}function mG(e){return e===Ln.EQUALS||pG(e)}var Rn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Rn||(Rn={}));var qs;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(qs||(qs={}));class gG{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Rn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=qs.Strict}startEntity(t){this.decodeMode=t,this.state=Rn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Rn.EntityStart:return t.charCodeAt(n)===Ln.NUM?(this.state=Rn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Rn.NamedEntity,this.stateNamedEntity(t,n));case Rn.NumericStart:return this.stateNumericStart(t,n);case Rn.NumericDecimal:return this.stateNumericDecimal(t,n);case Rn.NumericHex:return this.stateNumericHex(t,n);case Rn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|fG)===Ln.LOWER_X?(this.state=Rn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Rn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(t.substr(n,i),s),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n>14;for(;n>14,i!==0){if(a===Ln.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==qs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&Li.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~Li.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Rn.NamedEntity:return this.result!==0&&(this.decodeMode!==qs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Rn.NumericDecimal:return this.emitNumericEntity(0,2);case Rn.NumericHex:return this.emitNumericEntity(0,3);case Rn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Rn.EntityStart:return 0}}}function yG(e,t,n,r){const s=(t&Li.BRANCH_LENGTH)>>7,i=t&Li.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=s?-1:e[n+l]-1}let a=n,o=a+s-1;for(;a<=o;){const l=a+o>>>1,u=e[l];if(ur)o=l-1;else return e[l+s]}return-1}var fe;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(fe||(fe={}));var La;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(La||(La={}));var zr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(zr||(zr={}));var Q;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Q||(Q={}));var x;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(x||(x={}));const bG=new Map([[Q.A,x.A],[Q.ADDRESS,x.ADDRESS],[Q.ANNOTATION_XML,x.ANNOTATION_XML],[Q.APPLET,x.APPLET],[Q.AREA,x.AREA],[Q.ARTICLE,x.ARTICLE],[Q.ASIDE,x.ASIDE],[Q.B,x.B],[Q.BASE,x.BASE],[Q.BASEFONT,x.BASEFONT],[Q.BGSOUND,x.BGSOUND],[Q.BIG,x.BIG],[Q.BLOCKQUOTE,x.BLOCKQUOTE],[Q.BODY,x.BODY],[Q.BR,x.BR],[Q.BUTTON,x.BUTTON],[Q.CAPTION,x.CAPTION],[Q.CENTER,x.CENTER],[Q.CODE,x.CODE],[Q.COL,x.COL],[Q.COLGROUP,x.COLGROUP],[Q.DD,x.DD],[Q.DESC,x.DESC],[Q.DETAILS,x.DETAILS],[Q.DIALOG,x.DIALOG],[Q.DIR,x.DIR],[Q.DIV,x.DIV],[Q.DL,x.DL],[Q.DT,x.DT],[Q.EM,x.EM],[Q.EMBED,x.EMBED],[Q.FIELDSET,x.FIELDSET],[Q.FIGCAPTION,x.FIGCAPTION],[Q.FIGURE,x.FIGURE],[Q.FONT,x.FONT],[Q.FOOTER,x.FOOTER],[Q.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[Q.FORM,x.FORM],[Q.FRAME,x.FRAME],[Q.FRAMESET,x.FRAMESET],[Q.H1,x.H1],[Q.H2,x.H2],[Q.H3,x.H3],[Q.H4,x.H4],[Q.H5,x.H5],[Q.H6,x.H6],[Q.HEAD,x.HEAD],[Q.HEADER,x.HEADER],[Q.HGROUP,x.HGROUP],[Q.HR,x.HR],[Q.HTML,x.HTML],[Q.I,x.I],[Q.IMG,x.IMG],[Q.IMAGE,x.IMAGE],[Q.INPUT,x.INPUT],[Q.IFRAME,x.IFRAME],[Q.KEYGEN,x.KEYGEN],[Q.LABEL,x.LABEL],[Q.LI,x.LI],[Q.LINK,x.LINK],[Q.LISTING,x.LISTING],[Q.MAIN,x.MAIN],[Q.MALIGNMARK,x.MALIGNMARK],[Q.MARQUEE,x.MARQUEE],[Q.MATH,x.MATH],[Q.MENU,x.MENU],[Q.META,x.META],[Q.MGLYPH,x.MGLYPH],[Q.MI,x.MI],[Q.MO,x.MO],[Q.MN,x.MN],[Q.MS,x.MS],[Q.MTEXT,x.MTEXT],[Q.NAV,x.NAV],[Q.NOBR,x.NOBR],[Q.NOFRAMES,x.NOFRAMES],[Q.NOEMBED,x.NOEMBED],[Q.NOSCRIPT,x.NOSCRIPT],[Q.OBJECT,x.OBJECT],[Q.OL,x.OL],[Q.OPTGROUP,x.OPTGROUP],[Q.OPTION,x.OPTION],[Q.P,x.P],[Q.PARAM,x.PARAM],[Q.PLAINTEXT,x.PLAINTEXT],[Q.PRE,x.PRE],[Q.RB,x.RB],[Q.RP,x.RP],[Q.RT,x.RT],[Q.RTC,x.RTC],[Q.RUBY,x.RUBY],[Q.S,x.S],[Q.SCRIPT,x.SCRIPT],[Q.SEARCH,x.SEARCH],[Q.SECTION,x.SECTION],[Q.SELECT,x.SELECT],[Q.SOURCE,x.SOURCE],[Q.SMALL,x.SMALL],[Q.SPAN,x.SPAN],[Q.STRIKE,x.STRIKE],[Q.STRONG,x.STRONG],[Q.STYLE,x.STYLE],[Q.SUB,x.SUB],[Q.SUMMARY,x.SUMMARY],[Q.SUP,x.SUP],[Q.TABLE,x.TABLE],[Q.TBODY,x.TBODY],[Q.TEMPLATE,x.TEMPLATE],[Q.TEXTAREA,x.TEXTAREA],[Q.TFOOT,x.TFOOT],[Q.TD,x.TD],[Q.TH,x.TH],[Q.THEAD,x.THEAD],[Q.TITLE,x.TITLE],[Q.TR,x.TR],[Q.TRACK,x.TRACK],[Q.TT,x.TT],[Q.U,x.U],[Q.UL,x.UL],[Q.SVG,x.SVG],[Q.VAR,x.VAR],[Q.WBR,x.WBR],[Q.XMP,x.XMP]]);function zl(e){var t;return(t=bG.get(e))!==null&&t!==void 0?t:x.UNKNOWN}const pe=x,EG={[fe.HTML]:new Set([pe.ADDRESS,pe.APPLET,pe.AREA,pe.ARTICLE,pe.ASIDE,pe.BASE,pe.BASEFONT,pe.BGSOUND,pe.BLOCKQUOTE,pe.BODY,pe.BR,pe.BUTTON,pe.CAPTION,pe.CENTER,pe.COL,pe.COLGROUP,pe.DD,pe.DETAILS,pe.DIR,pe.DIV,pe.DL,pe.DT,pe.EMBED,pe.FIELDSET,pe.FIGCAPTION,pe.FIGURE,pe.FOOTER,pe.FORM,pe.FRAME,pe.FRAMESET,pe.H1,pe.H2,pe.H3,pe.H4,pe.H5,pe.H6,pe.HEAD,pe.HEADER,pe.HGROUP,pe.HR,pe.HTML,pe.IFRAME,pe.IMG,pe.INPUT,pe.LI,pe.LINK,pe.LISTING,pe.MAIN,pe.MARQUEE,pe.MENU,pe.META,pe.NAV,pe.NOEMBED,pe.NOFRAMES,pe.NOSCRIPT,pe.OBJECT,pe.OL,pe.P,pe.PARAM,pe.PLAINTEXT,pe.PRE,pe.SCRIPT,pe.SECTION,pe.SELECT,pe.SOURCE,pe.STYLE,pe.SUMMARY,pe.TABLE,pe.TBODY,pe.TD,pe.TEMPLATE,pe.TEXTAREA,pe.TFOOT,pe.TH,pe.THEAD,pe.TITLE,pe.TR,pe.TRACK,pe.UL,pe.WBR,pe.XMP]),[fe.MATHML]:new Set([pe.MI,pe.MO,pe.MN,pe.MS,pe.MTEXT,pe.ANNOTATION_XML]),[fe.SVG]:new Set([pe.TITLE,pe.FOREIGN_OBJECT,pe.DESC]),[fe.XLINK]:new Set,[fe.XML]:new Set,[fe.XMLNS]:new Set},v1=new Set([pe.H1,pe.H2,pe.H3,pe.H4,pe.H5,pe.H6]);Q.STYLE,Q.SCRIPT,Q.XMP,Q.IFRAME,Q.NOEMBED,Q.NOFRAMES,Q.PLAINTEXT;var $;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})($||($={}));const fn={DATA:$.DATA,RCDATA:$.RCDATA,RAWTEXT:$.RAWTEXT,SCRIPT_DATA:$.SCRIPT_DATA,PLAINTEXT:$.PLAINTEXT,CDATA_SECTION:$.CDATA_SECTION};function xG(e){return e>=F.DIGIT_0&&e<=F.DIGIT_9}function Rc(e){return e>=F.LATIN_CAPITAL_A&&e<=F.LATIN_CAPITAL_Z}function wG(e){return e>=F.LATIN_SMALL_A&&e<=F.LATIN_SMALL_Z}function wi(e){return wG(e)||Rc(e)}function fN(e){return wi(e)||xG(e)}function Cf(e){return e+32}function fL(e){return e===F.SPACE||e===F.LINE_FEED||e===F.TABULATION||e===F.FORM_FEED}function hN(e){return fL(e)||e===F.SOLIDUS||e===F.GREATER_THAN_SIGN}function vG(e){return e===F.NULL?se.nullCharacterReference:e>1114111?se.characterReferenceOutsideUnicodeRange:lL(e)?se.surrogateCharacterReference:uL(e)?se.noncharacterCharacterReference:cL(e)||e===F.CARRIAGE_RETURN?se.controlCharacterReference:null}class _G{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=$.DATA,this.returnState=$.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new lG(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new gG(cG,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(se.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(se.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=vG(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(se.endTagWithAttributes),t.selfClosing&&this._err(se.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case nt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case nt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case nt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:nt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=fL(t)?nt.WHITESPACE_CHARACTER:t===F.NULL?nt.NULL_CHARACTER:nt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(nt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=$.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?qs.Attribute:qs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case $.DATA:{this._stateData(t);break}case $.RCDATA:{this._stateRcdata(t);break}case $.RAWTEXT:{this._stateRawtext(t);break}case $.SCRIPT_DATA:{this._stateScriptData(t);break}case $.PLAINTEXT:{this._statePlaintext(t);break}case $.TAG_OPEN:{this._stateTagOpen(t);break}case $.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case $.TAG_NAME:{this._stateTagName(t);break}case $.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case $.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case $.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case $.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case $.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case $.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case $.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case $.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case $.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case $.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case $.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case $.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case $.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case $.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case $.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case $.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case $.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case $.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case $.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case $.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case $.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case $.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case $.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case $.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case $.BOGUS_COMMENT:{this._stateBogusComment(t);break}case $.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case $.COMMENT_START:{this._stateCommentStart(t);break}case $.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case $.COMMENT:{this._stateComment(t);break}case $.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case $.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case $.COMMENT_END:{this._stateCommentEnd(t);break}case $.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case $.DOCTYPE:{this._stateDoctype(t);break}case $.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case $.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case $.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case $.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case $.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case $.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case $.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case $.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case $.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case $.CDATA_SECTION:{this._stateCdataSection(t);break}case $.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case $.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case $.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.TAG_OPEN;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitCodePoint(t);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case F.AMPERSAND:{this._startCharacterReference();break}case F.LESS_THAN_SIGN:{this.state=$.RCDATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.RAWTEXT_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(wi(t))this._createStartTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case F.EXCLAMATION_MARK:{this.state=$.MARKUP_DECLARATION_OPEN;break}case F.SOLIDUS:{this.state=$.END_TAG_OPEN;break}case F.QUESTION_MARK:{this._err(se.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t);break}case F.EOF:{this._err(se.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(se.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(wi(t))this._createEndTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case F.GREATER_THAN_SIGN:{this._err(se.missingEndTagName),this.state=$.DATA;break}case F.EOF:{this._err(se.eofBeforeTagName),this._emitChars("");break}case F.NULL:{this._err(se.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(Yt);break}case F.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===F.SOLIDUS?this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:wi(t)?(this._emitChars("<"),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){wi(t)?(this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case F.NULL:{this._err(se.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Yt);break}case F.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===F.SOLIDUS?(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(hr.SCRIPT,!1)&&hN(this.preprocessor.peek(hr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==fe.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(AG,fe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(SG,fe.HTML)}clearBackToTableRowContext(){this.clearBackTo(kG,fe.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===x.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===x.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case fe.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case fe.SVG:{if(gN.has(s))return!1;break}case fe.MATHML:{if(mN.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ep)}hasInListItemScope(t){return this.hasInDynamicScope(t,TG)}hasInButtonScope(t){return this.hasInDynamicScope(t,NG)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case fe.HTML:{if(v1.has(n))return!0;if(Ep.has(n))return!1;break}case fe.SVG:{if(gN.has(n))return!1;break}case fe.MATHML:{if(mN.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===fe.HTML)switch(this.tagIDs[n]){case t:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===fe.HTML)switch(this.tagIDs[t]){case x.TBODY:case x.THEAD:case x.TFOOT:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===fe.HTML)switch(this.tagIDs[n]){case t:return!0;case x.OPTION:case x.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&hL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&pN.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&pN.has(this.currentTagId);)this.pop()}}const a0=3;var Ss;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ss||(Ss={}));const yN={type:Ss.Marker};class RG{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let o=0;o[a.name,a.value]));let i=0;for(let a=0;as.get(l.name)===l.value)&&(i+=1,i>=a0&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(yN)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ss.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ss.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(yN);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ss.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ss.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ss.Element&&n.element===t)}}const vi={createDocument(){return{nodeName:"#document",mode:zr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};vi.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(vi.isTextNode(n)){n.value+=t;return}}vi.appendChild(e,vi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&vi.isTextNode(r)?r.value+=t:vi.insertBefore(e,vi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function jG(e){return e.name===pL&&e.publicId===null&&(e.systemId===null||e.systemId===OG)}function BG(e){if(e.name!==pL)return zr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===LG)return zr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),DG.has(n))return zr.QUIRKS;let r=t===null?MG:mL;if(bN(n,r))return zr.QUIRKS;if(r=t===null?gL:PG,bN(n,r))return zr.LIMITED_QUIRKS}return zr.NO_QUIRKS}const EN={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},FG="definitionurl",UG="definitionURL",$G=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),HG=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:fe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:fe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:fe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:fe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:fe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:fe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:fe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:fe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:fe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:fe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:fe.XMLNS}]]),zG=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),VG=new Set([x.B,x.BIG,x.BLOCKQUOTE,x.BODY,x.BR,x.CENTER,x.CODE,x.DD,x.DIV,x.DL,x.DT,x.EM,x.EMBED,x.H1,x.H2,x.H3,x.H4,x.H5,x.H6,x.HEAD,x.HR,x.I,x.IMG,x.LI,x.LISTING,x.MENU,x.META,x.NOBR,x.OL,x.P,x.PRE,x.RUBY,x.S,x.SMALL,x.SPAN,x.STRONG,x.STRIKE,x.SUB,x.SUP,x.TABLE,x.TT,x.U,x.UL,x.VAR]);function KG(e){const t=e.tagID;return t===x.FONT&&e.attrs.some(({name:r})=>r===La.COLOR||r===La.SIZE||r===La.FACE)||VG.has(t)}function yL(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let i,a;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,a=this.fragmentContextID):{current:i,currentTagId:a}=this.openElements,this._setContextModes(i,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===fe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,fe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=z.TEXT}switchToPlaintextParsing(){this.insertionMode=z.TEXT,this.originalInsertionMode=z.IN_BODY,this.tokenizer.state=fn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Q.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==fe.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=fn.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=fn.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=fn.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=fn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,fe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,fe.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Q.HTML,fe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,x.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,a=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:l,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:l,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),i=n.type===nt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===x.SVG&&this.treeAdapter.getTagName(n)===Q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===fe.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===x.MGLYPH||t.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,fe.HTML)}_processToken(t){switch(t.type){case nt.CHARACTER:{this.onCharacter(t);break}case nt.NULL_CHARACTER:{this.onNullCharacter(t);break}case nt.COMMENT:{this.onComment(t);break}case nt.DOCTYPE:{this.onDoctype(t);break}case nt.START_TAG:{this._processStartTag(t);break}case nt.END_TAG:{this.onEndTag(t);break}case nt.EOF:{this.onEof(t);break}case nt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return GG(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Ss.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(x.P),this.openElements.popUntilTagNamePopped(x.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case x.TR:{this.insertionMode=z.IN_ROW;return}case x.TBODY:case x.THEAD:case x.TFOOT:{this.insertionMode=z.IN_TABLE_BODY;return}case x.CAPTION:{this.insertionMode=z.IN_CAPTION;return}case x.COLGROUP:{this.insertionMode=z.IN_COLUMN_GROUP;return}case x.TABLE:{this.insertionMode=z.IN_TABLE;return}case x.BODY:{this.insertionMode=z.IN_BODY;return}case x.FRAMESET:{this.insertionMode=z.IN_FRAMESET;return}case x.SELECT:{this._resetInsertionModeForSelect(t);return}case x.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case x.HTML:{this.insertionMode=this.headElement?z.AFTER_HEAD:z.BEFORE_HEAD;return}case x.TD:case x.TH:{if(t>0){this.insertionMode=z.IN_CELL;return}break}case x.HEAD:{if(t>0){this.insertionMode=z.IN_HEAD;return}break}}this.insertionMode=z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===x.TEMPLATE)break;if(r===x.TABLE){this.insertionMode=z.IN_SELECT_IN_TABLE;return}}this.insertionMode=z.IN_SELECT}_isElementCausesFosterParenting(t){return EL.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case x.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===fe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case x.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return EG[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){CQ(this,t);return}switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:{wL(this,t);break}case z.TEXT:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{o0(this,t);break}case z.IN_TABLE_TEXT:{SL(this,t);break}case z.IN_COLUMN_GROUP:{xp(this,t);break}case z.AFTER_BODY:{wp(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){AQ(this,t);return}switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.TEXT:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{o0(this,t);break}case z.IN_COLUMN_GROUP:{xp(this,t);break}case z.AFTER_BODY:{wp(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){_1(this,t);return}switch(this.insertionMode){case z.INITIAL:case z.BEFORE_HTML:case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_TEMPLATE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{_1(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.AFTER_BODY:{aX(this,t);break}case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{oX(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case z.INITIAL:{lX(this,t);break}case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:{this._err(t,se.misplacedDoctype);break}case z.IN_TABLE_TEXT:{gc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,se.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?IQ(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{cX(this,t);break}case z.BEFORE_HEAD:{dX(this,t);break}case z.IN_HEAD:{bs(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pX(this,t);break}case z.AFTER_HEAD:{gX(this,t);break}case z.IN_BODY:{Jn(this,t);break}case z.IN_TABLE:{El(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_CAPTION:{fQ(this,t);break}case z.IN_COLUMN_GROUP:{lx(this,t);break}case z.IN_TABLE_BODY:{Tm(this,t);break}case z.IN_ROW:{Nm(this,t);break}case z.IN_CELL:{mQ(this,t);break}case z.IN_SELECT:{IL(this,t);break}case z.IN_SELECT_IN_TABLE:{yQ(this,t);break}case z.IN_TEMPLATE:{EQ(this,t);break}case z.AFTER_BODY:{wQ(this,t);break}case z.IN_FRAMESET:{vQ(this,t);break}case z.AFTER_FRAMESET:{TQ(this,t);break}case z.AFTER_AFTER_BODY:{kQ(this,t);break}case z.AFTER_AFTER_FRAMESET:{SQ(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?RQ(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{uX(this,t);break}case z.BEFORE_HEAD:{fX(this,t);break}case z.IN_HEAD:{hX(this,t);break}case z.IN_HEAD_NO_SCRIPT:{mX(this,t);break}case z.AFTER_HEAD:{yX(this,t);break}case z.IN_BODY:{_m(this,t);break}case z.TEXT:{nQ(this,t);break}case z.IN_TABLE:{$u(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_CAPTION:{hQ(this,t);break}case z.IN_COLUMN_GROUP:{pQ(this,t);break}case z.IN_TABLE_BODY:{T1(this,t);break}case z.IN_ROW:{CL(this,t);break}case z.IN_CELL:{gQ(this,t);break}case z.IN_SELECT:{RL(this,t);break}case z.IN_SELECT_IN_TABLE:{bQ(this,t);break}case z.IN_TEMPLATE:{xQ(this,t);break}case z.AFTER_BODY:{LL(this,t);break}case z.IN_FRAMESET:{_Q(this,t);break}case z.AFTER_FRAMESET:{NQ(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onEof(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{NL(this,t);break}case z.TEXT:{rQ(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_TEMPLATE:{OL(this,t);break}case z.AFTER_BODY:case z.IN_FRAMESET:case z.AFTER_FRAMESET:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{ox(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===F.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.TEXT:case z.IN_COLUMN_GROUP:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{this._insertCharacters(t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:case z.AFTER_BODY:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{xL(this,t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{o0(this,t);break}case z.IN_TABLE_TEXT:{kL(this,t);break}}}};function eX(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):TL(e,t),n}function tX(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function nX(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,a=s;a!==n;i++,a=s){s=e.openElements.getCommonAncestor(a);const o=e.activeFormattingElements.getElementEntry(a),l=o&&i>=ZG;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=rX(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function rX(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function sX(e,t,n){const r=e.treeAdapter.getTagName(t),s=zl(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===x.TEMPLATE&&i===fe.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function iX(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function ax(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(i);a&&!a.endTag&&e._setEndLocation(i,t)}}}}function lX(e,t){e._setDocumentType(t);const n=t.forceQuirks?zr.QUIRKS:BG(t);jG(t)||e._err(t,se.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=z.BEFORE_HTML}function mc(e,t){e._err(t,se.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,zr.QUIRKS),e.insertionMode=z.BEFORE_HTML,e._processToken(t)}function cX(e,t){t.tagID===x.HTML?(e._insertElement(t,fe.HTML),e.insertionMode=z.BEFORE_HEAD):eu(e,t)}function uX(e,t){const n=t.tagID;(n===x.HTML||n===x.HEAD||n===x.BODY||n===x.BR)&&eu(e,t)}function eu(e,t){e._insertFakeRootElement(),e.insertionMode=z.BEFORE_HEAD,e._processToken(t)}function dX(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.HEAD:{e._insertElement(t,fe.HTML),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD;break}default:tu(e,t)}}function fX(e,t){const n=t.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?tu(e,t):e._err(t,se.endTagWithoutMatchingOpenElement)}function tu(e,t){e._insertFakeElement(Q.HEAD,x.HEAD),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD,e._processToken(t)}function bs(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{e._appendElement(t,fe.HTML),t.ackSelfClosing=!0;break}case x.TITLE:{e._switchToTextParsing(t,fn.RCDATA);break}case x.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,fn.RAWTEXT):(e._insertElement(t,fe.HTML),e.insertionMode=z.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{e._switchToTextParsing(t,fn.RAWTEXT);break}case x.SCRIPT:{e._switchToTextParsing(t,fn.SCRIPT_DATA);break}case x.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(z.IN_TEMPLATE);break}case x.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:nu(e,t)}}function hX(e,t){switch(t.tagID){case x.HEAD:{e.openElements.pop(),e.insertionMode=z.AFTER_HEAD;break}case x.BODY:case x.BR:case x.HTML:{nu(e,t);break}case x.TEMPLATE:{so(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function so(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==x.TEMPLATE&&e._err(t,se.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,se.endTagWithoutMatchingOpenElement)}function nu(e,t){e.openElements.pop(),e.insertionMode=z.AFTER_HEAD,e._processToken(t)}function pX(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BASEFONT:case x.BGSOUND:case x.HEAD:case x.LINK:case x.META:case x.NOFRAMES:case x.STYLE:{bs(e,t);break}case x.NOSCRIPT:{e._err(t,se.nestedNoscriptInHead);break}default:ru(e,t)}}function mX(e,t){switch(t.tagID){case x.NOSCRIPT:{e.openElements.pop(),e.insertionMode=z.IN_HEAD;break}case x.BR:{ru(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function ru(e,t){const n=t.type===nt.EOF?se.openElementsLeftAfterEof:se.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=z.IN_HEAD,e._processToken(t)}function gX(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BODY:{e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=z.IN_BODY;break}case x.FRAMESET:{e._insertElement(t,fe.HTML),e.insertionMode=z.IN_FRAMESET;break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{e._err(t,se.abandonedHeadElementChild),e.openElements.push(e.headElement,x.HEAD),bs(e,t),e.openElements.remove(e.headElement);break}case x.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:su(e,t)}}function yX(e,t){switch(t.tagID){case x.BODY:case x.HTML:case x.BR:{su(e,t);break}case x.TEMPLATE:{so(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function su(e,t){e._insertFakeElement(Q.BODY,x.BODY),e.insertionMode=z.IN_BODY,vm(e,t)}function vm(e,t){switch(t.type){case nt.CHARACTER:{wL(e,t);break}case nt.WHITESPACE_CHARACTER:{xL(e,t);break}case nt.COMMENT:{_1(e,t);break}case nt.START_TAG:{Jn(e,t);break}case nt.END_TAG:{_m(e,t);break}case nt.EOF:{NL(e,t);break}}}function xL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function wL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function bX(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function EX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function xX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_FRAMESET)}function wX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML)}function vX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&v1.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,fe.HTML)}function _X(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function TX(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),n||(e.formElement=e.openElements.current))}function NX(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===x.LI&&s===x.LI||(n===x.DD||n===x.DT)&&(s===x.DD||s===x.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==x.ADDRESS&&s!==x.DIV&&s!==x.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML)}function kX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.tokenizer.state=fn.PLAINTEXT}function SX(e,t){e.openElements.hasInScope(x.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.framesetOk=!1}function AX(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Q.A);n&&(ax(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function CX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function IX(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(x.NOBR)&&(ax(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function RX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function OX(e,t){e.treeAdapter.getDocumentMode(e.document)!==zr.QUIRKS&&e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=z.IN_TABLE}function vL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,fe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function _L(e){const t=dL(e,La.TYPE);return t!=null&&t.toLowerCase()===XG}function LX(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,fe.HTML),_L(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function MX(e,t){e._appendElement(t,fe.HTML),t.ackSelfClosing=!0}function DX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._appendElement(t,fe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function PX(e,t){t.tagName=Q.IMG,t.tagID=x.IMG,vL(e,t)}function jX(e,t){e._insertElement(t,fe.HTML),e.skipNextNewLine=!0,e.tokenizer.state=fn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=z.TEXT}function BX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,fn.RAWTEXT)}function FX(e,t){e.framesetOk=!1,e._switchToTextParsing(t,fn.RAWTEXT)}function vN(e,t){e._switchToTextParsing(t,fn.RAWTEXT)}function UX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===z.IN_TABLE||e.insertionMode===z.IN_CAPTION||e.insertionMode===z.IN_TABLE_BODY||e.insertionMode===z.IN_ROW||e.insertionMode===z.IN_CELL?z.IN_SELECT_IN_TABLE:z.IN_SELECT}function $X(e,t){e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML)}function HX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,fe.HTML)}function zX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(x.RTC),e._insertElement(t,fe.HTML)}function VX(e,t){e._reconstructActiveFormattingElements(),yL(t),ix(t),t.selfClosing?e._appendElement(t,fe.MATHML):e._insertElement(t,fe.MATHML),t.ackSelfClosing=!0}function KX(e,t){e._reconstructActiveFormattingElements(),bL(t),ix(t),t.selfClosing?e._appendElement(t,fe.SVG):e._insertElement(t,fe.SVG),t.ackSelfClosing=!0}function _N(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML)}function Jn(e,t){switch(t.tagID){case x.I:case x.S:case x.B:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.SMALL:case x.STRIKE:case x.STRONG:{CX(e,t);break}case x.A:{AX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{vX(e,t);break}case x.P:case x.DL:case x.OL:case x.UL:case x.DIV:case x.DIR:case x.NAV:case x.MAIN:case x.MENU:case x.ASIDE:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.DETAILS:case x.ADDRESS:case x.ARTICLE:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{wX(e,t);break}case x.LI:case x.DD:case x.DT:{NX(e,t);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{vL(e,t);break}case x.HR:{DX(e,t);break}case x.RB:case x.RTC:{HX(e,t);break}case x.RT:case x.RP:{zX(e,t);break}case x.PRE:case x.LISTING:{_X(e,t);break}case x.XMP:{BX(e,t);break}case x.SVG:{KX(e,t);break}case x.HTML:{bX(e,t);break}case x.BASE:case x.LINK:case x.META:case x.STYLE:case x.TITLE:case x.SCRIPT:case x.BGSOUND:case x.BASEFONT:case x.TEMPLATE:{bs(e,t);break}case x.BODY:{EX(e,t);break}case x.FORM:{TX(e,t);break}case x.NOBR:{IX(e,t);break}case x.MATH:{VX(e,t);break}case x.TABLE:{OX(e,t);break}case x.INPUT:{LX(e,t);break}case x.PARAM:case x.TRACK:case x.SOURCE:{MX(e,t);break}case x.IMAGE:{PX(e,t);break}case x.BUTTON:{SX(e,t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{RX(e,t);break}case x.IFRAME:{FX(e,t);break}case x.SELECT:{UX(e,t);break}case x.OPTION:case x.OPTGROUP:{$X(e,t);break}case x.NOEMBED:case x.NOFRAMES:{vN(e,t);break}case x.FRAMESET:{xX(e,t);break}case x.TEXTAREA:{jX(e,t);break}case x.NOSCRIPT:{e.options.scriptingEnabled?vN(e,t):_N(e,t);break}case x.PLAINTEXT:{kX(e,t);break}case x.COL:case x.TH:case x.TD:case x.TR:case x.HEAD:case x.FRAME:case x.TBODY:case x.TFOOT:case x.THEAD:case x.CAPTION:case x.COLGROUP:break;default:_N(e,t)}}function YX(e,t){if(e.openElements.hasInScope(x.BODY)&&(e.insertionMode=z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function WX(e,t){e.openElements.hasInScope(x.BODY)&&(e.insertionMode=z.AFTER_BODY,LL(e,t))}function qX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function GX(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(x.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(x.FORM):n&&e.openElements.remove(n))}function XX(e){e.openElements.hasInButtonScope(x.P)||e._insertFakeElement(Q.P,x.P),e._closePElement()}function QX(e){e.openElements.hasInListItemScope(x.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(x.LI),e.openElements.popUntilTagNamePopped(x.LI))}function ZX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function JX(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function eQ(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function tQ(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Q.BR,x.BR),e.openElements.pop(),e.framesetOk=!1}function TL(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const i=e.openElements.items[s],a=e.openElements.tagIDs[s];if(r===a&&(r!==x.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,a))break}}function _m(e,t){switch(t.tagID){case x.A:case x.B:case x.I:case x.S:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.NOBR:case x.SMALL:case x.STRIKE:case x.STRONG:{ax(e,t);break}case x.P:{XX(e);break}case x.DL:case x.UL:case x.OL:case x.DIR:case x.DIV:case x.NAV:case x.PRE:case x.MAIN:case x.MENU:case x.ASIDE:case x.BUTTON:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.ADDRESS:case x.ARTICLE:case x.DETAILS:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.LISTING:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{qX(e,t);break}case x.LI:{QX(e);break}case x.DD:case x.DT:{ZX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{JX(e);break}case x.BR:{tQ(e);break}case x.BODY:{YX(e,t);break}case x.HTML:{WX(e,t);break}case x.FORM:{GX(e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{eQ(e,t);break}case x.TEMPLATE:{so(e,t);break}default:TL(e,t)}}function NL(e,t){e.tmplInsertionModeStack.length>0?OL(e,t):ox(e,t)}function nQ(e,t){var n;t.tagID===x.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function rQ(e,t){e._err(t,se.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function o0(e,t){if(e.openElements.currentTagId!==void 0&&EL.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=z.IN_TABLE_TEXT,t.type){case nt.CHARACTER:{SL(e,t);break}case nt.WHITESPACE_CHARACTER:{kL(e,t);break}}else wd(e,t)}function sQ(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_CAPTION}function iQ(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_COLUMN_GROUP}function aQ(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.COLGROUP,x.COLGROUP),e.insertionMode=z.IN_COLUMN_GROUP,lx(e,t)}function oQ(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_TABLE_BODY}function lQ(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.TBODY,x.TBODY),e.insertionMode=z.IN_TABLE_BODY,Tm(e,t)}function cQ(e,t){e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function uQ(e,t){_L(t)?e._appendElement(t,fe.HTML):wd(e,t),t.ackSelfClosing=!0}function dQ(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,fe.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function El(e,t){switch(t.tagID){case x.TD:case x.TH:case x.TR:{lQ(e,t);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{bs(e,t);break}case x.COL:{aQ(e,t);break}case x.FORM:{dQ(e,t);break}case x.TABLE:{cQ(e,t);break}case x.TBODY:case x.TFOOT:case x.THEAD:{oQ(e,t);break}case x.INPUT:{uQ(e,t);break}case x.CAPTION:{sQ(e,t);break}case x.COLGROUP:{iQ(e,t);break}default:wd(e,t)}}function $u(e,t){switch(t.tagID){case x.TABLE:{e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode());break}case x.TEMPLATE:{so(e,t);break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:wd(e,t)}}function wd(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,vm(e,t),e.fosterParentingEnabled=n}function kL(e,t){e.pendingCharacterTokens.push(t)}function SL(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function gc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===x.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===x.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop();break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop();break}case x.SELECT:{e.openElements.hasInSelectScope(x.SELECT)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode());break}case x.TEMPLATE:{so(e,t);break}}}function yQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e._processStartTag(t)):IL(e,t)}function bQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e.onEndTag(t)):RL(e,t)}function EQ(e,t){switch(t.tagID){case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{bs(e,t);break}case x.CAPTION:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{e.tmplInsertionModeStack[0]=z.IN_TABLE,e.insertionMode=z.IN_TABLE,El(e,t);break}case x.COL:{e.tmplInsertionModeStack[0]=z.IN_COLUMN_GROUP,e.insertionMode=z.IN_COLUMN_GROUP,lx(e,t);break}case x.TR:{e.tmplInsertionModeStack[0]=z.IN_TABLE_BODY,e.insertionMode=z.IN_TABLE_BODY,Tm(e,t);break}case x.TD:case x.TH:{e.tmplInsertionModeStack[0]=z.IN_ROW,e.insertionMode=z.IN_ROW,Nm(e,t);break}default:e.tmplInsertionModeStack[0]=z.IN_BODY,e.insertionMode=z.IN_BODY,Jn(e,t)}}function xQ(e,t){t.tagID===x.TEMPLATE&&so(e,t)}function OL(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ox(e,t)}function wQ(e,t){t.tagID===x.HTML?Jn(e,t):wp(e,t)}function LL(e,t){var n;if(t.tagID===x.HTML){if(e.fragmentContext||(e.insertionMode=z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===x.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else wp(e,t)}function wp(e,t){e.insertionMode=z.IN_BODY,vm(e,t)}function vQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.FRAMESET:{e._insertElement(t,fe.HTML);break}case x.FRAME:{e._appendElement(t,fe.HTML),t.ackSelfClosing=!0;break}case x.NOFRAMES:{bs(e,t);break}}}function _Q(e,t){t.tagID===x.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==x.FRAMESET&&(e.insertionMode=z.AFTER_FRAMESET))}function TQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.NOFRAMES:{bs(e,t);break}}}function NQ(e,t){t.tagID===x.HTML&&(e.insertionMode=z.AFTER_AFTER_FRAMESET)}function kQ(e,t){t.tagID===x.HTML?Jn(e,t):mh(e,t)}function mh(e,t){e.insertionMode=z.IN_BODY,vm(e,t)}function SQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.NOFRAMES:{bs(e,t);break}}}function AQ(e,t){t.chars=Yt,e._insertCharacters(t)}function CQ(e,t){e._insertCharacters(t),e.framesetOk=!1}function ML(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==fe.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function IQ(e,t){if(KG(t))ML(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===fe.MATHML?yL(t):r===fe.SVG&&(YG(t),bL(t)),ix(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function RQ(e,t){if(t.tagID===x.P||t.tagID===x.BR){ML(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===fe.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}Q.AREA,Q.BASE,Q.BASEFONT,Q.BGSOUND,Q.BR,Q.COL,Q.EMBED,Q.FRAME,Q.HR,Q.IMG,Q.INPUT,Q.KEYGEN,Q.LINK,Q.META,Q.PARAM,Q.SOURCE,Q.TRACK,Q.WBR;const OQ=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,LQ=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),TN={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function DL(e,t){const n=zQ(e),r=XR("type",{handlers:{root:MQ,element:DQ,text:PQ,comment:jL,doctype:jQ,raw:FQ},unknown:UQ}),s={parser:n?new wN(TN):wN.getFragmentParser(void 0,TN),handle(o){r(o,s)},stitches:!1,options:t||{}};r(e,s),Vl(s,Fs());const i=n?s.parser.document:s.parser.getFragment(),a=Vq(i,{file:s.options.file});return s.stitches&&Ed(a,"comment",function(o,l,u){const d=o;if(d.value.stitch&&u&&l!==void 0){const f=u.children;return f[l]=d.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function PL(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:nt.CHARACTER,chars:e.value,location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function jQ(e,t){const n={type:nt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function BQ(e,t){t.stitches=!0;const n=VQ(e);if("children"in e&&"children"in n){const r=DL({type:"root",children:e.children},t.options);n.children=r.children}jL({type:"comment",value:{stitch:n}},t)}function jL(e,t){const n=e.value,r={type:nt.COMMENT,data:n,location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function FQ(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,BL(t,Fs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(OQ,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function UQ(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))BQ(n,t);else{let r="";throw LQ.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Vl(e,t){BL(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=fn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function BL(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function $Q(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===fn.PLAINTEXT)return;Vl(t,Fs(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Ta.html;s===Ta.html&&n==="svg"&&(s=Ta.svg);const i=Gq({...e,children:[]},{space:s===Ta.svg?"svg":"html"}),a={type:nt.START_TAG,tagName:n,tagID:zl(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:vd(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function HQ(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&rG.includes(n)||t.parser.tokenizer.state===fn.PLAINTEXT)return;Vl(t,gm(e));const r={type:nt.END_TAG,tagName:n,tagID:zl(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:vd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===fn.RCDATA||t.parser.tokenizer.state===fn.RAWTEXT||t.parser.tokenizer.state===fn.SCRIPT_DATA)&&(t.parser.tokenizer.state=fn.DATA)}function zQ(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function vd(e){const t=Fs(e)||{line:void 0,column:void 0,offset:void 0},n=gm(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function VQ(e){return"children"in e?yl({...e,children:[]}):yl(e)}function KQ(e){return function(t,n){return DL(t,{...e,file:n})}}const FL=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function UL(e){if(!e)return!1;try{const t=e.toLowerCase();return FL.some(n=>t.includes(n))}catch{return!1}}function YQ(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(UL(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const s=n.map(i=>(i==null?void 0:i.value)||"").join("").toLowerCase();return FL.some(i=>s.includes(i))}return!1}function WQ({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=v.useState(null),i=(l,u)=>{if(l.src)return l.src;if(u){const d=h=>{var p;if(!h)return null;if(h.type==="source"&&((p=h.properties)!=null&&p.src))return h.properties.src;if(h.children)for(const m of h.children){const y=d(m);if(y)return y}return null},f=d({children:u});if(f)return f}return""},a=l=>{try{const d=new URL(l).pathname.split("/");return d[d.length-1]||"video.mp4"}catch{return"video.mp4"}},o=l=>l?Array.isArray(l)?l.map(u=>(u==null?void 0:u.value)||"").join("")||"video":(l==null?void 0:l.value)||"video":"video";return c.jsxs("div",{className:t?`md ${t}`:"md",children:[c.jsx(Xz,{remarkPlugins:[cY],rehypePlugins:n?[KQ,oN]:[oN],components:{a:({node:l,...u})=>{const d=u.href;if(d&&(UL(d)||YQ(l))){const f=d,h=o(l==null?void 0:l.children);return c.jsxs("div",{className:"video-container",children:[c.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[c.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),c.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]}),c.jsx("div",{className:"video-caption",children:c.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return c.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:l,src:u,alt:d,...f})=>{const h=c.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?c.jsx(yI,{src:u,children:c.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,c.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]})}):h},video:({node:l,src:u,children:d,...f})=>{const h=i({src:u},d);return h?c.jsx("div",{className:"video-container",children:c.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[c.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),c.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]})}):c.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&c.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:c.jsxs("div",{className:"video-viewer",onClick:l=>l.stopPropagation(),children:[c.jsxs("div",{className:"video-viewer-header",children:[c.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),c.jsxs("nav",{className:"video-viewer-nav",children:[c.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:c.jsx(NE,{})}),c.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:c.jsx(Xr,{})})]})]}),c.jsx("div",{className:"video-viewer-body",children:c.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const _d=v.memo(WQ),NN=6,kN=7,qQ={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function N1(e){return qQ[(e||"").trim().toLowerCase()]||"未知"}function SN(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)?"is-positive":["creating","pending","running","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function GQ(e){if(!e)return"";const t=e.trim(),n=Number(t),r=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function XQ(e){const t=e.replace(/\r\n/g,` +`))}function l(p,m,y,w){const g=y.enter("tableCell"),E=y.enter("phrasing"),b=y.containerPhrasing(p,{...w,before:i,after:i});return E(),g(),b}function u(p,m){return jV(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,y){const w=p.children;let g=-1;const E=[],b=m.enter("table");for(;++g0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const $K={tokenize:GK,partial:!0};function HK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:YK,continuation:{tokenize:WK},exit:qK}},text:{91:{name:"gfmFootnoteCall",tokenize:KK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zK,resolveTo:VK}}}}function zK(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=fs(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function VK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function KK(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!a||f===null||f===91||At(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(fs(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return At(f)||(a=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function YK(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(a>999||m===93&&!o||m===null||m===91||At(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return i=fs(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return At(m)||(o=!0),a++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(i)||s.push(i),dt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function WK(e,t,n){return e.check(yd,t,e.attempt($K,t,n))}function qK(e){e.exit("gfmFootnoteDefinition")}function GK(e,t,n){const r=this;return dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function XK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(m):(a.consume(m),f++,p);if(f<2&&!n)return l(m);const w=a.exit("strikethroughSequenceTemporary"),g=gl(m);return w._open=!g||g===2&&!!y,w._close=!y||y===2&&!!g,o(m)}}}class QK{constructor(){this.map=[]}add(t,n,r){ZK(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function ZK(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const P=r.events[M][1].type;if(P==="lineEnding"||P==="linePrefix")M--;else break}const B=M>-1?r.events[M][1].type:null,Y=B==="tableHead"||B==="tableRow"?T:l;return Y===T&&r.parser.lazy[r.now().line]?n(I):Y(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):Be(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):it(I)?dt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||At(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,it(I)?dt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):k(I)}function y(I){return it(I)?dt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),g):I===45?(i+=1,g(I)):I===null||Be(I)?_(I):k(I)}function g(I){return I===45?(e.enter("tableDelimiterFiller"),E(I)):k(I)}function E(I){return I===45?(e.consume(I),E):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(I))}function b(I){return it(I)?dt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||Be(I)?!a||s!==i?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function T(I){return e.enter("tableRow"),A(I)}function A(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),A):I===null||Be(I)?(e.exit("tableRow"),t(I)):it(I)?dt(e,A,"whitespace")(I):(e.enter("data"),N(I))}function N(I){return I===null||I===124||At(I)?(e.exit("data"),A(I)):(e.consume(I),I===92?R:N)}function R(I){return I===92||I===124?(e.consume(I),N):N(I)}}function nY(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,d,f;const h=new QK;for(;++nn[2]+1){const m=n[2]+1,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},bo(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function HT(e,t,n,r,s){const i=[],a=bo(t.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function bo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const rY={name:"tasklistCheck",tokenize:iY};function sY(){return{text:{91:rY}}}function iY(e,t,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return At(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Be(l)?t(l):it(l)?e.check({tokenize:aY},t,n)(l):n(l)}}function aY(e,t,n){return dt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function oY(e){return TR([OK(),HK(),XK(e),eY(),sY()])}const lY={};function cY(e){const t=this,n=e||lY,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(oY(n)),i.push(AK()),a.push(CK(n))}const zT=function(e,t,n){const r=bd(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&l.push(` +`.repeat(u)||" "),u=-1,l.push(d))}return l.join("")}function yO(e,t,n){return e.type==="element"?yY(e,t,n):e.type==="text"?n.whitespace==="normal"?bO(e,n):bY(e):[]}function yY(e,t,n){const r=EO(e,n),s=e.children||[];let i=-1,a=[];if(mY(e))return a;let o,l;for(b1(e)||WT(e)&&zT(t,e,WT)?l=` +`:pY(e)?(o=2,l=2):gO(e)&&(o=1,l=1);++i]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],y=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[k,f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function kY(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=TY(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function xO(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(o);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],g={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:y,literal:w,built_in:[...E,...b,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,g,o,l,u,d,n]}}function NY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},g=[f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:g.concat([{begin:/\(/,end:/\)/,keywords:w,contains:g.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function SY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],y=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[k,f,o,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function AY(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:t,literal:r},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=e.inherit(h,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[u,y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const CY=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),IY=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],RY=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],OY=[...IY,...RY],LY=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),MY=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),DY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),PY=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function jY(e){const t=e.regex,n=CY(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+MY.join("|")+")"},{begin:":(:)?("+DY.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+PY.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:LY.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+OY.join("|")+")\\b"}]}}function BY(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function FY(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"vO(e,t,n-1))}function $Y(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+vO("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,qT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},qT,u]}}const GT="[A-Za-z$_][0-9A-Za-z$_]*",HY=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zY=["true","false","null","undefined","NaN","Infinity"],_O=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],TO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],kO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],VY=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],KY=[].concat(kO,_O,TO);function NO(e){const t=e.regex,n=(O,{after:j})=>{const S="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const S=O[0].length+O.index,H=O.input[S];if(H==="<"||H===","){j.ignoreMatch();return}H===">"&&(n(O,{after:S})||j.ignoreMatch());let V;const D=O.input.substring(S);if(V=D.match(/^\s*=/)){j.ignoreMatch();return}if((V=D.match(/^\s+extends\s+/))&&V.index===0){j.ignoreMatch();return}}},o={$pattern:GT,keyword:HY,literal:zY,built_in:KY,"variable.language":VY},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(E,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._O,...TO]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,B([...kO,"super","import"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,E,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,M,A,U,{match:/\$[(.]/}]}}function SO(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var xo="[0-9](_*[0-9])*",kf=`\\.(${xo})`,Nf="[0-9a-fA-F](_*[0-9a-fA-F])*",YY={className:"number",variants:[{begin:`(\\b(${xo})((${kf})|\\.)?|(${kf}))[eE][+-]?(${xo})[fFdD]?\\b`},{begin:`\\b(${xo})((${kf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${kf})[fFdD]?\\b`},{begin:`\\b(${xo})[fFdD]\\b`},{begin:`\\b0[xX]((${Nf})\\.?|(${Nf})?\\.(${Nf}))[pP][+-]?(${xo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Nf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function WY(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,s]}]};s.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=YY,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,o,l,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const qY=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),GY=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],XY=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],QY=[...GY,...XY],ZY=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),AO=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),CO=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JY=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),eW=AO.concat(CO).sort().reverse();function tW(e){const t=qY(e),n=eW,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],o=[],l=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},u=function(b,_,k){return{className:b,begin:_,relevance:k}},d={$pattern:/[a-z-]+/,keyword:r,attribute:ZY.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:d,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+s,10),u("variable","@\\{"+s+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JY.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},y={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:o,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+s+"\\}"),{begin:"\\b("+QY.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",i,0),u("selector-id","#"+i),u("selector-class","\\."+i,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+AO.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+CO.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,w,E,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function nW(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function IO(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,l];return[u,d,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,i,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},s,r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rW(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function sW(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,i,l],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(y,w,g="\\1")=>{const E=g==="\\1"?g:t.concat(g,w);return t.concat(t.concat("(?:",y,")"),w,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,g,r)},p=(y,w,g)=>t.concat(t.concat("(?:",y,")"),w,/(?:\\.|[^\\\/])*?/,g,r),m=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:m}}function iW(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(P,U)=>{U.data._beginMatch=P[1]||P[2]},"on:end":(P,U)=>{U.data._beginMatch!==P[1]&&U.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,m={scope:"string",variants:[d,u,f,h]},y={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:g,literal:(P=>{const U=[];return P.forEach(C=>{U.push(C),C.toLowerCase()===C?U.push(C.toUpperCase()):U.push(C.toLowerCase())}),U})(w),built_in:E},k=P=>P.map(U=>U.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(E).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,N,e.C_BLOCK_COMMENT_MODE,m,y,T]},M={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(g).join("\\b|"),"|",k(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(M);const B=[R,N,e.C_BLOCK_COMMENT_MODE,m,y,T],Y={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},a,M,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",Y,a,N,e.C_BLOCK_COMMENT_MODE,m,y]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,y]}}function aW(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function oW(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function OO(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${r.join("|")}`,y={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,y,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,y,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[y,g,f]}]}}function lW(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function cW(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function uW(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},y={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},T=[f,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);d.contains=T,y.contains=T;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:T}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(I).concat(u).concat(T)}}function dW(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:o,literal:l,built_in:u},illegal:""},i]}}const fW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),hW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],pW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],mW=[...hW,...pW],gW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),yW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),bW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),EW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xW(e){const t=fW(e),n=bW,r=yW,s="@[a-z-]+",i="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+mW.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+EW.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:gW.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function wW(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function vW(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...l].filter(k=>!d.includes(k)),y={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(k){return t.concat(/\b/,t.either(...k.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:E(h),relevance:0};function _(k,{exceptions:T,when:A}={}){const N=A;return T=T||[],k.map(R=>R.match(/\|\d+$/)||T.includes(R)?R:N(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:k=>k.length<3}),literal:i,type:o,built_in:f},contains:[{scope:"type",match:E(a)},b,g,y,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function LO(e){return e?typeof e=="string"?e:e.source:null}function pc(e){return Tt("(?=",e,")")}function Tt(...e){return e.map(n=>LO(n)).join("")}function _W(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function rr(...e){return"("+(_W(e).capture?"":"?:")+e.map(r=>LO(r)).join("|")+")"}const ZE=e=>Tt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),TW=["Protocol","Type"].map(ZE),XT=["init","self"].map(ZE),kW=["Any","Self"],n0=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],QT=["false","nil","true"],NW=["assignment","associativity","higherThan","left","lowerThan","none","right"],SW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ZT=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],MO=rr(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),DO=rr(MO,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),r0=Tt(MO,DO,"*"),PO=rr(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),gp=rr(PO,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ts=Tt(PO,gp,"*"),Sf=Tt(/[A-Z]/,gp,"*"),AW=["attached","autoclosure",Tt(/convention\(/,rr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Tt(/objc\(/,Ts,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],CW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function IW(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,rr(...TW,...XT)],className:{2:"keyword"}},i={match:Tt(/\./,rr(...n0)),relevance:0},a=n0.filter(ge=>typeof ge=="string").concat(["_|0"]),o=n0.filter(ge=>typeof ge!="string").concat(kW).map(ZE),l={variants:[{className:"keyword",match:rr(...o,...XT)}]},u={$pattern:rr(/\b\w+/,/#\w+/),keyword:a.concat(SW),literal:QT},d=[s,i,l],f={match:Tt(/\./,rr(...ZT)),relevance:0},h={className:"built_in",match:Tt(/\b/,rr(...ZT),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},y={className:"operator",relevance:0,variants:[{match:r0},{match:`\\.(\\.|${DO})+`}]},w=[m,y],g="([0-9]_*)+",E="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(ge="")=>({className:"subst",variants:[{match:Tt(/\\/,ge,/[0\\tnr"']/)},{match:Tt(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(ge="")=>({className:"subst",match:Tt(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(ge="")=>({className:"subst",label:"interpol",begin:Tt(/\\/,ge,/\(/),end:/\)/}),A=(ge="")=>({begin:Tt(ge,/"""/),end:Tt(/"""/,ge),contains:[_(ge),k(ge),T(ge)]}),N=(ge="")=>({begin:Tt(ge,/"/),end:Tt(/"/,ge),contains:[_(ge),T(ge)]}),R={className:"string",variants:[A(),A("#"),A("##"),A("###"),N(),N("#"),N("##"),N("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],M={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},B=ge=>{const Le=Tt(ge,/\//),ve=Tt(/\//,ge);return{begin:Le,end:ve,contains:[...I,{scope:"comment",begin:`#(?!.*${ve})`,end:/$/}]}},Y={scope:"regexp",variants:[B("###"),B("##"),B("#"),M]},P={match:Tt(/`/,Ts,/`/)},U={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${gp}+`},L=[P,U,C],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:CW,contains:[...w,b,R]}]}},j={scope:"keyword",match:Tt(/@/,rr(...AW),pc(rr(/\(/,/\s+/)))},S={scope:"meta",match:Tt(/@/,Ts)},H=[O,j,S],V={match:pc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Tt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,gp,"+")},{className:"type",match:Sf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Tt(/\s+&\s+/,pc(Sf)),relevance:0}]},D={begin://,keywords:u,contains:[...r,...d,...H,m,V]};V.contains.push(D);const ne={match:Tt(Ts,/\s*:/),keywords:"_|0",relevance:0},ee={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ne,...r,Y,...d,...p,...w,b,R,...L,...H,V]},re={begin://,keywords:"repeat each",contains:[...r,V]},de={begin:rr(pc(Tt(Ts,/\s*:/)),pc(Tt(Ts,/\s+/,Ts,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ts}]},G={begin:/\(/,end:/\)/,keywords:u,contains:[de,...r,...d,...w,b,R,...H,V,ee],endsParent:!0,illegal:/["']/},W={match:[/(func|macro)/,/\s+/,rr(P.match,Ts,r0)],className:{1:"keyword",3:"title.function"},contains:[re,G,t],illegal:[/\[/,/%/]},oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[re,G,t],illegal:/\[|%/},he={match:[/operator/,/\s+/,r0],className:{1:"keyword",3:"title"}},J={begin:[/precedencegroup/,/\s+/,Sf],className:{1:"keyword",3:"title"},contains:[V],keywords:[...NW,...QT],end:/}/},ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ts,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[re,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Sf},...d],relevance:0}]};for(const ge of R.variants){const Le=ge.contains.find(Ue=>Ue.label==="interpol");Le.keywords=u;const ve=[...d,...p,...w,b,R,...L];Le.contains=[...ve,{begin:/\(/,end:/\)/,contains:["self",...ve]}]}return{name:"Swift",keywords:u,contains:[...r,W,oe,ce,Ce,Ee,he,J,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Y,...d,...p,...w,b,R,...L,...H,V,ee]}}const yp="[A-Za-z$_][0-9A-Za-z$_]*",jO=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],BO=["true","false","null","undefined","NaN","Infinity"],FO=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],UO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$O=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],HO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zO=[].concat($O,FO,UO);function RW(e){const t=e.regex,n=(O,{after:j})=>{const S="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const S=O[0].length+O.index,H=O.input[S];if(H==="<"||H===","){j.ignoreMatch();return}H===">"&&(n(O,{after:S})||j.ignoreMatch());let V;const D=O.input.substring(S);if(V=D.match(/^\s*=/)){j.ignoreMatch();return}if((V=D.match(/^\s+extends\s+/))&&V.index===0){j.ignoreMatch();return}}},o={$pattern:yp,keyword:jO,literal:BO,built_in:zO,"variable.language":HO},l="[0-9](_?[0-9])*",u=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const _=[].concat(E,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...FO,...UO]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,B([...$O,"super","import"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,w,E,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,M,A,U,{match:/\$[(.]/}]}}function VO(e){const t=e.regex,n=RW(e),r=yp,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:yp,keyword:jO.concat(l),literal:BO,built_in:zO.concat(s),"variable.language":HO},d={className:"meta",begin:"@"+r},f=(y,w,g)=>{const E=y.contains.findIndex(b=>b.label===w);if(E===-1)throw new Error("can not find mode to replace");y.contains.splice(E,1,g)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(y=>y.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,i,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);const m=n.contains.find(y=>y.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function OW(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,o),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function LW(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,a,s,e.QUOTE_STRING_MODE,l,u,o]}}function MW(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,l,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function KO(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,y,i,a],g=[...w];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const DW={arduino:kY,bash:xO,c:NY,cpp:SY,csharp:AY,css:jY,diff:BY,go:FY,graphql:UY,ini:wO,java:$Y,javascript:NO,json:SO,kotlin:WY,less:tW,lua:nW,makefile:IO,markdown:RO,objectivec:rW,perl:sW,php:iW,"php-template":aW,plaintext:oW,python:OO,"python-repl":lW,r:cW,ruby:uW,rust:dW,scss:xW,shell:wW,sql:vW,swift:IW,typescript:VO,vbnet:OW,wasm:LW,xml:MW,yaml:KO};function YO(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&YO(n)}),e}let JT=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function WO(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Oi(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const PW="",ek=e=>!!e.scope,jW=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class BW{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=WO(t)}openNode(t){if(!ek(t))return;const n=jW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){ek(t)&&(this.buffer+=PW)}value(){return this.buffer}span(t){this.buffer+=``}}const tk=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class JE{constructor(){this.rootNode=tk(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=tk({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{JE._collapse(n)}))}}class FW extends JE{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new BW(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Fu(e){return e?typeof e=="string"?e:e.source:null}function qO(e){return ro("(?=",e,")")}function UW(e){return ro("(?:",e,")*")}function $W(e){return ro("(?:",e,")?")}function ro(...e){return e.map(n=>Fu(n)).join("")}function HW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ex(...e){return"("+(HW(e).capture?"":"?:")+e.map(r=>Fu(r)).join("|")+")"}function GO(e){return new RegExp(e.toString()+"|").exec("").length-1}function zW(e,t){const n=e&&e.exec(t);return n&&n.index===0}const VW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function tx(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Fu(r),a="";for(;i.length>0;){const o=VW.exec(i);if(!o){a+=i;break}a+=i.substring(0,o.index),i=i.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+s):(a+=o[0],o[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const KW=/\b\B/,XO="[a-zA-Z]\\w*",nx="[a-zA-Z_]\\w*",QO="\\b\\d+(\\.\\d+)?",ZO="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",JO="\\b(0b[01]+)",YW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",WW=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=ro(t,/.*\b/,e.binary,/\b.*/)),Oi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Uu={begin:"\\\\[\\s\\S]",relevance:0},qW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Uu]},GW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Uu]},XW={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},xm=function(e,t,n={}){const r=Oi({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=ex("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ro(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},QW=xm("//","$"),ZW=xm("/\\*","\\*/"),JW=xm("#","$"),eq={scope:"number",begin:QO,relevance:0},tq={scope:"number",begin:ZO,relevance:0},nq={scope:"number",begin:JO,relevance:0},rq={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Uu,{begin:/\[/,end:/\]/,relevance:0,contains:[Uu]}]},sq={scope:"title",begin:XO,relevance:0},iq={scope:"title",begin:nx,relevance:0},aq={begin:"\\.\\s*"+nx,relevance:0},oq=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var Af=Object.freeze({__proto__:null,APOS_STRING_MODE:qW,BACKSLASH_ESCAPE:Uu,BINARY_NUMBER_MODE:nq,BINARY_NUMBER_RE:JO,COMMENT:xm,C_BLOCK_COMMENT_MODE:ZW,C_LINE_COMMENT_MODE:QW,C_NUMBER_MODE:tq,C_NUMBER_RE:ZO,END_SAME_AS_BEGIN:oq,HASH_COMMENT_MODE:JW,IDENT_RE:XO,MATCH_NOTHING_RE:KW,METHOD_GUARD:aq,NUMBER_MODE:eq,NUMBER_RE:QO,PHRASAL_WORDS_MODE:XW,QUOTE_STRING_MODE:GW,REGEXP_MODE:rq,RE_STARTERS_RE:YW,SHEBANG:WW,TITLE_MODE:sq,UNDERSCORE_IDENT_RE:nx,UNDERSCORE_TITLE_MODE:iq});function lq(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function cq(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function uq(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=lq,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function dq(e,t){Array.isArray(e.illegal)&&(e.illegal=ex(...e.illegal))}function fq(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function hq(e,t){e.relevance===void 0&&(e.relevance=1)}const pq=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=ro(n.beforeMatch,qO(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},mq=["of","and","for","in","not","or","if","then","parent","list","value"],gq="keyword";function eL(e,t,n=gq){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(i){Object.assign(r,eL(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const l=o.split("|");r[l[0]]=[i,yq(l[0],l[1])]})}}function yq(e,t){return t?Number(t):bq(e)?0:1}function bq(e){return mq.includes(e.toLowerCase())}const nk={},Oa=e=>{console.error(e)},rk=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ho=(e,t)=>{nk[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),nk[`${e}/${t}`]=!0)},bp=new Error;function tL(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let o=1;o<=t.length;o++)a[o+r]=s[o],i[o+r]=!0,r+=GO(t[o-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function Eq(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Oa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),bp;if(typeof e.beginScope!="object"||e.beginScope===null)throw Oa("beginScope must be object"),bp;tL(e,e.begin,{key:"beginScope"}),e.begin=tx(e.begin,{joinWith:""})}}function xq(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Oa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),bp;if(typeof e.endScope!="object"||e.endScope===null)throw Oa("endScope must be object"),bp;tL(e,e.end,{key:"endScope"}),e.end=tx(e.end,{joinWith:""})}}function wq(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function vq(e){wq(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Eq(e),xq(e)}function _q(e){function t(a,o){return new RegExp(Fu(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=GO(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=t(tx(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const u=l.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new n;return this.rules.slice(o).forEach(([u,d])=>l.addRule(u,d)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const o=new r;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function i(a,o){const l=a;if(a.isCompiled)return l;[cq,fq,vq,pq].forEach(d=>d(a,o)),e.compilerExtensions.forEach(d=>d(a,o)),a.__beforeBegin=null,[uq,dq,hq].forEach(d=>d(a,o)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=eL(a.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=Fu(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Tq(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,l)}),a.starts&&i(a.starts,o),l.matcher=s(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Oi(e.classNameAliases||{}),i(e)}function nL(e){return e?e.endsWithParent||nL(e.starts):!1}function Tq(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Oi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:nL(e)?Oi(e,{starts:e.starts?Oi(e.starts):null}):Object.isFrozen(e)?Oi(e):e}var kq="11.11.1";class Nq extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const s0=WO,sk=Oi,ik=Symbol("nomatch"),Sq=7,rL=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:FW};function l(C){return o.noHighlightRe.test(C)}function u(C){let L=C.className+" ";L+=C.parentNode?C.parentNode.className:"";const O=o.languageDetectRe.exec(L);if(O){const j=N(O[1]);return j||(rk(i.replace("{}",O[1])),rk("Falling back to no-highlight mode for this block.",C)),j?O[1]:"no-highlight"}return L.split(/\s+/).find(j=>l(j)||N(j))}function d(C,L,O){let j="",S="";typeof L=="object"?(j=C,O=L.ignoreIllegals,S=L.language):(ho("10.7.0","highlight(lang, code, ...args) has been deprecated."),ho("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),S=C,j=L),O===void 0&&(O=!0);const H={code:j,language:S};P("before:highlight",H);const V=H.result?H.result:f(H.language,H.code,O);return V.code=H.code,P("after:highlight",V),V}function f(C,L,O,j){const S=Object.create(null);function H(K,X){return K.keywords[X]}function V(){if(!ve.keywords){Ie.addText(ae);return}let K=0;ve.keywordPatternRe.lastIndex=0;let X=ve.keywordPatternRe.exec(ae),le="";for(;X;){le+=ae.substring(K,X.index);const ke=Ee.case_insensitive?X[0].toLowerCase():X[0],Re=H(ve,ke);if(Re){const[ut,We]=Re;if(Ie.addText(le),le="",S[ke]=(S[ke]||0)+1,S[ke]<=Sq&&(wt+=We),ut.startsWith("_"))le+=X[0];else{const ot=Ee.classNameAliases[ut]||ut;ee(X[0],ot)}}else le+=X[0];K=ve.keywordPatternRe.lastIndex,X=ve.keywordPatternRe.exec(ae)}le+=ae.substring(K),Ie.addText(le)}function D(){if(ae==="")return;let K=null;if(typeof ve.subLanguage=="string"){if(!t[ve.subLanguage]){Ie.addText(ae);return}K=f(ve.subLanguage,ae,!0,Ue[ve.subLanguage]),Ue[ve.subLanguage]=K._top}else K=p(ae,ve.subLanguage.length?ve.subLanguage:null);ve.relevance>0&&(wt+=K.relevance),Ie.__addSublanguage(K._emitter,K.language)}function ne(){ve.subLanguage!=null?D():V(),ae=""}function ee(K,X){K!==""&&(Ie.startScope(X),Ie.addText(K),Ie.endScope())}function re(K,X){let le=1;const ke=X.length-1;for(;le<=ke;){if(!K._emit[le]){le++;continue}const Re=Ee.classNameAliases[K[le]]||K[le],ut=X[le];Re?ee(ut,Re):(ae=ut,V(),ae=""),le++}}function de(K,X){return K.scope&&typeof K.scope=="string"&&Ie.openNode(Ee.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(ee(ae,Ee.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),ae=""):K.beginScope._multi&&(re(K.beginScope,X),ae="")),ve=Object.create(K,{parent:{value:ve}}),ve}function G(K,X,le){let ke=zW(K.endRe,le);if(ke){if(K["on:end"]){const Re=new JT(K);K["on:end"](X,Re),Re.isMatchIgnored&&(ke=!1)}if(ke){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return G(K.parent,X,le)}function W(K){return ve.matcher.regexIndex===0?(ae+=K[0],1):(ct=!0,0)}function oe(K){const X=K[0],le=K.rule,ke=new JT(le),Re=[le.__beforeBegin,le["on:begin"]];for(const ut of Re)if(ut&&(ut(K,ke),ke.isMatchIgnored))return W(X);return le.skip?ae+=X:(le.excludeBegin&&(ae+=X),ne(),!le.returnBegin&&!le.excludeBegin&&(ae=X)),de(le,K),le.returnBegin?0:X.length}function he(K){const X=K[0],le=L.substring(K.index),ke=G(ve,K,le);if(!ke)return ik;const Re=ve;ve.endScope&&ve.endScope._wrap?(ne(),ee(X,ve.endScope._wrap)):ve.endScope&&ve.endScope._multi?(ne(),re(ve.endScope,K)):Re.skip?ae+=X:(Re.returnEnd||Re.excludeEnd||(ae+=X),ne(),Re.excludeEnd&&(ae=X));do ve.scope&&Ie.closeNode(),!ve.skip&&!ve.subLanguage&&(wt+=ve.relevance),ve=ve.parent;while(ve!==ke.parent);return ke.starts&&de(ke.starts,K),Re.returnEnd?0:X.length}function J(){const K=[];for(let X=ve;X!==Ee;X=X.parent)X.scope&&K.unshift(X.scope);K.forEach(X=>Ie.openNode(X))}let ce={};function Ce(K,X){const le=X&&X[0];if(ae+=K,le==null)return ne(),0;if(ce.type==="begin"&&X.type==="end"&&ce.index===X.index&&le===""){if(ae+=L.slice(X.index,X.index+1),!s){const ke=new Error(`0 width match regex (${C})`);throw ke.languageName=C,ke.badRule=ce.rule,ke}return 1}if(ce=X,X.type==="begin")return oe(X);if(X.type==="illegal"&&!O){const ke=new Error('Illegal lexeme "'+le+'" for mode "'+(ve.scope||"")+'"');throw ke.mode=ve,ke}else if(X.type==="end"){const ke=he(X);if(ke!==ik)return ke}if(X.type==="illegal"&&le==="")return ae+=` +`,1;if(vt>1e5&&vt>X.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ae+=le,le.length}const Ee=N(C);if(!Ee)throw Oa(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const ge=_q(Ee);let Le="",ve=j||ge;const Ue={},Ie=new o.__emitter(o);J();let ae="",wt=0,we=0,vt=0,ct=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(L,Ie);else{for(ve.matcher.considerAll();;){vt++,ct?ct=!1:ve.matcher.considerAll(),ve.matcher.lastIndex=we;const K=ve.matcher.exec(L);if(!K)break;const X=L.substring(we,K.index),le=Ce(X,K);we=K.index+le}Ce(L.substring(we))}return Ie.finalize(),Le=Ie.toHTML(),{language:C,value:Le,relevance:wt,illegal:!1,_emitter:Ie,_top:ve}}catch(K){if(K.message&&K.message.includes("Illegal"))return{language:C,value:s0(L),illegal:!0,relevance:0,_illegalBy:{message:K.message,index:we,context:L.slice(we-100,we+100),mode:K.mode,resultSoFar:Le},_emitter:Ie};if(s)return{language:C,value:s0(L),illegal:!1,relevance:0,errorRaised:K,_emitter:Ie,_top:ve};throw K}}function h(C){const L={value:s0(C),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return L._emitter.addText(C),L}function p(C,L){L=L||o.languages||Object.keys(t);const O=h(C),j=L.filter(N).filter(I).map(ne=>f(ne,C,!1));j.unshift(O);const S=j.sort((ne,ee)=>{if(ne.relevance!==ee.relevance)return ee.relevance-ne.relevance;if(ne.language&&ee.language){if(N(ne.language).supersetOf===ee.language)return 1;if(N(ee.language).supersetOf===ne.language)return-1}return 0}),[H,V]=S,D=H;return D.secondBest=V,D}function m(C,L,O){const j=L&&n[L]||O;C.classList.add("hljs"),C.classList.add(`language-${j}`)}function y(C){let L=null;const O=u(C);if(l(O))return;if(P("before:highlightElement",{el:C,language:O}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),o.throwUnescapedHTML))throw new Nq("One of your code blocks includes unescaped HTML.",C.innerHTML);L=C;const j=L.textContent,S=O?d(j,{language:O,ignoreIllegals:!0}):p(j);C.innerHTML=S.value,C.dataset.highlighted="yes",m(C,O,S.language),C.result={language:S.language,re:S.relevance,relevance:S.relevance},S.secondBest&&(C.secondBest={language:S.secondBest.language,relevance:S.secondBest.relevance}),P("after:highlightElement",{el:C,result:S,text:j})}function w(C){o=sk(o,C)}const g=()=>{_(),ho("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){_(),ho("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function _(){function C(){_()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",C,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(y)}function k(C,L){let O=null;try{O=L(e)}catch(j){if(Oa("Language definition for '{}' could not be registered.".replace("{}",C)),s)Oa(j);else throw j;O=a}O.name||(O.name=C),t[C]=O,O.rawDefinition=L.bind(null,e),O.aliases&&R(O.aliases,{languageName:C})}function T(C){delete t[C];for(const L of Object.keys(n))n[L]===C&&delete n[L]}function A(){return Object.keys(t)}function N(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:L}){typeof C=="string"&&(C=[C]),C.forEach(O=>{n[O.toLowerCase()]=L})}function I(C){const L=N(C);return L&&!L.disableAutodetect}function M(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=L=>{C["before:highlightBlock"](Object.assign({block:L.el},L))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=L=>{C["after:highlightBlock"](Object.assign({block:L.el},L))})}function B(C){M(C),r.push(C)}function Y(C){const L=r.indexOf(C);L!==-1&&r.splice(L,1)}function P(C,L){const O=C;r.forEach(function(j){j[O]&&j[O](L)})}function U(C){return ho("10.7.0","highlightBlock will be removed entirely in v12.0"),ho("10.7.0","Please use highlightElement now."),y(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:y,highlightBlock:U,configure:w,initHighlighting:g,initHighlightingOnLoad:E,registerLanguage:k,unregisterLanguage:T,listLanguages:A,getLanguage:N,registerAliases:R,autoDetection:I,inherit:sk,addPlugin:B,removePlugin:Y}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=kq,e.regex={concat:ro,lookahead:qO,either:ex,optional:$W,anyNumberOfTimes:UW};for(const C in Af)typeof Af[C]=="object"&&YO(Af[C]);return Object.assign(e,Af),e},bl=rL({});bl.newInstance=()=>rL({});var Aq=bl;bl.HighlightJS=bl;bl.default=bl;const wr=td(Aq),ak={},Cq="hljs-";function Iq(e){const t=wr.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:o};function n(l,u,d){const f=d||ak,h=typeof f.prefix=="string"?f.prefix:Cq;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:Rq,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,y=m.data;return y.language=p.language,y.relevance=p.relevance,m}function r(l,u){const f=(u||ak).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let d;for(d in l)Object.hasOwn(l,d)&&t.registerLanguage(d,l[d])}}function a(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let d;for(d in l)if(Object.hasOwn(l,d)){const f=l[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function o(l){return!!t.getLanguage(l)}}class Rq{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],s=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):r.children.push(...s)}openNode(t){const n=this,r=t.split(".").map(function(a,o){return o?a+"_".repeat(o):n.options.classPrefix+a}),s=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Oq={};function ok(e){const t=e||Oq,n=t.aliases,r=t.detect||!1,s=t.languages||DW,i=t.plainText,a=t.prefix,o=t.subset;let l="hljs";const u=Iq(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");l=d===-1?a:a.slice(0,d)}return function(d,f){Ed(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const y=Lq(h);if(y===!1||!y&&!r||y&&i&&i.includes(y))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(l)||h.properties.className.unshift(l);const w=gY(h,{whitespace:"pre"});let g;try{g=y?u.highlight(y,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:o})}catch(E){const b=E;if(y&&/Unknown language/.test(b.message)){f.message("Cannot highlight as `"+y+"`, it’s not registered",{ancestors:[m,h],cause:b,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!y&&g.data&&g.data.language&&h.properties.className.push("language-"+g.data.language),g.children.length>0&&(h.children=g.children)})}}function Lq(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n-1&&i<=t.length){let a=0;for(;;){let o=n[a];if(o===void 0){const l=uk(t,n[a-1]);o=l===-1?t.length+1:l+1,n[a]=o}if(o>i)return{line:a+1,column:i-(a>0?n[a-1]:0)+1,offset:i};a++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length1?n[i.line-2]:0)+i.column-1;if(a=55296&&e<=57343}function iG(e){return e>=56320&&e<=57343}function aG(e,t){return(e-55296)*1024+9216+t}function cL(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function uL(e){return e>=64976&&e<=65007||sG.has(e)}var se;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(se||(se={}));const oG=65536;class lG{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=oG,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:i}=this,a=s+n,o=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(iG(n))return this.pos++,this._addGap(),aG(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,F.EOF;return this._err(se.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;const r=this.html.charCodeAt(n);return r===F.CARRIAGE_RETURN?F.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;let t=this.html.charCodeAt(this.pos);return t===F.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,F.LINE_FEED):t===F.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,lL(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===F.LINE_FEED||t===F.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){cL(t)?this._err(se.controlCharacterInInputStream):uL(t)&&this._err(se.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const cG=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),uG=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function dG(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=uG.get(e))!==null&&t!==void 0?t:e}var Ln;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ln||(Ln={}));const fG=32;var Li;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Li||(Li={}));function x1(e){return e>=Ln.ZERO&&e<=Ln.NINE}function hG(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_F||e>=Ln.LOWER_A&&e<=Ln.LOWER_F}function pG(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_Z||e>=Ln.LOWER_A&&e<=Ln.LOWER_Z||x1(e)}function mG(e){return e===Ln.EQUALS||pG(e)}var Rn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Rn||(Rn={}));var qs;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(qs||(qs={}));class gG{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Rn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=qs.Strict}startEntity(t){this.decodeMode=t,this.state=Rn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Rn.EntityStart:return t.charCodeAt(n)===Ln.NUM?(this.state=Rn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Rn.NamedEntity,this.stateNamedEntity(t,n));case Rn.NumericStart:return this.stateNumericStart(t,n);case Rn.NumericDecimal:return this.stateNumericDecimal(t,n);case Rn.NumericHex:return this.stateNumericHex(t,n);case Rn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|fG)===Ln.LOWER_X?(this.state=Rn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Rn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(t.substr(n,i),s),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n>14;for(;n>14,i!==0){if(a===Ln.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==qs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&Li.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~Li.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Rn.NamedEntity:return this.result!==0&&(this.decodeMode!==qs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Rn.NumericDecimal:return this.emitNumericEntity(0,2);case Rn.NumericHex:return this.emitNumericEntity(0,3);case Rn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Rn.EntityStart:return 0}}}function yG(e,t,n,r){const s=(t&Li.BRANCH_LENGTH)>>7,i=t&Li.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=s?-1:e[n+l]-1}let a=n,o=a+s-1;for(;a<=o;){const l=a+o>>>1,u=e[l];if(ur)o=l-1;else return e[l+s]}return-1}var fe;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(fe||(fe={}));var La;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(La||(La={}));var zr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(zr||(zr={}));var Q;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Q||(Q={}));var x;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(x||(x={}));const bG=new Map([[Q.A,x.A],[Q.ADDRESS,x.ADDRESS],[Q.ANNOTATION_XML,x.ANNOTATION_XML],[Q.APPLET,x.APPLET],[Q.AREA,x.AREA],[Q.ARTICLE,x.ARTICLE],[Q.ASIDE,x.ASIDE],[Q.B,x.B],[Q.BASE,x.BASE],[Q.BASEFONT,x.BASEFONT],[Q.BGSOUND,x.BGSOUND],[Q.BIG,x.BIG],[Q.BLOCKQUOTE,x.BLOCKQUOTE],[Q.BODY,x.BODY],[Q.BR,x.BR],[Q.BUTTON,x.BUTTON],[Q.CAPTION,x.CAPTION],[Q.CENTER,x.CENTER],[Q.CODE,x.CODE],[Q.COL,x.COL],[Q.COLGROUP,x.COLGROUP],[Q.DD,x.DD],[Q.DESC,x.DESC],[Q.DETAILS,x.DETAILS],[Q.DIALOG,x.DIALOG],[Q.DIR,x.DIR],[Q.DIV,x.DIV],[Q.DL,x.DL],[Q.DT,x.DT],[Q.EM,x.EM],[Q.EMBED,x.EMBED],[Q.FIELDSET,x.FIELDSET],[Q.FIGCAPTION,x.FIGCAPTION],[Q.FIGURE,x.FIGURE],[Q.FONT,x.FONT],[Q.FOOTER,x.FOOTER],[Q.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[Q.FORM,x.FORM],[Q.FRAME,x.FRAME],[Q.FRAMESET,x.FRAMESET],[Q.H1,x.H1],[Q.H2,x.H2],[Q.H3,x.H3],[Q.H4,x.H4],[Q.H5,x.H5],[Q.H6,x.H6],[Q.HEAD,x.HEAD],[Q.HEADER,x.HEADER],[Q.HGROUP,x.HGROUP],[Q.HR,x.HR],[Q.HTML,x.HTML],[Q.I,x.I],[Q.IMG,x.IMG],[Q.IMAGE,x.IMAGE],[Q.INPUT,x.INPUT],[Q.IFRAME,x.IFRAME],[Q.KEYGEN,x.KEYGEN],[Q.LABEL,x.LABEL],[Q.LI,x.LI],[Q.LINK,x.LINK],[Q.LISTING,x.LISTING],[Q.MAIN,x.MAIN],[Q.MALIGNMARK,x.MALIGNMARK],[Q.MARQUEE,x.MARQUEE],[Q.MATH,x.MATH],[Q.MENU,x.MENU],[Q.META,x.META],[Q.MGLYPH,x.MGLYPH],[Q.MI,x.MI],[Q.MO,x.MO],[Q.MN,x.MN],[Q.MS,x.MS],[Q.MTEXT,x.MTEXT],[Q.NAV,x.NAV],[Q.NOBR,x.NOBR],[Q.NOFRAMES,x.NOFRAMES],[Q.NOEMBED,x.NOEMBED],[Q.NOSCRIPT,x.NOSCRIPT],[Q.OBJECT,x.OBJECT],[Q.OL,x.OL],[Q.OPTGROUP,x.OPTGROUP],[Q.OPTION,x.OPTION],[Q.P,x.P],[Q.PARAM,x.PARAM],[Q.PLAINTEXT,x.PLAINTEXT],[Q.PRE,x.PRE],[Q.RB,x.RB],[Q.RP,x.RP],[Q.RT,x.RT],[Q.RTC,x.RTC],[Q.RUBY,x.RUBY],[Q.S,x.S],[Q.SCRIPT,x.SCRIPT],[Q.SEARCH,x.SEARCH],[Q.SECTION,x.SECTION],[Q.SELECT,x.SELECT],[Q.SOURCE,x.SOURCE],[Q.SMALL,x.SMALL],[Q.SPAN,x.SPAN],[Q.STRIKE,x.STRIKE],[Q.STRONG,x.STRONG],[Q.STYLE,x.STYLE],[Q.SUB,x.SUB],[Q.SUMMARY,x.SUMMARY],[Q.SUP,x.SUP],[Q.TABLE,x.TABLE],[Q.TBODY,x.TBODY],[Q.TEMPLATE,x.TEMPLATE],[Q.TEXTAREA,x.TEXTAREA],[Q.TFOOT,x.TFOOT],[Q.TD,x.TD],[Q.TH,x.TH],[Q.THEAD,x.THEAD],[Q.TITLE,x.TITLE],[Q.TR,x.TR],[Q.TRACK,x.TRACK],[Q.TT,x.TT],[Q.U,x.U],[Q.UL,x.UL],[Q.SVG,x.SVG],[Q.VAR,x.VAR],[Q.WBR,x.WBR],[Q.XMP,x.XMP]]);function zl(e){var t;return(t=bG.get(e))!==null&&t!==void 0?t:x.UNKNOWN}const pe=x,EG={[fe.HTML]:new Set([pe.ADDRESS,pe.APPLET,pe.AREA,pe.ARTICLE,pe.ASIDE,pe.BASE,pe.BASEFONT,pe.BGSOUND,pe.BLOCKQUOTE,pe.BODY,pe.BR,pe.BUTTON,pe.CAPTION,pe.CENTER,pe.COL,pe.COLGROUP,pe.DD,pe.DETAILS,pe.DIR,pe.DIV,pe.DL,pe.DT,pe.EMBED,pe.FIELDSET,pe.FIGCAPTION,pe.FIGURE,pe.FOOTER,pe.FORM,pe.FRAME,pe.FRAMESET,pe.H1,pe.H2,pe.H3,pe.H4,pe.H5,pe.H6,pe.HEAD,pe.HEADER,pe.HGROUP,pe.HR,pe.HTML,pe.IFRAME,pe.IMG,pe.INPUT,pe.LI,pe.LINK,pe.LISTING,pe.MAIN,pe.MARQUEE,pe.MENU,pe.META,pe.NAV,pe.NOEMBED,pe.NOFRAMES,pe.NOSCRIPT,pe.OBJECT,pe.OL,pe.P,pe.PARAM,pe.PLAINTEXT,pe.PRE,pe.SCRIPT,pe.SECTION,pe.SELECT,pe.SOURCE,pe.STYLE,pe.SUMMARY,pe.TABLE,pe.TBODY,pe.TD,pe.TEMPLATE,pe.TEXTAREA,pe.TFOOT,pe.TH,pe.THEAD,pe.TITLE,pe.TR,pe.TRACK,pe.UL,pe.WBR,pe.XMP]),[fe.MATHML]:new Set([pe.MI,pe.MO,pe.MN,pe.MS,pe.MTEXT,pe.ANNOTATION_XML]),[fe.SVG]:new Set([pe.TITLE,pe.FOREIGN_OBJECT,pe.DESC]),[fe.XLINK]:new Set,[fe.XML]:new Set,[fe.XMLNS]:new Set},w1=new Set([pe.H1,pe.H2,pe.H3,pe.H4,pe.H5,pe.H6]);Q.STYLE,Q.SCRIPT,Q.XMP,Q.IFRAME,Q.NOEMBED,Q.NOFRAMES,Q.PLAINTEXT;var $;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})($||($={}));const fn={DATA:$.DATA,RCDATA:$.RCDATA,RAWTEXT:$.RAWTEXT,SCRIPT_DATA:$.SCRIPT_DATA,PLAINTEXT:$.PLAINTEXT,CDATA_SECTION:$.CDATA_SECTION};function xG(e){return e>=F.DIGIT_0&&e<=F.DIGIT_9}function Rc(e){return e>=F.LATIN_CAPITAL_A&&e<=F.LATIN_CAPITAL_Z}function wG(e){return e>=F.LATIN_SMALL_A&&e<=F.LATIN_SMALL_Z}function wi(e){return wG(e)||Rc(e)}function fk(e){return wi(e)||xG(e)}function Cf(e){return e+32}function fL(e){return e===F.SPACE||e===F.LINE_FEED||e===F.TABULATION||e===F.FORM_FEED}function hk(e){return fL(e)||e===F.SOLIDUS||e===F.GREATER_THAN_SIGN}function vG(e){return e===F.NULL?se.nullCharacterReference:e>1114111?se.characterReferenceOutsideUnicodeRange:lL(e)?se.surrogateCharacterReference:uL(e)?se.noncharacterCharacterReference:cL(e)||e===F.CARRIAGE_RETURN?se.controlCharacterReference:null}class _G{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=$.DATA,this.returnState=$.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new lG(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new gG(cG,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(se.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(se.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=vG(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(se.endTagWithAttributes),t.selfClosing&&this._err(se.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case nt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case nt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case nt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:nt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=fL(t)?nt.WHITESPACE_CHARACTER:t===F.NULL?nt.NULL_CHARACTER:nt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(nt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=$.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?qs.Attribute:qs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case $.DATA:{this._stateData(t);break}case $.RCDATA:{this._stateRcdata(t);break}case $.RAWTEXT:{this._stateRawtext(t);break}case $.SCRIPT_DATA:{this._stateScriptData(t);break}case $.PLAINTEXT:{this._statePlaintext(t);break}case $.TAG_OPEN:{this._stateTagOpen(t);break}case $.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case $.TAG_NAME:{this._stateTagName(t);break}case $.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case $.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case $.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case $.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case $.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case $.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case $.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case $.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case $.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case $.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case $.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case $.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case $.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case $.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case $.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case $.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case $.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case $.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case $.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case $.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case $.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case $.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case $.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case $.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case $.BOGUS_COMMENT:{this._stateBogusComment(t);break}case $.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case $.COMMENT_START:{this._stateCommentStart(t);break}case $.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case $.COMMENT:{this._stateComment(t);break}case $.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case $.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case $.COMMENT_END:{this._stateCommentEnd(t);break}case $.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case $.DOCTYPE:{this._stateDoctype(t);break}case $.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case $.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case $.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case $.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case $.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case $.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case $.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case $.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case $.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case $.CDATA_SECTION:{this._stateCdataSection(t);break}case $.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case $.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case $.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.TAG_OPEN;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitCodePoint(t);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case F.AMPERSAND:{this._startCharacterReference();break}case F.LESS_THAN_SIGN:{this.state=$.RCDATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.RAWTEXT_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case F.NULL:{this._err(se.unexpectedNullCharacter),this._emitChars(Yt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(wi(t))this._createStartTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case F.EXCLAMATION_MARK:{this.state=$.MARKUP_DECLARATION_OPEN;break}case F.SOLIDUS:{this.state=$.END_TAG_OPEN;break}case F.QUESTION_MARK:{this._err(se.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t);break}case F.EOF:{this._err(se.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(se.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(wi(t))this._createEndTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case F.GREATER_THAN_SIGN:{this._err(se.missingEndTagName),this.state=$.DATA;break}case F.EOF:{this._err(se.eofBeforeTagName),this._emitChars("");break}case F.NULL:{this._err(se.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(Yt);break}case F.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===F.SOLIDUS?this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:wi(t)?(this._emitChars("<"),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){wi(t)?(this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case F.NULL:{this._err(se.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Yt);break}case F.EOF:{this._err(se.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===F.SOLIDUS?(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(hr.SCRIPT,!1)&&hk(this.preprocessor.peek(hr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==fe.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(AG,fe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(SG,fe.HTML)}clearBackToTableRowContext(){this.clearBackTo(NG,fe.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===x.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===x.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case fe.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case fe.SVG:{if(gk.has(s))return!1;break}case fe.MATHML:{if(mk.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ep)}hasInListItemScope(t){return this.hasInDynamicScope(t,TG)}hasInButtonScope(t){return this.hasInDynamicScope(t,kG)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case fe.HTML:{if(w1.has(n))return!0;if(Ep.has(n))return!1;break}case fe.SVG:{if(gk.has(n))return!1;break}case fe.MATHML:{if(mk.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===fe.HTML)switch(this.tagIDs[n]){case t:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===fe.HTML)switch(this.tagIDs[t]){case x.TBODY:case x.THEAD:case x.TFOOT:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===fe.HTML)switch(this.tagIDs[n]){case t:return!0;case x.OPTION:case x.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&hL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&pk.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&pk.has(this.currentTagId);)this.pop()}}const i0=3;var Ss;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ss||(Ss={}));const yk={type:Ss.Marker};class RG{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let o=0;o[a.name,a.value]));let i=0;for(let a=0;as.get(l.name)===l.value)&&(i+=1,i>=i0&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(yk)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ss.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ss.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(yk);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ss.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ss.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ss.Element&&n.element===t)}}const vi={createDocument(){return{nodeName:"#document",mode:zr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};vi.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(vi.isTextNode(n)){n.value+=t;return}}vi.appendChild(e,vi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&vi.isTextNode(r)?r.value+=t:vi.insertBefore(e,vi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function jG(e){return e.name===pL&&e.publicId===null&&(e.systemId===null||e.systemId===OG)}function BG(e){if(e.name!==pL)return zr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===LG)return zr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),DG.has(n))return zr.QUIRKS;let r=t===null?MG:mL;if(bk(n,r))return zr.QUIRKS;if(r=t===null?gL:PG,bk(n,r))return zr.LIMITED_QUIRKS}return zr.NO_QUIRKS}const Ek={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},FG="definitionurl",UG="definitionURL",$G=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),HG=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:fe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:fe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:fe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:fe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:fe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:fe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:fe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:fe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:fe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:fe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:fe.XMLNS}]]),zG=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),VG=new Set([x.B,x.BIG,x.BLOCKQUOTE,x.BODY,x.BR,x.CENTER,x.CODE,x.DD,x.DIV,x.DL,x.DT,x.EM,x.EMBED,x.H1,x.H2,x.H3,x.H4,x.H5,x.H6,x.HEAD,x.HR,x.I,x.IMG,x.LI,x.LISTING,x.MENU,x.META,x.NOBR,x.OL,x.P,x.PRE,x.RUBY,x.S,x.SMALL,x.SPAN,x.STRONG,x.STRIKE,x.SUB,x.SUP,x.TABLE,x.TT,x.U,x.UL,x.VAR]);function KG(e){const t=e.tagID;return t===x.FONT&&e.attrs.some(({name:r})=>r===La.COLOR||r===La.SIZE||r===La.FACE)||VG.has(t)}function yL(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let i,a;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,a=this.fragmentContextID):{current:i,currentTagId:a}=this.openElements,this._setContextModes(i,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===fe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,fe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=z.TEXT}switchToPlaintextParsing(){this.insertionMode=z.TEXT,this.originalInsertionMode=z.IN_BODY,this.tokenizer.state=fn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Q.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==fe.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=fn.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=fn.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=fn.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=fn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,fe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,fe.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Q.HTML,fe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,x.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,a=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:l,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:l,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),i=n.type===nt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===x.SVG&&this.treeAdapter.getTagName(n)===Q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===fe.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===x.MGLYPH||t.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,fe.HTML)}_processToken(t){switch(t.type){case nt.CHARACTER:{this.onCharacter(t);break}case nt.NULL_CHARACTER:{this.onNullCharacter(t);break}case nt.COMMENT:{this.onComment(t);break}case nt.DOCTYPE:{this.onDoctype(t);break}case nt.START_TAG:{this._processStartTag(t);break}case nt.END_TAG:{this.onEndTag(t);break}case nt.EOF:{this.onEof(t);break}case nt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return GG(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Ss.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(x.P),this.openElements.popUntilTagNamePopped(x.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case x.TR:{this.insertionMode=z.IN_ROW;return}case x.TBODY:case x.THEAD:case x.TFOOT:{this.insertionMode=z.IN_TABLE_BODY;return}case x.CAPTION:{this.insertionMode=z.IN_CAPTION;return}case x.COLGROUP:{this.insertionMode=z.IN_COLUMN_GROUP;return}case x.TABLE:{this.insertionMode=z.IN_TABLE;return}case x.BODY:{this.insertionMode=z.IN_BODY;return}case x.FRAMESET:{this.insertionMode=z.IN_FRAMESET;return}case x.SELECT:{this._resetInsertionModeForSelect(t);return}case x.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case x.HTML:{this.insertionMode=this.headElement?z.AFTER_HEAD:z.BEFORE_HEAD;return}case x.TD:case x.TH:{if(t>0){this.insertionMode=z.IN_CELL;return}break}case x.HEAD:{if(t>0){this.insertionMode=z.IN_HEAD;return}break}}this.insertionMode=z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===x.TEMPLATE)break;if(r===x.TABLE){this.insertionMode=z.IN_SELECT_IN_TABLE;return}}this.insertionMode=z.IN_SELECT}_isElementCausesFosterParenting(t){return EL.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case x.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===fe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case x.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return EG[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){CQ(this,t);return}switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:{wL(this,t);break}case z.TEXT:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{a0(this,t);break}case z.IN_TABLE_TEXT:{SL(this,t);break}case z.IN_COLUMN_GROUP:{xp(this,t);break}case z.AFTER_BODY:{wp(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){AQ(this,t);return}switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.TEXT:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{a0(this,t);break}case z.IN_COLUMN_GROUP:{xp(this,t);break}case z.AFTER_BODY:{wp(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){v1(this,t);return}switch(this.insertionMode){case z.INITIAL:case z.BEFORE_HTML:case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_TEMPLATE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{v1(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.AFTER_BODY:{aX(this,t);break}case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{oX(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case z.INITIAL:{lX(this,t);break}case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:{this._err(t,se.misplacedDoctype);break}case z.IN_TABLE_TEXT:{gc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,se.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?IQ(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{cX(this,t);break}case z.BEFORE_HEAD:{dX(this,t);break}case z.IN_HEAD:{bs(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pX(this,t);break}case z.AFTER_HEAD:{gX(this,t);break}case z.IN_BODY:{Zn(this,t);break}case z.IN_TABLE:{El(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_CAPTION:{fQ(this,t);break}case z.IN_COLUMN_GROUP:{lx(this,t);break}case z.IN_TABLE_BODY:{_m(this,t);break}case z.IN_ROW:{Tm(this,t);break}case z.IN_CELL:{mQ(this,t);break}case z.IN_SELECT:{IL(this,t);break}case z.IN_SELECT_IN_TABLE:{yQ(this,t);break}case z.IN_TEMPLATE:{EQ(this,t);break}case z.AFTER_BODY:{wQ(this,t);break}case z.IN_FRAMESET:{vQ(this,t);break}case z.AFTER_FRAMESET:{TQ(this,t);break}case z.AFTER_AFTER_BODY:{NQ(this,t);break}case z.AFTER_AFTER_FRAMESET:{SQ(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?RQ(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{uX(this,t);break}case z.BEFORE_HEAD:{fX(this,t);break}case z.IN_HEAD:{hX(this,t);break}case z.IN_HEAD_NO_SCRIPT:{mX(this,t);break}case z.AFTER_HEAD:{yX(this,t);break}case z.IN_BODY:{vm(this,t);break}case z.TEXT:{nQ(this,t);break}case z.IN_TABLE:{$u(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_CAPTION:{hQ(this,t);break}case z.IN_COLUMN_GROUP:{pQ(this,t);break}case z.IN_TABLE_BODY:{_1(this,t);break}case z.IN_ROW:{CL(this,t);break}case z.IN_CELL:{gQ(this,t);break}case z.IN_SELECT:{RL(this,t);break}case z.IN_SELECT_IN_TABLE:{bQ(this,t);break}case z.IN_TEMPLATE:{xQ(this,t);break}case z.AFTER_BODY:{LL(this,t);break}case z.IN_FRAMESET:{_Q(this,t);break}case z.AFTER_FRAMESET:{kQ(this,t);break}case z.AFTER_AFTER_BODY:{mh(this,t);break}}}onEof(t){switch(this.insertionMode){case z.INITIAL:{mc(this,t);break}case z.BEFORE_HTML:{eu(this,t);break}case z.BEFORE_HEAD:{tu(this,t);break}case z.IN_HEAD:{nu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{ru(this,t);break}case z.AFTER_HEAD:{su(this,t);break}case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{kL(this,t);break}case z.TEXT:{rQ(this,t);break}case z.IN_TABLE_TEXT:{gc(this,t);break}case z.IN_TEMPLATE:{OL(this,t);break}case z.AFTER_BODY:case z.IN_FRAMESET:case z.AFTER_FRAMESET:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{ox(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===F.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.TEXT:case z.IN_COLUMN_GROUP:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{this._insertCharacters(t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:case z.AFTER_BODY:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{xL(this,t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{a0(this,t);break}case z.IN_TABLE_TEXT:{NL(this,t);break}}}};function eX(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):TL(e,t),n}function tX(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function nX(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,a=s;a!==n;i++,a=s){s=e.openElements.getCommonAncestor(a);const o=e.activeFormattingElements.getElementEntry(a),l=o&&i>=ZG;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=rX(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function rX(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function sX(e,t,n){const r=e.treeAdapter.getTagName(t),s=zl(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===x.TEMPLATE&&i===fe.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function iX(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function ax(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(i);a&&!a.endTag&&e._setEndLocation(i,t)}}}}function lX(e,t){e._setDocumentType(t);const n=t.forceQuirks?zr.QUIRKS:BG(t);jG(t)||e._err(t,se.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=z.BEFORE_HTML}function mc(e,t){e._err(t,se.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,zr.QUIRKS),e.insertionMode=z.BEFORE_HTML,e._processToken(t)}function cX(e,t){t.tagID===x.HTML?(e._insertElement(t,fe.HTML),e.insertionMode=z.BEFORE_HEAD):eu(e,t)}function uX(e,t){const n=t.tagID;(n===x.HTML||n===x.HEAD||n===x.BODY||n===x.BR)&&eu(e,t)}function eu(e,t){e._insertFakeRootElement(),e.insertionMode=z.BEFORE_HEAD,e._processToken(t)}function dX(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.HEAD:{e._insertElement(t,fe.HTML),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD;break}default:tu(e,t)}}function fX(e,t){const n=t.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?tu(e,t):e._err(t,se.endTagWithoutMatchingOpenElement)}function tu(e,t){e._insertFakeElement(Q.HEAD,x.HEAD),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD,e._processToken(t)}function bs(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{e._appendElement(t,fe.HTML),t.ackSelfClosing=!0;break}case x.TITLE:{e._switchToTextParsing(t,fn.RCDATA);break}case x.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,fn.RAWTEXT):(e._insertElement(t,fe.HTML),e.insertionMode=z.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{e._switchToTextParsing(t,fn.RAWTEXT);break}case x.SCRIPT:{e._switchToTextParsing(t,fn.SCRIPT_DATA);break}case x.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(z.IN_TEMPLATE);break}case x.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:nu(e,t)}}function hX(e,t){switch(t.tagID){case x.HEAD:{e.openElements.pop(),e.insertionMode=z.AFTER_HEAD;break}case x.BODY:case x.BR:case x.HTML:{nu(e,t);break}case x.TEMPLATE:{so(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function so(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==x.TEMPLATE&&e._err(t,se.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,se.endTagWithoutMatchingOpenElement)}function nu(e,t){e.openElements.pop(),e.insertionMode=z.AFTER_HEAD,e._processToken(t)}function pX(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.BASEFONT:case x.BGSOUND:case x.HEAD:case x.LINK:case x.META:case x.NOFRAMES:case x.STYLE:{bs(e,t);break}case x.NOSCRIPT:{e._err(t,se.nestedNoscriptInHead);break}default:ru(e,t)}}function mX(e,t){switch(t.tagID){case x.NOSCRIPT:{e.openElements.pop(),e.insertionMode=z.IN_HEAD;break}case x.BR:{ru(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function ru(e,t){const n=t.type===nt.EOF?se.openElementsLeftAfterEof:se.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=z.IN_HEAD,e._processToken(t)}function gX(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.BODY:{e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=z.IN_BODY;break}case x.FRAMESET:{e._insertElement(t,fe.HTML),e.insertionMode=z.IN_FRAMESET;break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{e._err(t,se.abandonedHeadElementChild),e.openElements.push(e.headElement,x.HEAD),bs(e,t),e.openElements.remove(e.headElement);break}case x.HEAD:{e._err(t,se.misplacedStartTagForHeadElement);break}default:su(e,t)}}function yX(e,t){switch(t.tagID){case x.BODY:case x.HTML:case x.BR:{su(e,t);break}case x.TEMPLATE:{so(e,t);break}default:e._err(t,se.endTagWithoutMatchingOpenElement)}}function su(e,t){e._insertFakeElement(Q.BODY,x.BODY),e.insertionMode=z.IN_BODY,wm(e,t)}function wm(e,t){switch(t.type){case nt.CHARACTER:{wL(e,t);break}case nt.WHITESPACE_CHARACTER:{xL(e,t);break}case nt.COMMENT:{v1(e,t);break}case nt.START_TAG:{Zn(e,t);break}case nt.END_TAG:{vm(e,t);break}case nt.EOF:{kL(e,t);break}}}function xL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function wL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function bX(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function EX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function xX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_FRAMESET)}function wX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML)}function vX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&w1.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,fe.HTML)}function _X(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function TX(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),n||(e.formElement=e.openElements.current))}function kX(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===x.LI&&s===x.LI||(n===x.DD||n===x.DT)&&(s===x.DD||s===x.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==x.ADDRESS&&s!==x.DIV&&s!==x.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML)}function NX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.tokenizer.state=fn.PLAINTEXT}function SX(e,t){e.openElements.hasInScope(x.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.framesetOk=!1}function AX(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Q.A);n&&(ax(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function CX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function IX(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(x.NOBR)&&(ax(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,fe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function RX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function OX(e,t){e.treeAdapter.getDocumentMode(e.document)!==zr.QUIRKS&&e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=z.IN_TABLE}function vL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,fe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function _L(e){const t=dL(e,La.TYPE);return t!=null&&t.toLowerCase()===XG}function LX(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,fe.HTML),_L(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function MX(e,t){e._appendElement(t,fe.HTML),t.ackSelfClosing=!0}function DX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._appendElement(t,fe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function PX(e,t){t.tagName=Q.IMG,t.tagID=x.IMG,vL(e,t)}function jX(e,t){e._insertElement(t,fe.HTML),e.skipNextNewLine=!0,e.tokenizer.state=fn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=z.TEXT}function BX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,fn.RAWTEXT)}function FX(e,t){e.framesetOk=!1,e._switchToTextParsing(t,fn.RAWTEXT)}function vk(e,t){e._switchToTextParsing(t,fn.RAWTEXT)}function UX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===z.IN_TABLE||e.insertionMode===z.IN_CAPTION||e.insertionMode===z.IN_TABLE_BODY||e.insertionMode===z.IN_ROW||e.insertionMode===z.IN_CELL?z.IN_SELECT_IN_TABLE:z.IN_SELECT}function $X(e,t){e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML)}function HX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,fe.HTML)}function zX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(x.RTC),e._insertElement(t,fe.HTML)}function VX(e,t){e._reconstructActiveFormattingElements(),yL(t),ix(t),t.selfClosing?e._appendElement(t,fe.MATHML):e._insertElement(t,fe.MATHML),t.ackSelfClosing=!0}function KX(e,t){e._reconstructActiveFormattingElements(),bL(t),ix(t),t.selfClosing?e._appendElement(t,fe.SVG):e._insertElement(t,fe.SVG),t.ackSelfClosing=!0}function _k(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,fe.HTML)}function Zn(e,t){switch(t.tagID){case x.I:case x.S:case x.B:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.SMALL:case x.STRIKE:case x.STRONG:{CX(e,t);break}case x.A:{AX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{vX(e,t);break}case x.P:case x.DL:case x.OL:case x.UL:case x.DIV:case x.DIR:case x.NAV:case x.MAIN:case x.MENU:case x.ASIDE:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.DETAILS:case x.ADDRESS:case x.ARTICLE:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{wX(e,t);break}case x.LI:case x.DD:case x.DT:{kX(e,t);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{vL(e,t);break}case x.HR:{DX(e,t);break}case x.RB:case x.RTC:{HX(e,t);break}case x.RT:case x.RP:{zX(e,t);break}case x.PRE:case x.LISTING:{_X(e,t);break}case x.XMP:{BX(e,t);break}case x.SVG:{KX(e,t);break}case x.HTML:{bX(e,t);break}case x.BASE:case x.LINK:case x.META:case x.STYLE:case x.TITLE:case x.SCRIPT:case x.BGSOUND:case x.BASEFONT:case x.TEMPLATE:{bs(e,t);break}case x.BODY:{EX(e,t);break}case x.FORM:{TX(e,t);break}case x.NOBR:{IX(e,t);break}case x.MATH:{VX(e,t);break}case x.TABLE:{OX(e,t);break}case x.INPUT:{LX(e,t);break}case x.PARAM:case x.TRACK:case x.SOURCE:{MX(e,t);break}case x.IMAGE:{PX(e,t);break}case x.BUTTON:{SX(e,t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{RX(e,t);break}case x.IFRAME:{FX(e,t);break}case x.SELECT:{UX(e,t);break}case x.OPTION:case x.OPTGROUP:{$X(e,t);break}case x.NOEMBED:case x.NOFRAMES:{vk(e,t);break}case x.FRAMESET:{xX(e,t);break}case x.TEXTAREA:{jX(e,t);break}case x.NOSCRIPT:{e.options.scriptingEnabled?vk(e,t):_k(e,t);break}case x.PLAINTEXT:{NX(e,t);break}case x.COL:case x.TH:case x.TD:case x.TR:case x.HEAD:case x.FRAME:case x.TBODY:case x.TFOOT:case x.THEAD:case x.CAPTION:case x.COLGROUP:break;default:_k(e,t)}}function YX(e,t){if(e.openElements.hasInScope(x.BODY)&&(e.insertionMode=z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function WX(e,t){e.openElements.hasInScope(x.BODY)&&(e.insertionMode=z.AFTER_BODY,LL(e,t))}function qX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function GX(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(x.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(x.FORM):n&&e.openElements.remove(n))}function XX(e){e.openElements.hasInButtonScope(x.P)||e._insertFakeElement(Q.P,x.P),e._closePElement()}function QX(e){e.openElements.hasInListItemScope(x.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(x.LI),e.openElements.popUntilTagNamePopped(x.LI))}function ZX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function JX(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function eQ(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function tQ(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Q.BR,x.BR),e.openElements.pop(),e.framesetOk=!1}function TL(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const i=e.openElements.items[s],a=e.openElements.tagIDs[s];if(r===a&&(r!==x.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,a))break}}function vm(e,t){switch(t.tagID){case x.A:case x.B:case x.I:case x.S:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.NOBR:case x.SMALL:case x.STRIKE:case x.STRONG:{ax(e,t);break}case x.P:{XX(e);break}case x.DL:case x.UL:case x.OL:case x.DIR:case x.DIV:case x.NAV:case x.PRE:case x.MAIN:case x.MENU:case x.ASIDE:case x.BUTTON:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.ADDRESS:case x.ARTICLE:case x.DETAILS:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.LISTING:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{qX(e,t);break}case x.LI:{QX(e);break}case x.DD:case x.DT:{ZX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{JX(e);break}case x.BR:{tQ(e);break}case x.BODY:{YX(e,t);break}case x.HTML:{WX(e,t);break}case x.FORM:{GX(e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{eQ(e,t);break}case x.TEMPLATE:{so(e,t);break}default:TL(e,t)}}function kL(e,t){e.tmplInsertionModeStack.length>0?OL(e,t):ox(e,t)}function nQ(e,t){var n;t.tagID===x.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function rQ(e,t){e._err(t,se.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function a0(e,t){if(e.openElements.currentTagId!==void 0&&EL.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=z.IN_TABLE_TEXT,t.type){case nt.CHARACTER:{SL(e,t);break}case nt.WHITESPACE_CHARACTER:{NL(e,t);break}}else wd(e,t)}function sQ(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_CAPTION}function iQ(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_COLUMN_GROUP}function aQ(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.COLGROUP,x.COLGROUP),e.insertionMode=z.IN_COLUMN_GROUP,lx(e,t)}function oQ(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,fe.HTML),e.insertionMode=z.IN_TABLE_BODY}function lQ(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Q.TBODY,x.TBODY),e.insertionMode=z.IN_TABLE_BODY,_m(e,t)}function cQ(e,t){e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function uQ(e,t){_L(t)?e._appendElement(t,fe.HTML):wd(e,t),t.ackSelfClosing=!0}function dQ(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,fe.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function El(e,t){switch(t.tagID){case x.TD:case x.TH:case x.TR:{lQ(e,t);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{bs(e,t);break}case x.COL:{aQ(e,t);break}case x.FORM:{dQ(e,t);break}case x.TABLE:{cQ(e,t);break}case x.TBODY:case x.TFOOT:case x.THEAD:{oQ(e,t);break}case x.INPUT:{uQ(e,t);break}case x.CAPTION:{sQ(e,t);break}case x.COLGROUP:{iQ(e,t);break}default:wd(e,t)}}function $u(e,t){switch(t.tagID){case x.TABLE:{e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode());break}case x.TEMPLATE:{so(e,t);break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:wd(e,t)}}function wd(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,wm(e,t),e.fosterParentingEnabled=n}function NL(e,t){e.pendingCharacterTokens.push(t)}function SL(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function gc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===x.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===x.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop();break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop();break}case x.SELECT:{e.openElements.hasInSelectScope(x.SELECT)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode());break}case x.TEMPLATE:{so(e,t);break}}}function yQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e._processStartTag(t)):IL(e,t)}function bQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e.onEndTag(t)):RL(e,t)}function EQ(e,t){switch(t.tagID){case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{bs(e,t);break}case x.CAPTION:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{e.tmplInsertionModeStack[0]=z.IN_TABLE,e.insertionMode=z.IN_TABLE,El(e,t);break}case x.COL:{e.tmplInsertionModeStack[0]=z.IN_COLUMN_GROUP,e.insertionMode=z.IN_COLUMN_GROUP,lx(e,t);break}case x.TR:{e.tmplInsertionModeStack[0]=z.IN_TABLE_BODY,e.insertionMode=z.IN_TABLE_BODY,_m(e,t);break}case x.TD:case x.TH:{e.tmplInsertionModeStack[0]=z.IN_ROW,e.insertionMode=z.IN_ROW,Tm(e,t);break}default:e.tmplInsertionModeStack[0]=z.IN_BODY,e.insertionMode=z.IN_BODY,Zn(e,t)}}function xQ(e,t){t.tagID===x.TEMPLATE&&so(e,t)}function OL(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ox(e,t)}function wQ(e,t){t.tagID===x.HTML?Zn(e,t):wp(e,t)}function LL(e,t){var n;if(t.tagID===x.HTML){if(e.fragmentContext||(e.insertionMode=z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===x.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else wp(e,t)}function wp(e,t){e.insertionMode=z.IN_BODY,wm(e,t)}function vQ(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.FRAMESET:{e._insertElement(t,fe.HTML);break}case x.FRAME:{e._appendElement(t,fe.HTML),t.ackSelfClosing=!0;break}case x.NOFRAMES:{bs(e,t);break}}}function _Q(e,t){t.tagID===x.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==x.FRAMESET&&(e.insertionMode=z.AFTER_FRAMESET))}function TQ(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.NOFRAMES:{bs(e,t);break}}}function kQ(e,t){t.tagID===x.HTML&&(e.insertionMode=z.AFTER_AFTER_FRAMESET)}function NQ(e,t){t.tagID===x.HTML?Zn(e,t):mh(e,t)}function mh(e,t){e.insertionMode=z.IN_BODY,wm(e,t)}function SQ(e,t){switch(t.tagID){case x.HTML:{Zn(e,t);break}case x.NOFRAMES:{bs(e,t);break}}}function AQ(e,t){t.chars=Yt,e._insertCharacters(t)}function CQ(e,t){e._insertCharacters(t),e.framesetOk=!1}function ML(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==fe.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function IQ(e,t){if(KG(t))ML(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===fe.MATHML?yL(t):r===fe.SVG&&(YG(t),bL(t)),ix(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function RQ(e,t){if(t.tagID===x.P||t.tagID===x.BR){ML(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===fe.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}Q.AREA,Q.BASE,Q.BASEFONT,Q.BGSOUND,Q.BR,Q.COL,Q.EMBED,Q.FRAME,Q.HR,Q.IMG,Q.INPUT,Q.KEYGEN,Q.LINK,Q.META,Q.PARAM,Q.SOURCE,Q.TRACK,Q.WBR;const OQ=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,LQ=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Tk={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function DL(e,t){const n=zQ(e),r=XR("type",{handlers:{root:MQ,element:DQ,text:PQ,comment:jL,doctype:jQ,raw:FQ},unknown:UQ}),s={parser:n?new wk(Tk):wk.getFragmentParser(void 0,Tk),handle(o){r(o,s)},stitches:!1,options:t||{}};r(e,s),Vl(s,Fs());const i=n?s.parser.document:s.parser.getFragment(),a=Vq(i,{file:s.options.file});return s.stitches&&Ed(a,"comment",function(o,l,u){const d=o;if(d.value.stitch&&u&&l!==void 0){const f=u.children;return f[l]=d.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function PL(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:nt.CHARACTER,chars:e.value,location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function jQ(e,t){const n={type:nt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function BQ(e,t){t.stitches=!0;const n=VQ(e);if("children"in e&&"children"in n){const r=DL({type:"root",children:e.children},t.options);n.children=r.children}jL({type:"comment",value:{stitch:n}},t)}function jL(e,t){const n=e.value,r={type:nt.COMMENT,data:n,location:vd(e)};Vl(t,Fs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function FQ(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,BL(t,Fs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(OQ,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function UQ(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))BQ(n,t);else{let r="";throw LQ.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Vl(e,t){BL(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=fn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function BL(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function $Q(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===fn.PLAINTEXT)return;Vl(t,Fs(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Ta.html;s===Ta.html&&n==="svg"&&(s=Ta.svg);const i=Gq({...e,children:[]},{space:s===Ta.svg?"svg":"html"}),a={type:nt.START_TAG,tagName:n,tagID:zl(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:vd(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function HQ(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&rG.includes(n)||t.parser.tokenizer.state===fn.PLAINTEXT)return;Vl(t,mm(e));const r={type:nt.END_TAG,tagName:n,tagID:zl(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:vd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===fn.RCDATA||t.parser.tokenizer.state===fn.RAWTEXT||t.parser.tokenizer.state===fn.SCRIPT_DATA)&&(t.parser.tokenizer.state=fn.DATA)}function zQ(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function vd(e){const t=Fs(e)||{line:void 0,column:void 0,offset:void 0},n=mm(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function VQ(e){return"children"in e?yl({...e,children:[]}):yl(e)}function KQ(e){return function(t,n){return DL(t,{...e,file:n})}}const FL=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function UL(e){if(!e)return!1;try{const t=e.toLowerCase();return FL.some(n=>t.includes(n))}catch{return!1}}function YQ(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(UL(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const s=n.map(i=>(i==null?void 0:i.value)||"").join("").toLowerCase();return FL.some(i=>s.includes(i))}return!1}function WQ({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=v.useState(null),i=(l,u)=>{if(l.src)return l.src;if(u){const d=h=>{var p;if(!h)return null;if(h.type==="source"&&((p=h.properties)!=null&&p.src))return h.properties.src;if(h.children)for(const m of h.children){const y=d(m);if(y)return y}return null},f=d({children:u});if(f)return f}return""},a=l=>{try{const d=new URL(l).pathname.split("/");return d[d.length-1]||"video.mp4"}catch{return"video.mp4"}},o=l=>l?Array.isArray(l)?l.map(u=>(u==null?void 0:u.value)||"").join("")||"video":(l==null?void 0:l.value)||"video":"video";return c.jsxs("div",{className:t?`md ${t}`:"md",children:[c.jsx(Xz,{remarkPlugins:[cY],rehypePlugins:n?[KQ,ok]:[ok],components:{a:({node:l,...u})=>{const d=u.href;if(d&&(UL(d)||YQ(l))){const f=d,h=o(l==null?void 0:l.children);return c.jsxs("div",{className:"video-container",children:[c.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[c.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),c.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]}),c.jsx("div",{className:"video-caption",children:c.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return c.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:l,src:u,alt:d,...f})=>{const h=c.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?c.jsx(yI,{src:u,children:c.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,c.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]})}):h},video:({node:l,src:u,children:d,...f})=>{const h=i({src:u},d);return h?c.jsx("div",{className:"video-container",children:c.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[c.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),c.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:c.jsx(Gc,{})})]})}):c.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&c.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:c.jsxs("div",{className:"video-viewer",onClick:l=>l.stopPropagation(),children:[c.jsxs("div",{className:"video-viewer-header",children:[c.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),c.jsxs("nav",{className:"video-viewer-nav",children:[c.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:c.jsx(TE,{})}),c.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:c.jsx(Xr,{})})]})]}),c.jsx("div",{className:"video-viewer-body",children:c.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const _d=v.memo(WQ),kk=6,Nk=7,qQ={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function T1(e){return qQ[(e||"").trim().toLowerCase()]||"未知"}function Sk(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)?"is-positive":["creating","pending","running","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function GQ(e){if(!e)return"";const t=e.trim(),n=Number(t),r=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function XQ(e){const t=e.replace(/\r\n/g,` `);if(!t.startsWith(`--- `))return e;const n=t.indexOf(` --- -`,4);return n>=0?t.slice(n+5).trimStart():e}function QQ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M5.25 7.5h5.25v5.25H5.25zM13.5 7.5h5.25v5.25H13.5zM9.38 15.75h5.24v3H9.38z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M7.88 12.75v1.5c0 .83.67 1.5 1.5 1.5h5.24c.83 0 1.5-.67 1.5-1.5v-1.5M12 4.75V7.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("circle",{cx:"12",cy:"4.75",r:"1",fill:"currentColor"})]})}function ZQ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("path",{d:"m17.85 13.85.42 1.13 1.13.42-1.13.42-.42 1.13-.42-1.13-1.13-.42 1.13-.42z",fill:"currentColor"})]})}function JQ(){return c.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:c.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function AN({direction:e}){return c.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:c.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function k1(){return c.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function CN({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return c.jsxs("footer",{className:"skillcenter-pager",children:[c.jsxs("span",{children:["共 ",t," 项"]}),c.jsxs("div",{className:"skillcenter-pager-actions",children:[c.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:c.jsx(AN,{direction:"left"})}),c.jsxs("span",{children:[e," / ",s]}),c.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:c.jsx(AN,{direction:"right"})})]})]})}function gh({children:e}){return c.jsx("div",{className:"skillcenter-empty",children:e})}function eZ({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return v.useEffect(()=>{const o=l=>{l.key==="Escape"&&a()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a]),c.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:c.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:o=>o.stopPropagation(),children:[c.jsxs("header",{className:"skill-detail-head",children:[c.jsxs("div",{className:"skill-detail-heading",children:[c.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:c.jsx(ZQ,{})}),c.jsxs("div",{children:[c.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),c.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),c.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:c.jsx(JQ,{})})]}),c.jsxs("dl",{className:"skill-detail-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"技能 ID"}),c.jsx("dd",{title:e.skillId,children:e.skillId})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"版本"}),c.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"状态"}),c.jsx("dd",{children:N1(e.skillStatus)})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"技能空间"}),c.jsx("dd",{title:t.name,children:t.name})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Project"}),c.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"地域"}),c.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),c.jsxs("div",{className:"skill-detail-content",children:[c.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?c.jsxs("div",{className:"skillcenter-loading",children:[c.jsx(k1,{}),"正在读取技能内容…"]}):i?c.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?c.jsx(_d,{text:XQ(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):c.jsx(gh,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function tZ({onClick:e}){return c.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"技能中心",title:"技能中心",children:[c.jsx(QQ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"技能中心"})]})}function nZ(){const[e,t]=v.useState("cn-beijing"),[n,r]=v.useState([]),[s,i]=v.useState(1),[a,o]=v.useState(0),[l,u]=v.useState(!1),[d,f]=v.useState(""),[h,p]=v.useState(null),[m,y]=v.useState([]),[w,g]=v.useState(1),[E,b]=v.useState(0),[_,N]=v.useState(!1),[T,A]=v.useState(""),[k,R]=v.useState(null),[I,M]=v.useState(null),[B,Y]=v.useState(!1),[P,U]=v.useState(""),C=v.useRef(0);v.useEffect(()=>{let H=!0;return u(!0),f(""),pU({region:e,page:s,pageSize:NN}).then(V=>{if(!H)return;const D=V.items||[];r(D),o(V.totalCount||0),p(ne=>D.find(ee=>ee.id===(ne==null?void 0:ne.id))||null)}).catch(V=>{H&&(r([]),o(0),p(null),f(V instanceof Error?V.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{H&&u(!1)}),()=>{H=!1}},[e,s]),v.useEffect(()=>{if(!h){y([]),b(0);return}let H=!0;return N(!0),A(""),gU(h.id,{region:e,page:w,pageSize:kN,project:h.projectName}).then(V=>{H&&(y(V.items||[]),b(V.totalCount||0))}).catch(V=>{H&&(y([]),b(0),A(V instanceof Error?V.message:"读取技能失败,请稍后重试"))}).finally(()=>{H&&N(!1)}),()=>{H=!1}},[e,h,w]);const L=H=>{H!==e&&(j(),t(H),i(1),g(1),p(null),y([]))},O=H=>{j(),p(H),g(1)},j=()=>{C.current+=1,R(null),M(null),U(""),Y(!1)},S=async H=>{if(!h)return;const V=C.current+1;C.current=V,R(H),M(null),U(""),Y(!0);try{const D=await yU(h.id,H.skillId,H.version,e,h.projectName);C.current===V&&M(D)}catch(D){C.current===V&&U(D instanceof Error?D.message:"读取技能详情失败,请稍后重试")}finally{C.current===V&&Y(!1)}};return c.jsxs("section",{className:"skillcenter",children:[c.jsxs("div",{className:"skillcenter-browser",children:[c.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[c.jsxs("header",{className:"skillcenter-panel-head",children:[c.jsxs("div",{children:[c.jsx("h2",{children:"技能空间"}),c.jsx("span",{className:"skillcenter-count-badge",children:a})]}),c.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[c.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>L("cn-beijing"),children:"北京"}),c.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>L("cn-shanghai"),children:"上海"})]})]}),c.jsxs("div",{className:"skillcenter-listwrap",children:[l&&c.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[c.jsx(k1,{}),"正在读取技能空间…"]}),d?c.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!l?c.jsx(gh,{children:"当前地域暂无可访问的技能空间"}):c.jsx("div",{className:"skillcenter-list",children:n.map(H=>c.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===H.id?"active":""}`,onClick:()=>O(H),children:c.jsxs("span",{className:"skillcenter-item-body",children:[c.jsx("span",{className:"skillcenter-item-title",title:H.name,children:H.name}),c.jsx("span",{className:"skillcenter-item-description",children:H.description||"暂无描述"}),c.jsxs("span",{className:"skillcenter-item-meta",children:[c.jsx("span",{className:`skillcenter-status ${SN(H.status)}`,children:N1(H.status)}),c.jsxs("span",{className:"skillcenter-meta-text",title:H.projectName||"default",children:["Project · ",H.projectName||"default"]}),c.jsxs("span",{className:"skillcenter-meta-text",children:[H.skillCount??0," 个技能"]}),H.updatedAt&&c.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",GQ(H.updatedAt)]})]})]})},`${H.projectName||"default"}:${H.id}`))})]}),c.jsx(CN,{page:s,total:a,pageSize:NN,onPage:i})]}),c.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"skillcenter-panel-head",children:[c.jsx("div",{children:c.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),c.jsx("span",{children:E})]}),c.jsxs("div",{className:"skillcenter-listwrap",children:[_&&c.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[c.jsx(k1,{}),"正在读取技能…"]}),T?c.jsx("div",{className:"skillcenter-error",children:T}):m.length===0&&!_?c.jsx(gh,{children:"这个空间中暂无技能"}):c.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(H=>c.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void S(H),children:c.jsxs("span",{className:"skillcenter-item-body",children:[c.jsx("span",{className:"skillcenter-item-title",title:H.skillName,children:H.skillName}),c.jsx("span",{className:"skillcenter-item-description",children:H.skillDescription||"暂无描述"}),c.jsxs("span",{className:"skillcenter-item-meta",children:[c.jsx("span",{className:`skillcenter-status ${SN(H.skillStatus)}`,children:N1(H.skillStatus)}),c.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",H.version||"—"]})]})]})},`${H.skillId}:${H.version}`))})]}),c.jsx(CN,{page:w,total:E,pageSize:kN,onPage:g})]}):c.jsx(gh,{children:"点击 Skill 空间以查看详情"})})]}),k&&h&&c.jsx(eZ,{skill:k,space:h,region:e,detail:I,loading:B,error:P,onClose:j})]})}const rZ=50,IN=48;function sZ(e){return(e.events??[]).flatMap(t=>{var s,i;const r=(((s=t.content)==null?void 0:s.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return r?[{text:r,role:t.author??((i=t.content)==null?void 0:i.role)??"",ts:t.timestamp}]:[]})}function iZ(e){var t,n;for(const r of e.events??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const s=(((n=r.content)==null?void 0:n.parts)??[]).map(i=>i.text).find(Boolean);if(s)return s}return"未命名会话"}function aZ(e,t,n){const r=Math.max(0,t-IN),s=Math.min(e.length,t+n+IN);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var l;if((l=o.events)!=null&&l.length)return o;try{return await dp(t,e,o.id)}catch{return o}})),a=[];for(const o of i)for(const{text:l,role:u,ts:d}of sZ(o)){const f=l.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:o.id,title:iZ(o),snippet:aZ(l,f,r.length),role:u,ts:d??o.lastUpdateTime});break}}return a.sort((o,l)=>(l.ts??0)-(o.ts??0)),a.slice(0,rZ)}async function lZ(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await GI(e,t.trim())}catch(a){const o=String(a);return{results:[],note:o.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${o}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,o)=>({type:"web",index:o,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function cZ(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await qI(t,e,r.trim(),n);if(!s.mounted)return{results:[],note:e==="knowledge"?"该 Agent 未挂载知识库。":"该 Agent 未挂载长期记忆。"};if(s.error)return{results:[],note:s.error};const i=s.sourceName??(e==="knowledge"?"知识库":"长期记忆");return{results:s.results.map((a,o)=>e==="knowledge"?{type:"knowledge",index:o,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:o,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function uZ(e,t,n){return e==="session"?{results:await oZ(n.userId,n.appId,t)}:e==="web"?lZ(n.appId,t):cZ(e,n.appId,n.userId,t)}function $L({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),c.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function dZ({open:e}){return c.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function fZ({onClick:e}){return c.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"智能搜索",title:"智能搜索",children:[c.jsx($L,{}),c.jsx("span",{className:"sidebar-nav-label",children:"智能搜索"})]})}function hZ(e,t,n){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),i=a=>r?n?"正在检测 Agent 能力":`当前 Agent 未挂载${a}`:"请选择 Agent";return[{id:"session",label:"会话",ready:r,unavailableLabel:"请选择 Agent"},{id:"web",label:"网络",ready:r&&s.has("web"),description:"通过 web_search 工具检索",unavailableLabel:i(" web_search 工具")},{id:"knowledge",label:"知识库",ready:r&&s.has("knowledge"),unavailableLabel:i("知识库")},{id:"memory",label:"长期记忆",ready:r&&s.has("memory"),unavailableLabel:i("长期记忆")}]}function vp(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function RN(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function pZ({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var U,C;const[a,o]=v.useState("session"),[l,u]=v.useState(""),[d,f]=v.useState([]),[h,p]=v.useState(),[m,y]=v.useState(!1),[w,g]=v.useState(!1),[E,b]=v.useState(!1),_=v.useRef(0),N=v.useRef(null),T=hZ(t,n,r),A=T.find(L=>L.id===a),k=a==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(L=>L.source==="knowledgebase"||L.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(L=>L.source==="long_term_memory"||L.kind==="memory"):void 0;v.useEffect(()=>{_.current+=1,o("session"),f([]),p(void 0),g(!1),y(!1),b(!1)},[t]),v.useEffect(()=>{if(!E)return;function L(O){var j;(j=N.current)!=null&&j.contains(O.target)||b(!1)}return document.addEventListener("pointerdown",L),()=>document.removeEventListener("pointerdown",L)},[E]);async function R(L,O){var V;const j=L.trim();if(!j||!((V=T.find(D=>D.id===O))!=null&&V.ready))return;const S=++_.current;y(!0),g(!0);let H;try{H=await uZ(O,j,{userId:e,appId:t})}catch(D){const ne=D instanceof Error?D.message:String(D);H={results:[],note:`搜索失败:${ne}`}}S===_.current&&(f(H.results),p(H.note),y(!1))}function I(L){_.current+=1,u(L),f([]),p(void 0),g(!1),y(!1)}function M(L){_.current+=1,o(L),b(!1),f([]),p(void 0),g(!1),y(!1)}const B=!!(A!=null&&A.ready),Y=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(k==null?void 0:k.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(k==null?void 0:k.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",P=k!=null&&k.backend?vp(k.backend):"";return c.jsxs("div",{className:"search",children:[c.jsxs("div",{className:"search-box",children:[c.jsxs("div",{className:"search-source-picker-wrap",ref:N,children:[c.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(A==null?void 0:A.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":E,onClick:()=>b(L=>!L),children:[c.jsx("span",{children:(A==null?void 0:A.label)??"搜索类型"}),P&&c.jsx("small",{children:P}),c.jsx(dZ,{open:E})]}),E&&c.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:T.map(L=>{var S,H;const O=L.id==="knowledge"?(S=n==null?void 0:n.components)==null?void 0:S.find(V=>V.source==="knowledgebase"||V.kind==="knowledgebase"):L.id==="memory"?(H=n==null?void 0:n.components)==null?void 0:H.find(V=>V.source==="long_term_memory"||V.kind==="memory"):void 0,j=O?[O.name,O.backend?vp(O.backend):""].filter(Boolean).join(" · "):L.ready?L.description:L.unavailableLabel;return c.jsxs("button",{type:"button",role:"option","aria-selected":a===L.id,disabled:!L.ready,onClick:()=>M(L.id),children:[c.jsx("span",{children:L.label}),j&&c.jsx("small",{children:j})]},L.id)})})]}),c.jsx("span",{className:"search-box-divider","aria-hidden":!0}),c.jsx("input",{className:"search-input",value:l,onChange:L=>I(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),R(l,a))},placeholder:Y,disabled:!B,autoFocus:!0}),c.jsx("button",{className:"search-go",onClick:()=>void R(l,a),disabled:!l.trim()||m,"aria-label":"搜索",children:m?c.jsx(bt,{className:"icon spin"}):c.jsx($L,{className:"icon"})})]}),c.jsx("div",{className:"search-results",children:B?w?m?null:h?c.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?c.jsxs("div",{className:"search-empty",children:["未找到匹配「",l.trim(),"」的结果。"]}):d.map((L,O)=>c.jsx(mZ,{result:L,agentLabel:s,onOpen:i},O)):c.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):c.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(A==null?void 0:A.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function mZ({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return c.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[c.jsx(LI,{className:"search-result-icon"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsx("span",{className:"search-result-title",children:e.title}),c.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${RN(e.ts)}`:""]})]}),c.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return c.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[c.jsx(um,{className:"search-result-icon"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsx("span",{className:"search-result-title",children:e.title||e.url}),c.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&c.jsx(kE,{className:"search-result-ext"})]})]}),e.summary&&c.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return c.jsxs("div",{className:"search-result search-result-static",children:[c.jsx(ON,{source:"knowledge"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),c.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${vp(e.sourceType)}`:""]})]}),c.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return c.jsxs("div",{className:"search-result search-result-static",children:[c.jsx(ON,{source:"memory"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),c.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${vp(e.sourceType)}`:"",e.ts?` · ${RN(e.ts)}`:""]})]}),c.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function ON({source:e,className:t="search-result-icon"}){return e==="knowledge"?c.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),c.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):c.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),c.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}const HL="veadk_agentkit_connections";function Zs(){try{const e=localStorage.getItem(HL);return e?JSON.parse(e):[]}catch{return[]}}function km(e){try{localStorage.setItem(HL,JSON.stringify(e))}catch{}}function Ka(e,t){return`agentkit:${e}:${t}`}function zL(e){try{return new URL(e).host}catch{return e}}function Kl(e){UI();for(const t of e)for(const n of t.apps)FI(Ka(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function VL(e,t,n,r,s){const i={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s},a=[...Zs().filter(o=>o.runtimeId!==e),i];return km(a),Kl(a),i}async function cx(e,t,n){let r;try{r=await tR(e,n)}catch(a){throw a instanceof fd&&S1(e),a}if(!r||r.length===0)throw S1(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const s=Object.fromEntries(r.map(a=>[a,t])),i=VL(e,t,n,r,s);return Ka(i.id,r[0])}async function KL(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await hm(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||zL(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},o=[...Zs().filter(l=>l.base!==s),a];return km(o),Kl(o),a}function gZ(e){const t=Zs().filter(n=>n.id!==e);return km(t),Kl(t),t}function S1(e){const t=Zs().filter(n=>n.runtimeId!==e);return km(t),Kl(t),t}function YL(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var o;const a=((o=s.appLabels)==null?void 0:o[i])??i;return{id:Ka(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:zL(s.base??"")}}));return[...n,...r]}const LN=Object.freeze(Object.defineProperty({__proto__:null,addConnection:KL,addRuntimeConnection:VL,buildAgentEntries:YL,connectRuntime:cx,loadConnections:Zs,registerConnections:Kl,remoteAppId:Ka,removeConnection:gZ,removeRuntimeConnection:S1},Symbol.toStringTag,{value:"Module"}));function Hu({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),c.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),c.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),c.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),c.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),c.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),c.jsx("path",{d:"m12 7.55 1.28 3.17L16.45 12l-3.17 1.28L12 16.45l-1.28-3.17L7.55 12l3.17-1.28L12 7.55Z",fill:"currentColor",stroke:"none"})]})}function yZ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),c.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),c.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),c.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function bZ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m4.7 7.2 7.3-3 7.3 3-7.3 3.1Z"}),c.jsx("path",{d:"M7.2 9.2v4.2c0 1.7 2.15 3.05 4.8 3.05s4.8-1.35 4.8-3.05V9.2"}),c.jsx("path",{d:"M19.3 7.2v5.25"}),c.jsx("circle",{cx:"19.3",cy:"14.4",r:"1.15",fill:"currentColor",stroke:"none"})]})}function WL({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),c.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),c.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),c.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),c.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const MN=15,EZ=1e4,xZ=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function wZ(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function qL(e){const t=e.toLowerCase();return t.includes("invalidagentkitruntime.notfound")||t.includes("specified agentkitruntime does not exist")?"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。":t.includes("accessdenied")||t.includes("forbidden")||t.includes("permission")||t.includes("(401)")||t.includes("(403)")?"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。":t.includes("agent-info failed: 404")||t.includes("读取 agent 列表失败 (404)")?"该 Agent Server 版本暂不支持信息预览。":"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。"}function l0(e,t=EZ){return new Promise((n,r)=>{const s=setTimeout(()=>r(new Error("加载超时,请重试")),t);e.then(i=>{clearTimeout(s),n(i)},i=>{clearTimeout(s),r(i)})})}function vZ({open:e,onClose:t,anchorTop:n=0,agentsSource:r,localApps:s,currentId:i,currentRuntime:a,runtimeScope:o,onSelect:l}){const[u,d]=v.useState([]),[f,h]=v.useState([""]),[p,m]=v.useState(0),[y,w]=v.useState(o==="mine"),[g,E]=v.useState(null),[b,_]=v.useState("cn-beijing"),[N,T]=v.useState(!1),[A,k]=v.useState(""),[R,I]=v.useState(""),[M,B]=v.useState(null),[Y,P]=v.useState(new Set),[U,C]=v.useState(),[L,O]=v.useState("agent"),j=v.useRef(!1);function S(W){C(oe=>(oe==null?void 0:oe.runtimeId)===W.runtimeId?void 0:{runtimeId:W.runtimeId,name:W.name,region:W.region})}const H=v.useCallback(async W=>{if(u[W]){m(W);return}const oe=f[W];if(oe!==void 0){T(!0),k("");try{const he=await l0(dh({nextToken:oe,pageSize:MN,region:b,scope:"all"}));d(J=>{const ce=[...J];return ce[W]=he.runtimes,ce}),h(J=>{const ce=[...J];return he.nextToken&&(ce[W+1]=he.nextToken),ce}),m(W)}catch(he){k(he instanceof Error?he.message:String(he))}finally{T(!1)}}},[f,u,b]),V=v.useCallback(async()=>{T(!0),k("");try{const W=[];let oe="";do{const he=await l0(dh({scope:"mine",nextToken:oe,pageSize:100,region:b}));W.push(...he.runtimes),oe=he.nextToken}while(oe&&W.length<2e3);E(W)}catch(W){k(W instanceof Error?W.message:String(W))}finally{T(!1)}},[b]);v.useEffect(()=>{w(o==="mine"),d([]),h([""]),m(0),E(null),j.current=!1},[o]),v.useEffect(()=>{e&&r==="cloud"&&!y&&!j.current&&(j.current=!0,H(0))},[e,r,y,H]),v.useEffect(()=>{y&&g===null&&r==="cloud"&&V()},[y,g,r,V]),v.useEffect(()=>{e&&(C(void 0),O("agent"))},[e]);function D(){P(new Set),y?(E(null),V()):(d([]),h([""]),m(0),j.current=!0,T(!0),k(""),l0(dh({nextToken:"",pageSize:MN,region:b,scope:"all"})).then(W=>{d([W.runtimes]),h(W.nextToken?["",W.nextToken]:[""])}).catch(W=>k(W instanceof Error?W.message:String(W))).finally(()=>T(!1)))}function ne(W){W!==b&&(_(W),d([]),h([""]),m(0),E(null),P(new Set),j.current=!1)}const ee=!y&&(u[p+1]!==void 0||f[p+1]!==void 0);function re(W){B(W.runtimeId),cx(W.runtimeId,W.name,W.region).then(oe=>{l(oe),t()}).catch(oe=>{if(oe instanceof fd){k(oe.message);return}if(oe instanceof Lu){oe.unsupported&&P(he=>new Set(he).add(W.runtimeId)),k(oe.message);return}P(he=>new Set(he).add(W.runtimeId))}).finally(()=>B(null))}if(!e)return null;const G=(y?g??[]:u[p]??[]).filter(W=>R?W.name.toLowerCase().includes(R.toLowerCase()):!0);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:t}),c.jsxs("div",{className:`agentsel ${U?"has-detail":""}`,role:"dialog","aria-label":"选择 Agent",style:{top:n,height:`min(640px, calc(100dvh - ${n}px - 10px))`},children:[c.jsxs("div",{className:"agentsel-main",children:[c.jsxs("div",{className:"agentsel-head",children:[c.jsxs("span",{className:"agentsel-title",children:[c.jsx(Hu,{})," 选择 Agent"]}),c.jsxs("div",{className:"agentsel-head-actions",children:[r==="cloud"&&c.jsx("button",{className:"agentsel-refresh",onClick:D,title:"刷新",disabled:N,children:c.jsx(dm,{className:`icon ${N?"spin":""}`})}),c.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:c.jsx(Xr,{className:"icon"})})]})]}),r==="local"?c.jsx("div",{className:"agentsel-body",children:s.length===0?c.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):c.jsx("ul",{className:"agentsel-list",children:s.map(W=>c.jsx("li",{children:c.jsxs("button",{className:`agentsel-item ${W===i?"active":""}`,onClick:()=>{l(W),t()},children:[c.jsx(Hu,{}),c.jsx("span",{className:"agentsel-item-name",children:W})]})},W))})}):c.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[c.jsxs("div",{className:"agentsel-tools",children:[c.jsxs("div",{className:"agentsel-search",children:[c.jsx(t1,{className:"icon"}),c.jsx("input",{value:R,onChange:W=>I(W.target.value),placeholder:"搜索 Runtime 名称"})]}),c.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:xZ.map(W=>c.jsx("button",{type:"button",className:b===W.value?"active":"","aria-pressed":b===W.value,onClick:()=>ne(W.value),children:W.label},W.value))}),o==="all"&&c.jsxs("label",{className:"agentsel-mine",children:[c.jsx("input",{type:"checkbox",checked:y,onChange:W=>w(W.target.checked)}),"只看我创建的"]})]}),A&&c.jsx("div",{className:"agentsel-error",children:A}),c.jsxs("div",{className:"agentsel-listwrap",children:[G.length===0&&!N?c.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):c.jsx("ul",{className:"agentsel-list",children:G.map(W=>{const oe=Y.has(W.runtimeId),he=M===W.runtimeId,J=(a==null?void 0:a.runtimeId)===W.runtimeId,ce=(U==null?void 0:U.runtimeId)===W.runtimeId;return c.jsx("li",{children:c.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${J?"active":""} ${ce?"is-previewed":""}`,title:W.runtimeId,children:[c.jsx(WL,{}),c.jsxs("div",{className:"agentsel-item-main",children:[c.jsx("span",{className:"agentsel-item-name",title:W.name,children:W.name}),c.jsxs("div",{className:"agentsel-item-meta",children:[c.jsx("span",{className:`agentsel-status is-${oe?"bad":CZ(W.status)}`,children:oe?"不支持":GL(W.status)}),W.isMine&&c.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),c.jsxs("div",{className:"agentsel-item-actions",children:[c.jsx("button",{type:"button",className:"agentsel-connect",disabled:he||J,onClick:()=>re(W),children:he?"连接中…":J?"已连接":oe?"重试":"连接"}),c.jsx("button",{type:"button",className:`agentsel-info ${ce?"active":""}`,"aria-label":`查看 ${W.name} 信息`,"aria-pressed":ce,title:"查看信息",onClick:()=>S(W),children:c.jsx(Bl,{className:"icon"})})]})]})},W.runtimeId)})}),N&&c.jsxs("div",{className:"agentsel-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]})]}),c.jsxs("div",{className:"agentsel-pager",children:[c.jsx("button",{disabled:y||p===0||N,onClick:()=>void H(p-1),"aria-label":"上一页",children:c.jsx(lF,{className:"icon"})}),c.jsx("span",{className:"agentsel-pager-label",children:y?1:p+1}),c.jsx("button",{disabled:y||!ee||N,onClick:()=>void H(p+1),"aria-label":"下一页",children:c.jsx(Xn,{className:"icon"})})]})]})]}),r==="cloud"&&U&&c.jsx(kZ,{runtime:U,tab:L,onTabChange:O})]})]})}const _Z={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function TZ(e){return _Z[e.toLowerCase()]??e}function NZ(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function kZ({runtime:e,tab:t,onTabChange:n}){return c.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[c.jsx("div",{className:"agentsel-head agentsel-preview-head",children:c.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[c.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),c.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),c.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),c.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:c.jsx(SZ,{runtime:e})}),c.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:c.jsx(AZ,{runtime:e})})]})}function SZ({runtime:e}){const[t,n]=v.useState(null),[r,s]=v.useState(!0),[i,a]=v.useState(""),o=e.runtimeId,l=e.region;v.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),WI(o,l).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(qL(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[o,l]);const u=(t==null?void 0:t.components)??[];return c.jsx("div",{className:"agentsel-detail-body",children:r?c.jsxs("div",{className:"agentsel-panel-state",children:[c.jsx(bt,{className:"icon spin"})," 读取 Agent 信息…"]}):i?c.jsxs("div",{className:"agentsel-panel-empty",children:[c.jsx("span",{children:"暂时无法读取 Agent 信息"}),c.jsx("small",{title:i,children:i})]}):t?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"agentsel-identity",children:[c.jsx(Hu,{className:"agentsel-identity-icon"}),c.jsxs("div",{className:"agentsel-identity-copy",children:[c.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&c.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsx("h3",{children:"描述"}),c.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&c.jsx(DN,{icon:c.jsx(MI,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&c.jsx(DN,{icon:c.jsx(yZ,{}),title:"工具",values:t.tools}),t.skills.length>0&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[c.jsx(bZ,{})," 技能"]}),c.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>c.jsxs("div",{className:"agentsel-info-list-item",children:[c.jsx("strong",{title:d.name,children:d.name}),d.description&&c.jsx("span",{title:d.description,children:d.description})]},d.name))})]}),u.length>0&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[c.jsx(_I,{className:"icon"})," 挂载组件"]}),c.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>c.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[c.jsxs("div",{className:"agentsel-component-head",children:[c.jsx("strong",{title:d.name,children:d.name}),c.jsxs("span",{children:[TZ(d.kind),d.backend?` · ${NZ(d.backend)}`:""]})]}),d.description&&c.jsx("span",{title:d.description,children:d.description})]},`${d.kind}:${d.name}:${f}`))})]}),!t.description&&t.subAgents.length===0&&t.tools.length===0&&t.skills.length===0&&u.length===0&&c.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function DN({icon:e,title:t,values:n}){return c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[e,t]}),c.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>c.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function AZ({runtime:e}){const[t,n]=v.useState(null),[r,s]=v.useState(!0),[i,a]=v.useState(""),o=e.runtimeId,l=e.region;v.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),ME(o,l).then(f=>d&&n(f)).catch(f=>d&&a(qL(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[o,l]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",GL(t.status)]),t.region&&u.push(["区域",wZ(t.region)]);const d=t.resources,f=[d.cpuMilli!=null?`CPU ${d.cpuMilli}m`:"",d.memoryMb!=null?`内存 ${d.memoryMb}MB`:"",d.minInstance!=null||d.maxInstance!=null?`实例 ${d.minInstance??"?"}~${d.maxInstance??"?"}`:""].filter(Boolean).join(" · ");f&&u.push(["资源",f]),t.currentVersion!=null&&u.push(["版本",String(t.currentVersion)])}return c.jsxs("div",{className:"agentsel-detail-body",children:[c.jsxs("div",{className:"agentsel-runtime-identity",children:[c.jsx(WL,{}),c.jsxs("div",{children:[c.jsx("strong",{title:e.name,children:e.name}),c.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?c.jsxs("div",{className:"agentsel-apps-note",children:[c.jsx(bt,{className:"icon spin"})," 读取详情…"]}):i?c.jsx("div",{className:"agentsel-error",children:i}):t?c.jsxs(c.Fragment,{children:[c.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>c.jsxs("div",{className:"agentsel-kv-row",children:[c.jsx("dt",{children:d}),c.jsx("dd",{children:f})]},d))}),t.envs.length>0&&c.jsxs("div",{className:"agentsel-envs",children:[c.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>c.jsxs("div",{className:"agentsel-env",children:[c.jsx("span",{className:"agentsel-env-k",children:d.key}),c.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function CZ(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}const IZ={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function GL(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return IZ[t]??(e||"-")}const ux="/assets/volcengine-DM14a-L-.svg",PN="(max-width: 860px)",RZ=54;function OZ(){return c.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M12.5 3 5.5 13h5l-1 8 8-11h-5l.5-7z",fill:"currentColor",stroke:"none"}),c.jsx("path",{d:"M19 4.5v3M17.5 6h3",opacity:"0.85"})]})}function LZ(){return c.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("circle",{cx:"8.25",cy:"7.75",r:"3.15"}),c.jsx("path",{d:"M2.9 19.2c.45-3.45 2.48-5.35 5.35-5.35 2.4 0 4.2 1.28 4.98 3.66"}),c.jsx("path",{d:"M17.4 4.5v15M14.8 9h5.2M14.8 15.3h5.2"}),c.jsx("circle",{cx:"17.4",cy:"9",r:"1.15",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"17.4",cy:"15.3",r:"1.15",fill:"currentColor",stroke:"none"})]})}function MZ(e){let t=2166136261;for(const r of e)t^=r.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const DZ={admin:"管理员",developer:"开发者",user:"普通用户"};function jN({role:e}){const t=DZ[e];return c.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function PZ({access:e,userInfo:t,onLogout:n}){const[r,s]=v.useState(!1),[i,a]=v.useState("");if(!t)return null;const o=JF(t),l=typeof t.email=="string"?t.email:"",u=(o||"U").slice(0,1).toUpperCase(),d=MZ(o||l||u),f=eU(t),h=f===i?"":f;return c.jsxs("div",{className:"sidebar-user",children:[c.jsxs("button",{className:"sidebar-user-btn",onClick:()=>s(p=>!p),title:l?`${o} -${l}`:o,children:[c.jsxs("span",{className:`account-avatar${h?" has-image":""}`,style:d,children:[u,h?c.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),c.jsxs("span",{className:"sidebar-user-identity",children:[c.jsxs("span",{className:"sidebar-user-primary",children:[c.jsx("span",{className:"sidebar-user-name",children:o}),c.jsx(jN,{role:e.role})]}),l&&l!==o&&c.jsx("span",{className:"sidebar-user-email",children:l})]})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>s(!1)}),c.jsxs("div",{className:"account-pop sidebar-user-pop",children:[c.jsxs("div",{className:"account-head",children:[c.jsxs("span",{className:`account-avatar account-avatar--lg${h?" has-image":""}`,style:d,children:[u,h?c.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),c.jsxs("div",{className:"account-id",children:[c.jsxs("div",{className:"account-name-row",children:[c.jsx("div",{className:"account-name",children:o}),c.jsx(jN,{role:e.role})]}),l&&l!==o&&c.jsx("div",{className:"account-sub",children:l})]})]}),c.jsxs("button",{className:"account-logout",onClick:()=>{s(!1),n()},children:[c.jsx(AF,{className:"icon"})," 退出登录"]})]})]})]})}function jZ({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,agentsSource:a="local",localApps:o=[],currentAgentId:l="",currentAgentLabel:u="",currentRuntime:d,onSelectAgent:f,onNewChat:h,onSearch:p,onQuickCreate:m,onSkillCenter:y,onAddAgent:w,onManageAgents:g,onPickSession:E,onDeleteSession:b,userInfo:_,onLogout:N}){const T=L=>(r==null?void 0:r[L])!==!1,[A,k]=v.useState(null),[R,I]=v.useState(!1),M=v.useRef(typeof window<"u"&&window.matchMedia(PN).matches),[B,Y]=v.useState(M.current),P=()=>{I(L=>!L)},U=[...t].sort((L,O)=>(O.lastUpdateTime??0)-(L.lastUpdateTime??0)),C=()=>{M.current=!1,Y(L=>!L),I(!1),k(null)};return v.useEffect(()=>{const L=window.matchMedia(PN),O=j=>{j.matches?Y(S=>S||(M.current=!0,!0)):M.current&&(M.current=!1,Y(!1))};return L.addEventListener("change",O),()=>L.removeEventListener("change",O)},[]),c.jsxs("aside",{className:`sidebar ${B?"is-collapsed":""}`,children:[c.jsxs("div",{className:"sidebar-top",children:[c.jsxs("div",{className:"sidebar-brand-row",children:[c.jsxs("div",{className:"brand",children:[c.jsx("img",{className:"brand-logo",src:e.logoUrl||ux,width:20,height:20,alt:"","aria-hidden":!0}),c.jsx("span",{className:"brand-title",children:e.title})]}),c.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:C,"aria-label":B?"展开侧边栏":"收起侧边栏",title:B?"展开侧边栏":"收起侧边栏",children:B?c.jsx(LF,{className:"icon"}):c.jsx(OF,{className:"icon"})})]}),f&&(()=>{const L=a==="cloud"&&!l,O=a==="cloud"&&!L&&!!d,j=a==="cloud"&&!L&&(d!=null&&d.region)?d.region==="cn-beijing"?"北京":d.region==="cn-shanghai"?"上海":d.region:"";return c.jsxs("button",{className:`agent-row ${L?"agent-row--empty":""} ${O?"agent-row--connected":""}`,onClick:P,"aria-label":L?"请选择 Agent":u||"选择 Agent",title:"切换 Agent",children:[c.jsx(Hu,{className:"icon agent-row-lead"}),c.jsx("span",{className:"agent-row-name",children:L?"请选择 Agent":u||"选择 Agent"}),j&&c.jsx("span",{className:"agent-row-region",children:j}),c.jsx(Xn,{className:`icon agent-row-chev ${R?"open":""}`})]})})(),f&&c.jsx(vZ,{open:R,onClose:()=>I(!1),anchorTop:RZ,agentsSource:a,localApps:o,currentId:l,currentRuntime:d,runtimeScope:s.capabilities.runtimeScope,onSelect:f}),T("newChat")&&c.jsxs("button",{className:"new-chat",onClick:h,"aria-label":"新会话",title:"新会话",children:[c.jsx(ms,{className:"icon"}),c.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),T("search")&&c.jsx(fZ,{onClick:p}),T("skillCenter")&&c.jsx(tZ,{onClick:y}),s.capabilities.createAgents&&T("addAgent")&&c.jsxs("button",{className:"new-chat",onClick:m,"aria-label":"添加 Agent",title:"添加 Agent",children:[c.jsx(OZ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"添加 Agent"})]}),s.capabilities.manageAgents&&T("manageAgents")&&c.jsxs("button",{className:"new-chat",onClick:g,"aria-label":"管理 Agent",title:"管理 Agent",children:[c.jsx(LZ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"管理 Agent"})]})]}),T("history")&&c.jsxs("div",{className:"sidebar-history",children:[c.jsxs("div",{className:"history-head",children:[c.jsx("span",{children:"历史会话"}),T("newChat")&&c.jsx("button",{type:"button",className:"history-new-chat",onClick:h,"aria-label":"新建会话",title:"新建会话",children:c.jsx(ms,{className:"icon"})})]}),c.jsxs("div",{className:"history-list",children:[U.length===0&&c.jsx("div",{className:"history-empty",children:"暂无会话"}),U.map(L=>{const O=oR(L.events);return c.jsxs("div",{className:`history-item ${L.id===n?"active":""}`,children:[c.jsxs("button",{className:"history-item-btn",onClick:()=>E(L.id),title:O,children:[(i==null?void 0:i.has(L.id))&&c.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),c.jsx("span",{className:"history-title",children:O})]}),c.jsx("button",{className:"history-more",title:"更多",onClick:()=>k(j=>j===L.id?null:L.id),children:c.jsx(fF,{className:"icon"})}),A===L.id&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>k(null)}),c.jsx("div",{className:"history-menu",children:c.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{k(null),b(L.id)},children:[c.jsx(Fl,{className:"icon"})," 删除"]})})]})]},L.id)})]})]}),c.jsx(PZ,{access:s,userInfo:_,onLogout:N})]})}function BZ({apps:e,appName:t,onAppChange:n,agentLabel:r,title:s,crumbs:i,rightContent:a}){return c.jsxs("div",{className:"navbar",children:[c.jsxs("div",{className:"navbar-left",children:[c.jsx("div",{className:"navbar-default",children:i&&i.length>0?c.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:i.map((o,l)=>c.jsxs(v.Fragment,{children:[l>0&&c.jsx(Xn,{className:"crumb-sep"}),o.onClick?c.jsx("button",{className:"crumb crumb-link",onClick:o.onClick,children:o.label}):c.jsx("span",{className:"crumb crumb-current",children:o.label})]},l))}):s?c.jsx("div",{className:"navbar-title",title:s,children:s}):c.jsx(FZ,{apps:e,appName:t,onAppChange:n,agentLabel:r})}),c.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),c.jsxs("div",{className:"navbar-right",children:[c.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),a]})]})}function FZ({apps:e,appName:t,onAppChange:n,agentLabel:r}){const[s,i]=v.useState(!1),[a,o]=v.useState(null),[l,u]=v.useState({}),[d,f]=v.useState(0),h=v.useRef({}),p=w=>r?r(w):w;function m(w){o(w);const g=h.current[w];if(g){const E=g.getBoundingClientRect(),b=g.closest(".agent-dd");if(b){const _=b.getBoundingClientRect();f(E.top-_.top)}}l[w]===void 0&&(u(E=>({...E,[w]:"loading"})),hd(w).then(E=>u(b=>({...b,[w]:E}))).catch(()=>u(E=>({...E,[w]:"error"}))))}function y(){i(!1),o(null)}return c.jsxs("div",{className:"agent-dd",children:[c.jsxs("button",{className:"agent-dd-trigger",onClick:()=>i(w=>!w),children:[c.jsx("span",{className:"agent-dd-current",children:t?p(t):"选择 Agent"}),c.jsx(op,{className:`agent-dd-chev ${s?"open":""}`})]}),s&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:y}),c.jsx("div",{className:"agent-dd-menu",children:e.map(w=>c.jsx("div",{ref:g=>h.current[w]=g,className:"agent-dd-row",onMouseEnter:()=>m(w),onMouseLeave:()=>o(g=>g===w?null:g),children:c.jsxs("button",{className:`agent-dd-item ${w===t?"active":""}`,onClick:()=>{n(w),y()},children:[c.jsx("span",{className:"agent-dd-item-name",children:p(w)}),w===t&&c.jsx("span",{className:"agent-dd-item-dot","aria-label":"当前"})]})},w))}),a&&c.jsx(UZ,{state:l[a],top:d})]})]})}function UZ({state:e,top:t}){return c.jsx("div",{className:"agent-dd-flyout",style:{top:`${t}px`},children:e===void 0||e==="loading"?c.jsxs("div",{className:"agent-dd-fly-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]}):e==="error"?c.jsx("div",{className:"agent-dd-fly-loading",children:"读取信息失败"}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"agent-dd-fly-name",children:e.name}),e.description&&c.jsx("div",{className:"agent-dd-fly-desc",children:e.description}),c.jsxs("div",{className:"agent-dd-fly-field",children:[c.jsx(NI,{className:"icon"}),c.jsx("span",{className:"agent-dd-fly-model",children:e.model})]}),e.tools.length>0&&c.jsxs("div",{className:"agent-dd-fly-field agent-dd-fly-field--tools",children:[c.jsx(CE,{className:"icon"}),c.jsx("div",{className:"agent-dd-fly-chips",children:e.tools.map(n=>c.jsx("span",{className:"agent-dd-chip",children:n},n))})]}),e.subAgents.length>0&&c.jsxs("div",{className:"agent-dd-fly-field",children:[c.jsx("span",{className:"agent-dd-fly-label",children:"子 Agent"}),c.jsx("span",{className:"agent-dd-fly-model",children:e.subAgents.join("、")})]})]})})}const BN={llm:{icon:Ha,label:"LLM"},sequential:{icon:II,label:"顺序"},parallel:{icon:PI,label:"并行"},loop:{icon:AE,label:"循环"},a2a:{icon:um,label:"A2A"}};function XL(e){return 1+e.children.reduce((t,n)=>t+XL(n),0)}function xl(e){return e.id||e.name}function $Z(e,t){const n=xl(e);if(e.id&&e.name&&e.name!==n)return e.name;if(t&&n==="agent")return"主 Agent";const r=/^agent_sub_(\d+)$/.exec(n);return r?`子 Agent ${r[1]}`:e.name||n}function QL(e,t=!0){return{...e,id:xl(e),name:$Z(e,t),children:e.children.map(n=>QL(n,!1))}}function ZL(e,t){t.set(xl(e),e.name||xl(e)),e.children.forEach(n=>ZL(n,t))}function JL({node:e,activeAgent:t,seen:n,path:r}){const s=BN[e.type]??BN.llm,i=s.icon,a=xl(e),o=!!a,l=o&&a===t,u=o&&!l&&r.has(a),d=o&&!l&&!u&&n.has(a);return c.jsxs("div",{className:"topo-branch",children:[c.jsxs("div",{className:`topo-node topo-type-${e.type} ${l?"is-active":""} ${u?"is-onpath":""} ${d?"is-done":""}`,title:e.description||e.name,children:[c.jsx(i,{className:"topo-icon"}),c.jsx("span",{className:"topo-name",children:e.name||"(未命名)"}),c.jsx("span",{className:"topo-badge",children:s.label})]}),l&&e.type==="a2a"&&c.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&c.jsx("div",{className:"topo-children",children:e.children.map((f,h)=>c.jsx(JL,{node:f,activeAgent:t,seen:n,path:r},`${xl(f)}-${h}`))})]})}function FN({appName:e,activeAgent:t,seenAgents:n,execPath:r=[]}){const[s,i]=v.useState(null);if(v.useEffect(()=>{let l=!1;if(i(null),!!e)return hd(e).then(u=>{l||i(u.graph?QL(u.graph):null)}).catch(()=>{l||i(null)}),()=>{l=!0}},[e]),!s||s.children.length===0)return null;const a=new Set(r),o=new Map;return ZL(s,o),c.jsxs("aside",{className:"topo","aria-label":"Agent 拓扑",children:[c.jsxs("div",{className:"topo-head",children:[c.jsx("span",{className:"topo-head-title",children:"Agent 拓扑"}),c.jsxs("span",{className:"topo-head-sub",children:[XL(s)," 个"]})]}),r.length>0&&c.jsx("div",{className:"topo-path","aria-label":"执行路径",children:r.map((l,u)=>c.jsxs("span",{className:"topo-path-seg",children:[u>0&&c.jsx(Xn,{className:"topo-path-sep"}),c.jsx("span",{className:u===r.length-1?"topo-path-name is-current":"topo-path-name",children:o.get(l)??l})]},`${l}-${u}`))}),c.jsx("div",{className:"topo-tree",children:c.jsx(JL,{node:s,activeAgent:t,seen:n,path:a})})]})}function HZ({onAdded:e,onCancel:t}){const[n,r]=v.useState(""),[s,i]=v.useState(""),[a,o]=v.useState(""),[l,u]=v.useState(!1),[d,f]=v.useState(""),h=n.trim().length>0&&s.trim().length>0&&!l;async function p(){if(h){u(!0),f("");try{const m=await KL(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(Ka(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return c.jsx("div",{className:"addagent",children:c.jsxs("div",{className:"addagent-card",children:[c.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),c.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),c.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"API Key"}),c.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),c.jsx("input",{className:"addagent-input",value:a,onChange:m=>o(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&c.jsx("div",{className:"addagent-error",children:d}),c.jsxs("div",{className:"addagent-actions",children:[c.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:l,children:"取消"}),c.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[l?c.jsx(bt,{className:"icon spin"}):null,l?"连接中…":"连接并添加"]})]})]})})}function zZ({currentRuntimeId:e,onConnect:t}){const[n,r]=v.useState([]),[s,i]=v.useState(!0),[a,o]=v.useState(""),[l,u]=v.useState(null),[d,f]=v.useState(null),[h,p]=v.useState(null),[m,y]=v.useState({}),[w,g]=v.useState("cn-beijing"),[E,b]=v.useState(!1),_=v.useCallback(async()=>{i(!0),o("");try{r(await QI(w))}catch(R){o(R instanceof Error?R.message:String(R))}finally{i(!1)}},[w]);v.useEffect(()=>{_()},[_]);async function N(R){y(M=>({...M,[R.runtimeId]:{loading:!0}}));const I={loading:!1};try{I.detail=await ME(R.runtimeId,R.region)}catch(M){I.error=M instanceof Error?M.message:String(M)}I.detail&&(I.graphs=[{name:I.detail.name,description:I.detail.description,type:"llm",model:I.detail.model,tools:[],skills:[],path:[I.detail.name],mentionable:!1,children:[]}],I.graphNote="仅显示主 Agent(控制面信息)。"),y(M=>({...M,[R.runtimeId]:I}))}function T(R){const I=h===R.runtimeId;p(I?null:R.runtimeId),!I&&!m[R.runtimeId]&&N(R)}async function A(R){if(!l&&window.confirm(`确定删除 Agent "${R.name}"?该 Runtime 将被永久删除。`)){u(R.runtimeId),o("");try{await nR(R.runtimeId,R.region),r(I=>I.filter(M=>M.runtimeId!==R.runtimeId))}catch(I){o(I instanceof Error?I.message:String(I))}finally{u(null)}}}async function k(R){if(!(d||e===R.runtimeId)){f(R.runtimeId),o("");try{await t(R)}catch(I){o(I instanceof Error?I.message:String(I))}finally{f(null)}}}return c.jsxs("div",{className:"manage",children:[c.jsxs("div",{className:"manage-head",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"manage-title",children:"管理 Agent"}),c.jsx("p",{className:"manage-sub",children:"列出你有权管理的 AgentKit Runtime"})]}),c.jsxs("div",{className:"manage-head-actions",children:[c.jsxs("div",{className:"manage-region-picker",onKeyDown:R=>{R.key==="Escape"&&b(!1)},children:[c.jsxs("button",{type:"button",className:"manage-region",onClick:()=>b(R=>!R),title:"按区域筛选","aria-label":"区域筛选","aria-haspopup":"listbox","aria-expanded":E,children:[c.jsx("span",{children:w==="cn-beijing"?"北京":"上海"}),c.jsx(op,{className:`manage-region-chevron${E?" is-open":""}`})]}),E&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>b(!1)}),c.jsx("div",{className:"manage-region-menu",role:"listbox","aria-label":"区域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(R=>{const I=R.value===w;return c.jsxs("button",{type:"button",role:"option","aria-selected":I,className:`manage-region-option${I?" is-selected":""}`,onClick:()=>{g(R.value),b(!1)},children:[c.jsx("span",{children:R.label}),I&&c.jsx(Bs,{"aria-hidden":"true"})]},R.value)})})]})]}),c.jsxs("button",{type:"button",className:"manage-refresh",onClick:()=>void _(),disabled:s,title:"刷新",children:[c.jsx(dm,{className:`icon ${s?"spin":""}`}),"刷新"]})]})]}),a&&c.jsx("div",{className:"manage-error",children:a}),s?c.jsxs("div",{className:"manage-empty",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]}):n.length===0?c.jsx("div",{className:"manage-empty",children:"暂无你部署的 Agent。"}):c.jsx("ul",{className:"manage-list",children:n.map(R=>{const I=h===R.runtimeId,M=m[R.runtimeId];return c.jsxs("li",{className:"manage-item",children:[c.jsxs("div",{className:"manage-item-row",children:[c.jsxs("button",{type:"button",className:"manage-item-toggle",onClick:()=>T(R),"aria-expanded":I,children:[I?c.jsx(op,{className:"icon"}):c.jsx(Xn,{className:"icon"}),c.jsxs("span",{className:"manage-item-main",children:[c.jsx("span",{className:"manage-item-name",children:R.name}),c.jsx("span",{className:`manage-badge is-${qZ(R.status)}`,children:R.status||"-"})]})]}),c.jsxs("div",{className:"manage-item-actions",children:[c.jsxs("button",{type:"button",className:"manage-connect",onClick:()=>void k(R),disabled:d!==null||e===R.runtimeId,children:[d===R.runtimeId?c.jsx(bt,{className:"icon spin"}):c.jsx(TF,{className:"icon"}),e===R.runtimeId?"已连接":"连接到此 Agent"]}),c.jsx("button",{type:"button",className:"manage-del",onClick:()=>void A(R),disabled:l===R.runtimeId,title:"删除该 Runtime",children:l===R.runtimeId?c.jsx(bt,{className:"icon spin"}):c.jsx(Fl,{className:"icon"})})]})]}),c.jsxs("div",{className:"manage-item-meta",children:[c.jsx("span",{className:"manage-item-id",title:R.runtimeId,children:R.runtimeId}),c.jsx("span",{className:"manage-item-dot",children:"·"}),c.jsx("span",{children:R.region}),R.createdAt&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"manage-item-dot",children:"·"}),c.jsx("span",{children:tM(R.createdAt)})]})]}),I&&c.jsx("div",{className:"manage-detail",children:!M||M.loading?c.jsxs("div",{className:"manage-detail-loading",children:[c.jsx(bt,{className:"icon spin"})," 读取详情…"]}):c.jsxs(c.Fragment,{children:[M.error&&c.jsx("div",{className:"manage-error",children:M.error}),M.detail&&c.jsx(YZ,{detail:M.detail}),c.jsx("div",{className:"manage-tree-head",children:"Agent 结构"}),M.graphs&&M.graphs.length>0?M.graphs.map((B,Y)=>c.jsx(eM,{node:B},Y)):c.jsx("div",{className:"manage-tree-note",children:M.graphNote})]})})]},R.runtimeId)})})]})}const VZ=/KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL/i;function KZ({envKey:e,value:t}){const[n,r]=v.useState(!1);return!VZ.test(e)||n?c.jsx("code",{className:"manage-env-v",children:t}):c.jsx("button",{type:"button",className:"manage-env-v manage-env-masked",title:"敏感值已隐藏,点击显示","aria-label":`显示 ${e} 的值`,onClick:()=>r(!0),children:"••••••••"})}function YZ({detail:e}){const t=e.resources,n=[];e.model&&n.push(["模型",e.model]),e.description&&n.push(["描述",e.description]),e.statusMessage&&n.push(["状态信息",e.statusMessage]),e.project&&n.push(["Project",e.project]),e.currentVersion!=null&&n.push(["版本",String(e.currentVersion)]);const r=[t.cpuMilli!=null?`CPU ${t.cpuMilli}m`:"",t.memoryMb!=null?`内存 ${t.memoryMb}MB`:"",t.minInstance!=null||t.maxInstance!=null?`实例 ${t.minInstance??"?"}~${t.maxInstance??"?"}`:"",t.maxConcurrency!=null?`并发 ${t.maxConcurrency}`:""].filter(Boolean).join(" · ");return r&&n.push(["资源",r]),e.memoryId&&n.push(["Memory",e.memoryId]),e.toolId&&n.push(["Tool",e.toolId]),e.knowledgeId&&n.push(["Knowledge",e.knowledgeId]),e.mcpToolsetId&&n.push(["MCP Toolset",e.mcpToolsetId]),e.updatedAt&&n.push(["更新时间",tM(e.updatedAt)]),c.jsxs("div",{className:"manage-detail-card",children:[c.jsx("dl",{className:"manage-kv",children:n.map(([s,i])=>c.jsxs("div",{className:"manage-kv-row",children:[c.jsx("dt",{children:s}),c.jsx("dd",{children:i})]},s))}),e.envs.length>0&&c.jsxs("div",{className:"manage-envs",children:[c.jsx("div",{className:"manage-envs-head",children:"环境变量"}),e.envs.map(s=>c.jsxs("div",{className:"manage-env",children:[c.jsx("code",{className:"manage-env-k",children:s.key}),c.jsx(KZ,{envKey:s.key,value:s.value})]},s.key))]})]})}const WZ={llm:"LLM",sequential:"Sequential",parallel:"Parallel",loop:"Loop",a2a:"A2A"};function eM({node:e,depth:t=0}){return c.jsxs("div",{className:"manage-tree",style:{marginLeft:t?16:0},children:[c.jsxs("div",{className:"manage-tree-node",children:[c.jsx("span",{className:"manage-tree-name",children:e.name||"(未命名)"}),c.jsx("span",{className:"manage-tree-type",children:WZ[e.type]||e.type}),e.model&&c.jsx("span",{className:"manage-tree-model",children:e.model})]}),e.tools.length>0&&c.jsx("div",{className:"manage-tree-tools",children:e.tools.map(n=>c.jsx("span",{className:"manage-tree-tool",children:n},n))}),e.children.map((n,r)=>c.jsx(eM,{node:n,depth:t+1},r))]})}function qZ(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}function tM(e){const t=Number(e),n=Number.isFinite(t)&&String(t)===e?new Date(t*1e3):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()}const GZ={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function XZ(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(const s of n){if(r==null||typeof r!="object")return;r=r[s]}return r}function QZ(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function ZZ(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dx(e,t){if(QZ(e))return XZ(t,e.path);if(ZZ(e)){const n=GZ[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=dx(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function JZ(e,t){const n=dx(e,t);return n==null?"":typeof n=="string"?n:String(n)}const nM=new Map;function io(e,t){nM.set(e,t)}function eJ(e){return nM.get(e)}function tJ(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;idx(r,e.dataModel),resolveString:r=>JZ(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=eJ(s.component)??nJ;return c.jsx(i,{node:s,ctx:n},r)}};return c.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function sM(e){const t=v.useRef(null),n=v.useRef(!0),r=28,s=v.useCallback(()=>{const i=t.current;i&&(n.current=i.scrollHeight-i.scrollTop-i.clientHeight{const i=t.current;i&&n.current&&(i.scrollTop=i.scrollHeight)},[e]),{ref:t,onScroll:s}}function fx({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:c.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>c.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[c.jsx(za,{"aria-hidden":!0}),c.jsxs("span",{children:["/",r.name]}),t?c.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:c.jsx(Xr,{})}):null]},r.name)),e.targetAgent?c.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[c.jsx(vI,{"aria-hidden":!0}),c.jsx("span",{children:e.targetAgent.name}),n?c.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:c.jsx(Xr,{})}):null]}):null]})}function hx(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function iM(e){var n,r,s,i;const t=hx(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((r=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:r.toUpperCase())??"VIDEO":t==="image"?((i=(s=e.mimeType)==null?void 0:s.split("/")[1])==null?void 0:i.toUpperCase())??"IMAGE":"TXT"}function aM(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function oM(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?VI(t,e.uri):""}function sJ({kind:e}){return e==="image"?c.jsx(RI,{}):e==="video"?c.jsx(AI,{}):e==="pdf"?c.jsx(gF,{}):c.jsx(SI,{})}function px({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=v.useState(null);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const o=hx(a.mimeType),l=oM(a,e),u=a.status==="uploading"||a.status==="error"||!l,d=c.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[o==="image"&&l?c.jsx("img",{className:"media-card-image",src:l,alt:a.name??"图片",loading:"lazy"}):o==="video"&&l?c.jsxs("div",{className:"media-card-video-container",children:[c.jsx("video",{className:"media-card-video",src:l,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),c.jsx("span",{className:"media-card-video-play",children:c.jsx(DF,{})})]}):c.jsx("span",{className:"media-card-icon",children:c.jsx(sJ,{kind:o})}),c.jsxs("span",{className:"media-card-copy",children:[c.jsx("span",{className:"media-card-name",children:a.name??"附件"}),c.jsxs("span",{className:"media-card-meta",children:[c.jsx("span",{className:"media-card-type",children:iM(a)}),a.status==="uploading"?c.jsxs(c.Fragment,{children:[c.jsx(bt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":aM(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?c.jsx(Gc,{className:"media-card-open"}):null]});return c.jsxs(Gt.div,{className:`media-card media-card--${o}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[o==="image"&&!u?c.jsx(yI,{src:l,children:d}):d,r?c.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:c.jsx(Xr,{})}):null]},a.id)})}),c.jsx(Hi,{children:s?c.jsx(iJ,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function iJ({appName:e,item:t,onClose:n}){const r=v.useMemo(()=>oM(t,e),[e,t]),s=hx(t.mimeType),[i,a]=v.useState(""),[o,l]=v.useState(s==="text"||s==="markdown"),[u,d]=v.useState("");return v.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),v.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const f=new AbortController;return l(!0),d(""),fetch(r,{signal:f.signal}).then(h=>{if(!h.ok)throw new Error(`HTTP ${h.status}`);return h.text()}).then(a).catch(h=>{f.signal.aborted||d(h instanceof Error?h.message:String(h))}).finally(()=>{f.signal.aborted||l(!1)}),()=>f.abort()},[s,r]),c.jsx(Gt.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":t.name??"附件预览",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&n()},children:c.jsxs(Gt.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[c.jsxs("header",{className:"media-viewer-header",children:[c.jsxs("div",{children:[c.jsx("strong",{children:t.name??"附件"}),c.jsxs("span",{children:[iM(t),t.sizeBytes?` · ${aM(t.sizeBytes)}`:""]})]}),c.jsxs("nav",{children:[c.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:c.jsx(NE,{})}),c.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:c.jsx(Xr,{})})]})]}),c.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?c.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?c.jsx("div",{className:"media-viewer-video-wrapper",children:c.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?c.jsx("iframe",{src:r,title:t.name??"PDF"}):null,o?c.jsxs("div",{className:"media-viewer-loading",children:[c.jsx(bt,{})," 正在读取文档…"]}):null,!o&&u?c.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!o&&s==="markdown"?c.jsx("div",{className:"media-document",children:c.jsx(_d,{text:i})}):null,!o&&s==="text"?c.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Yl({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const o=Math.min(Math.max(r,5),45);return c.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-o}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+o}%)`,animationDuration:`${n}s`},...a,children:s})}function aJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),c.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function oJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),c.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),c.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),c.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function lJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"3.25",y:"5.5",width:"16.25",height:"13",rx:"2.4"}),c.jsx("path",{d:"m10.2 9.2 4.4 2.8-4.4 2.8V9.2Z"}),c.jsx("path",{d:"m19.25 2.5.42 1.2 1.2.42-1.2.42-.42 1.2-.42-1.2-1.2-.42 1.2-.42.42-1.2Z",fill:"currentColor",stroke:"none"})]})}function cJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),c.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),c.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function uJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),c.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),c.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),c.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function lM(e){return c.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:c.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function dJ({definition:e,done:t,open:n,onToggle:r}){const s=e.icon;return c.jsxs("button",{type:"button",className:`builtin-tool-head${t?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":n,children:[c.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:c.jsx(s,{})}),t?c.jsx("span",{className:"builtin-tool-label",children:e.doneLabel}):c.jsx(Yl,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:e.runningLabel}),c.jsx(lM,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}const fJ={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:aJ},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:oJ},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:lJ},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:cJ},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:uJ}};function hJ(e){return fJ[e]}const cM="send_a2ui_json_to_client";function pJ({className:e}){return c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.jsx("path",{d:"M12 2.2l1.7 5.1a3 3 0 0 0 1.9 1.9L20.8 11l-5.1 1.7a3 3 0 0 0-1.9 1.9L12 19.8l-1.7-5.1a3 3 0 0 0-1.9-1.9L3.2 11l5.1-1.7a3 3 0 0 0 1.9-1.9L12 2.2z"})})}function mJ(){return c.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function uM({text:e,done:t}){const[n,r]=v.useState(!t),s=v.useRef(!1);v.useEffect(()=>{s.current||r(!t)},[t]);const i=()=>{s.current=!0,r(u=>!u)},a=e.replace(/^\s+/,""),{ref:o,onScroll:l}=sM(a);return c.jsxs("div",{className:"block-thinking",children:[c.jsxs("button",{className:"think-head",onClick:i,type:"button",children:[c.jsx("span",{className:"think-icon","aria-hidden":"true",children:c.jsx(pJ,{className:`spark ${t?"":"pulse"}`})}),t?c.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):c.jsx(Yl,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),c.jsx(Xn,{className:`chev ${n?"open":""}`})]}),c.jsx("div",{className:`think-collapse ${n&&a?"open":""}`,children:c.jsx("div",{className:"think-collapse-inner",children:c.jsx("div",{className:"think-body scroll",ref:o,onScroll:l,children:a})})})]})}function dM(){return c.jsx(uM,{text:"",done:!1})}function gJ({name:e,args:t,response:n,done:r}){const[s,i]=v.useState(!1),a=e===cM?"渲染 UI":e,o=hJ(e),l=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),u=l&&l.length>2e3?l.slice(0,2e3)+` -…(已截断)`:l;return c.jsxs(Gt.div,{className:`block-tool${o?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o?c.jsx(dJ,{definition:o,done:r,open:s,onToggle:()=>i(d=>!d)}):c.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[c.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:c.jsx(mJ,{})}),r?c.jsx("span",{className:"tool-name",children:a}):c.jsx(Yl,{className:"tool-name",duration:2.2,spread:15,children:a}),c.jsx(lM,{className:`tool-chevron${s?" is-open":""}`})]}),c.jsx("div",{className:`think-collapse ${s?"open":""}`,children:c.jsx("div",{className:"think-collapse-inner",children:c.jsxs("div",{className:"tool-detail",children:[t!=null&&c.jsxs("div",{className:"tool-section",children:[c.jsx("div",{className:"tool-section-label",children:"参数"}),c.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&c.jsxs("div",{className:"tool-section",children:[c.jsx("div",{className:"tool-section-label",children:"返回"}),c.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function yJ({block:e,onAuth:t}){const[n,r]=v.useState(e.done?"done":"idle"),[s,i]=v.useState(""),a=e.label||"MCP 工具集",o=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),l=async()=>{if(t){i(""),r("authorizing");try{await t(e),r("done")}catch(d){i(d instanceof Error?d.message:String(d)),r("idle")}}};return e.done||n==="done"?c.jsxs(Gt.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[c.jsx(F_,{className:"auth-card-icon auth-card-icon--done"}),c.jsxs("span",{children:["已授权 · ",a]})]}):c.jsxs(Gt.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[c.jsxs("div",{className:"auth-card-head",children:[c.jsx(F_,{className:"auth-card-icon"}),c.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),c.jsxs("p",{className:"auth-card-desc",children:["工具集 ",c.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",o&&c.jsxs(c.Fragment,{children:[" ","将跳转至 ",c.jsx("code",{className:"auth-card-code",children:o})," 完成登录,"]}),"授权完成后对话自动继续。"]}),c.jsx("button",{className:"auth-card-btn",onClick:l,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?c.jsxs(c.Fragment,{children:[c.jsx(bt,{className:"cw-i spin"})," 等待授权…"]}):c.jsx(c.Fragment,{children:"去授权"})}),!e.authUri&&c.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&c.jsx("div",{className:"auth-card-err",children:s})]})}function mx({blocks:e,appName:t="",onAction:n,onAuth:r}){return c.jsx(c.Fragment,{children:e.map((s,i)=>{switch(s.kind){case"thinking":return c.jsx(uM,{text:s.text,done:s.done},i);case"text":{const a=s.text.replace(/^\s+/,"");return a?c.jsx("div",{className:"bubble",children:c.jsx(_d,{text:a})},i):null}case"attachment":return c.jsx(px,{appName:t,items:s.files},i);case"invocation":return c.jsx(fx,{value:s.value},i);case"tool":return s.name===cM&&s.done?null:c.jsx(gJ,{name:s.name,args:s.args,response:s.response,done:s.done},i);case"auth":return c.jsx(yJ,{block:s,onAuth:r},i);case"a2ui":return rM(s.messages).filter(a=>a.components[a.rootId]).map(a=>c.jsx(Gt.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:c.jsx(rJ,{surface:a,onAction:n})},`${i}-${a.surfaceId}`));default:return null}})})}function bJ(e){return e.isComposing||e.keyCode===229}const _s=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"临时会话",description:"在 AgentKit 沙箱中执行一次性任务"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}];function UN({mode:e}){return e==="skill-create"?c.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M10 2.2l1.35 4.1 4.15 1.35-4.15 1.35L10 13.1 8.65 9 4.5 7.65 8.65 6.3 10 2.2Z"}),c.jsx("path",{d:"M15.6 12.2l.6 1.8 1.8.6-1.8.6-.6 1.8-.6-1.8-1.8-.6 1.8-.6.6-1.8Z"})]}):e==="temporary"?c.jsx("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M4.1 4.2h11.8v8.7H9l-3.5 2.8v-2.8H4.1z",strokeDasharray:"2.25 1.9"})}):c.jsx(Hu,{className:"new-chat-mode__agent-icon"})}function EJ({value:e,agentName:t,onChange:n,disabled:r=!1,temporaryEnabled:s,skillCreateEnabled:i}){const[a,o]=v.useState(!1),[l,u]=v.useState(()=>_s.findIndex(E=>E.value===e)),d=v.useRef(null),f=v.useRef(null),h=_s.find(E=>E.value===e)??_s[0];function p(E){return E.value==="temporary"?s:E.value==="skill-create"?i:!0}function m(E){return p(E)!==!0}function y(E){const b=p(E);return b===void 0?"正在检查配置":b?E.description:"管理员未配置"}v.useEffect(()=>{if(!a)return;const E=b=>{var _;(_=d.current)!=null&&_.contains(b.target)||o(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[a]);function w(E){let b=l;do b=(b+E+_s.length)%_s.length;while(m(_s[b]));u(b)}function g(E){var b;m(E)||(n(E.value),o(!1),(b=f.current)==null||b.focus())}return c.jsxs("div",{className:"new-chat-mode",ref:d,children:[c.jsxs("button",{ref:f,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":a,disabled:r,onClick:()=>{u(_s.findIndex(E=>E.value===e)),o(E=>!E)},onKeyDown:E=>{E.key==="ArrowDown"||E.key==="ArrowUp"?(E.preventDefault(),a?w(E.key==="ArrowDown"?1:-1):o(!0)):a&&(E.key==="Enter"||E.key===" ")?(E.preventDefault(),g(_s[l])):a&&E.key==="Escape"&&(E.preventDefault(),o(!1))},children:[c.jsx("span",{className:"new-chat-mode__icon",children:c.jsx(UN,{mode:h.value})}),c.jsx("span",{className:"new-chat-mode__current",title:h.value==="agent"?t:void 0,children:h.value==="agent"?t:h.label}),c.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:c.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),a?c.jsx("div",{className:"new-chat-mode__menu",role:"listbox","aria-label":"新会话模式",tabIndex:-1,onKeyDown:E=>{var b;E.key==="ArrowDown"||E.key==="ArrowUp"?(E.preventDefault(),w(E.key==="ArrowDown"?1:-1)):E.key==="Enter"?(E.preventDefault(),g(_s[l])):E.key==="Escape"&&(E.preventDefault(),o(!1),(b=f.current)==null||b.focus())},children:_s.map((E,b)=>c.jsxs("button",{type:"button",role:"option","aria-selected":e===E.value,"aria-disabled":m(E),disabled:m(E),className:`new-chat-mode__option${b===l?" is-active":""}`,onMouseEnter:()=>u(b),onClick:()=>g(E),children:[c.jsx("span",{className:"new-chat-mode__option-icon",children:c.jsx(UN,{mode:E.value})}),c.jsxs("span",{className:"new-chat-mode__copy",children:[c.jsxs("span",{className:"new-chat-mode__label",children:[E.value==="agent"?t:E.label,E.value==="skill-create"?c.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),c.jsx("span",{children:y(E)})]}),e===E.value?c.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:c.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},E.value))}):null]})}const gx=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function xJ({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:o,busy:l,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:y=!0,onInvocationChange:w,onAddFiles:g,onRemoveAttachment:E,newChatMode:b="agent",newChatLayout:_=!1,showModeSelector:N=!1,onModeChange:T,temporaryEnabled:A,skillCreateEnabled:k}){const R=v.useRef(null),I=v.useRef(null),M=v.useRef(null),B=v.useRef(null),[Y,P]=v.useState(!1),[U,C]=v.useState(null),[L,O]=v.useState(0),[j,S]=v.useState(!1);async function H(){if(e)try{await navigator.clipboard.writeText(e),S(!0),setTimeout(()=>S(!1),1500)}catch{S(!1)}}v.useLayoutEffect(()=>{const J=R.current;J&&(J.style.height="auto",J.style.height=`${Math.min(J.scrollHeight,200)}px`)},[s]);const V=b==="skill-create";v.useEffect(()=>{V&&(P(!1),C(null))},[V]);const D=!V&&d.some(J=>J.status!=="ready"),ne=!o&&!l&&!D&&(s.trim().length>0||!V&&d.length>0),ee=(U==null?void 0:U.query.toLocaleLowerCase())??"",re=(U==null?void 0:U.kind)==="skill"?f.filter(J=>!p.skills.some(ce=>ce.name===J.name)).filter(J=>`${J.name} ${J.description}`.toLocaleLowerCase().includes(ee)).map(J=>({kind:"skill",value:J})):(U==null?void 0:U.kind)==="agent"?h.filter(J=>`${J.name} ${J.description}`.toLocaleLowerCase().includes(ee)).map(J=>({kind:"agent",value:J})):[];function de(J){var ce;P(!1),C(null),(ce=J.current)==null||ce.click()}function G(J,ce){const Ce=J.slice(0,ce),Ee=/(^|\s)([/@])([^\s/@]*)$/.exec(Ce);if(!Ee){C(null);return}const ge=Ee[2].length+Ee[3].length,Le={kind:Ee[2]==="/"?"skill":"agent",query:Ee[3],start:ce-ge,end:ce},ve=!U||U.kind!==Le.kind||U.query!==Le.query||U.start!==Le.start||U.end!==Le.end;C(Le),ve&&O(0),P(!1)}function W(J){if(!U)return;const ce=s.slice(0,U.start)+s.slice(U.end);i(ce),J.kind==="skill"?w({...p,skills:[...p.skills,J.value]}):w({skills:[],targetAgent:J.value});const Ce=U.start;C(null),requestAnimationFrame(()=>{var Ee,ge;(Ee=R.current)==null||Ee.focus(),(ge=R.current)==null||ge.setSelectionRange(Ce,Ce)})}function oe(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function he(J){const ce=J.target.files?Array.from(J.target.files):[];ce.length&&g(ce),J.target.value=""}return c.jsxs("div",{className:`composer${_?" composer--new-chat":""}`,children:[V?null:c.jsx(fx,{value:p,onRemoveSkill:J=>w({...p,skills:p.skills.filter(ce=>ce.name!==J)}),onRemoveAgent:()=>w({skills:[]})}),!V&&d.length>0&&c.jsx(px,{appName:n,compact:!0,items:d,onRemove:E}),c.jsxs("div",{className:"composer-box",children:[U?c.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":U.kind==="skill"?"可用技能":"可用子 Agent",children:[c.jsxs("div",{className:"composer-command-head",children:[U.kind==="skill"?c.jsx(za,{}):c.jsx(vI,{}),c.jsx("span",{children:U.kind==="skill"?"调用技能":"使用子 Agent"}),c.jsx("kbd",{children:U.kind==="skill"?"/":"@"})]}),m?c.jsxs("div",{className:"composer-command-empty",children:[c.jsx(bt,{className:"spin"})," 正在读取 Agent 能力…"]}):re.length===0?c.jsx("div",{className:"composer-command-empty",children:U.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):c.jsx("div",{className:"composer-command-list",children:re.map((J,ce)=>c.jsxs("button",{type:"button",role:"option","aria-selected":ce===L,className:`composer-command-item${ce===L?" is-active":""}`,onMouseDown:Ce=>{Ce.preventDefault(),W(J)},onMouseEnter:()=>O(ce),children:[c.jsx("span",{className:`composer-command-icon composer-command-icon--${J.kind}`,children:J.kind==="skill"?c.jsx(za,{}):c.jsx(Ha,{})}),c.jsxs("span",{className:"composer-command-copy",children:[c.jsxs("strong",{children:[J.kind==="skill"?"/":"@",J.value.name]}),c.jsx("span",{children:J.value.description||(J.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),c.jsx("kbd",{children:ce===L?"↵":J.kind==="skill"?"技能":"Agent"})]},`${J.kind}-${J.value.name}`))})]}):null,V?null:c.jsxs("div",{className:"composer-menu-wrap",children:[c.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:o||!y,onClick:()=>{C(null),P(J=>!J)},children:c.jsx(ms,{className:"icon"})}),Y&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>P(!1)}),c.jsxs("div",{className:"composer-menu",role:"menu",children:[c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(I),children:[c.jsx(RI,{className:"icon"}),"上传图片"]}),c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(M),children:[c.jsx(SI,{className:"icon"}),"上传文档或 PDF"]}),c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(B),children:[c.jsx(AI,{className:"icon"}),"上传视频"]})]})]})]}),c.jsx("div",{className:"composer-input-stack",children:c.jsx("textarea",{ref:R,className:"comp-input scroll",rows:_?4:1,value:s,disabled:o,placeholder:V?`描述你想创建的 Skill,将使用 ${gx.join(" 和 ")} 并行创建…`:o?"请选择 Agent":`向 ${r} 发消息…`,"aria-expanded":!!U,onChange:J=>{i(J.target.value),V||G(J.target.value,J.target.selectionStart)},onSelect:J=>{V||G(J.currentTarget.value,J.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>C(null),0),onKeyDown:J=>{if(!bJ(J.nativeEvent)){if(U){if(J.key==="ArrowDown"&&re.length>0){J.preventDefault(),O(ce=>(ce+1)%re.length);return}if(J.key==="ArrowUp"&&re.length>0){J.preventDefault(),O(ce=>(ce-1+re.length)%re.length);return}if((J.key==="Enter"||J.key==="Tab")&&re[L]){J.preventDefault(),W(re[L]);return}if(J.key==="Escape"){J.preventDefault(),C(null);return}}if(J.key==="Backspace"&&!s&&J.currentTarget.selectionStart===0&&J.currentTarget.selectionEnd===0){oe();return}J.key==="Enter"&&!J.shiftKey&&(J.preventDefault(),ne&&a())}}})}),N&&T?c.jsx(EJ,{value:b,agentName:r,onChange:T,disabled:l,temporaryEnabled:A,skillCreateEnabled:k}):null,c.jsx(Gt.button,{type:"button",className:"comp-send",disabled:!ne,onClick:a,"aria-label":"发送",whileTap:ne?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:l?c.jsx(bt,{className:"icon spin"}):c.jsx(wI,{className:"icon"})})]}),u&&c.jsxs("div",{className:"composer-meta",children:[c.jsxs("span",{className:"composer-session-line",children:["会话 ID:",c.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&c.jsx("button",{type:"button",className:"composer-session-copy",title:j?"已复制":"复制会话 ID","aria-label":j?"已复制会话 ID":"复制会话 ID",onClick:()=>void H(),children:j?c.jsx(Bs,{}):c.jsx(TE,{})})]}),c.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),c.jsx("span",{children:"回答仅供参考"})]}),c.jsx("input",{ref:I,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:he}),c.jsx("input",{ref:M,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:he}),c.jsx("input",{ref:B,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:he})]})}function fM({title:e,sub:t,cards:n,footer:r}){return c.jsxs("div",{className:"stk",children:[c.jsxs("div",{className:"stk-head",children:[c.jsx("h1",{className:"stk-title",children:e}),t&&c.jsx("p",{className:"stk-sub",children:t})]}),c.jsx("div",{className:"stk-list",children:n.map((s,i)=>c.jsxs(Gt.button,{type:"button",className:`stk-card ${s.disabled?"stk-card-disabled":""}`,onClick:s.disabled?void 0:s.onClick,disabled:s.disabled,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18,ease:"easeOut",delay:i*.04},children:[c.jsx("span",{className:"stk-card-icon",children:c.jsx(s.icon,{})}),c.jsxs("span",{className:"stk-card-text",children:[c.jsx("span",{className:"stk-card-title",children:s.title}),c.jsx("span",{className:"stk-card-desc",children:s.desc})]}),c.jsx(Xn,{className:"stk-card-arrow"})]},s.key))}),r&&c.jsx("div",{className:"stk-footer",children:r})]})}const yx=Symbol.for("yaml.alias"),A1=Symbol.for("yaml.document"),zi=Symbol.for("yaml.map"),hM=Symbol.for("yaml.pair"),js=Symbol.for("yaml.scalar"),Wl=Symbol.for("yaml.seq"),Qr=Symbol.for("yaml.node.type"),ql=e=>!!e&&typeof e=="object"&&e[Qr]===yx,Td=e=>!!e&&typeof e=="object"&&e[Qr]===A1,Nd=e=>!!e&&typeof e=="object"&&e[Qr]===zi,mn=e=>!!e&&typeof e=="object"&&e[Qr]===hM,jt=e=>!!e&&typeof e=="object"&&e[Qr]===js,kd=e=>!!e&&typeof e=="object"&&e[Qr]===Wl;function hn(e){if(e&&typeof e=="object")switch(e[Qr]){case zi:case Wl:return!0}return!1}function pn(e){if(e&&typeof e=="object")switch(e[Qr]){case yx:case zi:case js:case Wl:return!0}return!1}const pM=e=>(jt(e)||hn(e))&&!!e.anchor,ma=Symbol("break visit"),wJ=Symbol("skip children"),iu=Symbol("remove node");function Gl(e,t){const n=vJ(t);Td(e)?$o(null,e.contents,n,Object.freeze([e]))===iu&&(e.contents=null):$o(null,e,n,Object.freeze([]))}Gl.BREAK=ma;Gl.SKIP=wJ;Gl.REMOVE=iu;function $o(e,t,n,r){const s=_J(e,t,n,r);if(pn(s)||mn(s))return TJ(e,r,s),$o(e,s,n,r);if(typeof s!="symbol"){if(hn(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>NJ[t]);class ar{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ar.defaultYaml,t),this.tags=Object.assign({},ar.defaultTags,n)}clone(){const t=new ar(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new ar(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ar.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ar.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:ar.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ar.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,a]=r;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const a=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,a),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+kJ(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&pn(t.contents)){const i={};Gl(t.contents,(a,o)=>{pn(o)&&o.tag&&(i[o.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(o=>o.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` -`)}}ar.defaultYaml={explicit:!1,version:"1.2"};ar.defaultTags={"!!":"tag:yaml.org,2002:"};function mM(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function gM(e){const t=new Set;return Gl(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function yM(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function SJ(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=gM(e));const a=yM(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(jt(a.node)||hn(a.node)))a.node.anchor=a.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=i,o}}},sourceObjects:r}}function Ho(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;sWr(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!pM(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class bx{constructor(t){Object.defineProperty(this,Qr,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Td(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=Wr(this,"",a);if(typeof s=="function")for(const{count:l,res:u}of a.anchors.values())s(u,l);return typeof i=="function"?Ho(i,{"":o},"",o):o}}class Ex extends bx{constructor(t){super(yx),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Gl(t,{Node:(i,a)=>{(ql(a)||pM(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,a=this.resolve(s,n);if(!a){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=r.get(a);if(o||(Wr(a,null,n),o=r.get(a)),(o==null?void 0:o.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=yh(s,a,r)),o.count*o.aliasCount>i)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(mM(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function yh(e,t,n){if(ql(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(hn(t)){let r=0;for(const s of t.items){const i=yh(e,s,n);i>r&&(r=i)}return r}else if(mn(t)){const r=yh(e,t.key,n),s=yh(e,t.value,n);return Math.max(r,s)}return 1}const bM=e=>!e||typeof e!="function"&&typeof e!="object";class Xe extends bx{constructor(t){super(js),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Wr(this.value,t,n)}toString(){return String(this.value)}}Xe.BLOCK_FOLDED="BLOCK_FOLDED";Xe.BLOCK_LITERAL="BLOCK_LITERAL";Xe.PLAIN="PLAIN";Xe.QUOTE_DOUBLE="QUOTE_DOUBLE";Xe.QUOTE_SINGLE="QUOTE_SINGLE";const AJ="tag:yaml.org,2002:";function CJ(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function zu(e,t,n){var f,h,p;if(Td(e)&&(e=e.contents),pn(e))return e;if(mn(e)){const m=(h=(f=n.schema[zi]).createNode)==null?void 0:h.call(f,n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:a,sourceObjects:o}=n;let l;if(r&&e&&typeof e=="object"){if(l=o.get(e),l)return l.anchor??(l.anchor=s(e)),new Ex(l.anchor);l={anchor:null,node:null},o.set(e,l)}t!=null&&t.startsWith("!!")&&(t=AJ+t.slice(2));let u=CJ(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new Xe(e);return l&&(l.node=m),m}u=e instanceof Map?a[zi]:Symbol.iterator in Object(e)?a[Wl]:a[zi]}i&&(i(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((p=u==null?void 0:u.nodeClass)==null?void 0:p.from)=="function"?u.nodeClass.from(n.schema,e,n):new Xe(e);return t?d.tag=t:u.default||(d.tag=u.tag),l&&(l.node=d),d}function _p(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const a=[];a[i]=r,r=a}else r=new Map([[i,r]])}return zu(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Oc=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class EM extends bx{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>pn(r)||mn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Oc(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(hn(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,_p(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(hn(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&jt(i)?i.value:i:hn(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!mn(n))return!1;const r=n.value;return r==null||t&&jt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return hn(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(hn(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,_p(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const IJ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Js(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Na=(e,t,n)=>e.endsWith(` +`,4);return n>=0?t.slice(n+5).trimStart():e}function QQ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M5.25 7.5h5.25v5.25H5.25zM13.5 7.5h5.25v5.25H13.5zM9.38 15.75h5.24v3H9.38z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M7.88 12.75v1.5c0 .83.67 1.5 1.5 1.5h5.24c.83 0 1.5-.67 1.5-1.5v-1.5M12 4.75V7.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("circle",{cx:"12",cy:"4.75",r:"1",fill:"currentColor"})]})}function ZQ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("path",{d:"m17.85 13.85.42 1.13 1.13.42-1.13.42-.42 1.13-.42-1.13-1.13-.42 1.13-.42z",fill:"currentColor"})]})}function JQ(){return c.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:c.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Ak({direction:e}){return c.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:c.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function k1(){return c.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function Ck({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return c.jsxs("footer",{className:"skillcenter-pager",children:[c.jsxs("span",{children:["共 ",t," 项"]}),c.jsxs("div",{className:"skillcenter-pager-actions",children:[c.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:c.jsx(Ak,{direction:"left"})}),c.jsxs("span",{children:[e," / ",s]}),c.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:c.jsx(Ak,{direction:"right"})})]})]})}function gh({children:e}){return c.jsx("div",{className:"skillcenter-empty",children:e})}function eZ({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return v.useEffect(()=>{const o=l=>{l.key==="Escape"&&a()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a]),c.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:c.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:o=>o.stopPropagation(),children:[c.jsxs("header",{className:"skill-detail-head",children:[c.jsxs("div",{className:"skill-detail-heading",children:[c.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:c.jsx(ZQ,{})}),c.jsxs("div",{children:[c.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),c.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),c.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:c.jsx(JQ,{})})]}),c.jsxs("dl",{className:"skill-detail-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"技能 ID"}),c.jsx("dd",{title:e.skillId,children:e.skillId})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"版本"}),c.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"状态"}),c.jsx("dd",{children:T1(e.skillStatus)})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"技能空间"}),c.jsx("dd",{title:t.name,children:t.name})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Project"}),c.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"地域"}),c.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),c.jsxs("div",{className:"skill-detail-content",children:[c.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?c.jsxs("div",{className:"skillcenter-loading",children:[c.jsx(k1,{}),"正在读取技能内容…"]}):i?c.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?c.jsx(_d,{text:XQ(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):c.jsx(gh,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function tZ({onClick:e}){return c.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"技能中心",title:"技能中心",children:[c.jsx(QQ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"技能中心"})]})}function nZ(){const[e,t]=v.useState("cn-beijing"),[n,r]=v.useState([]),[s,i]=v.useState(1),[a,o]=v.useState(0),[l,u]=v.useState(!1),[d,f]=v.useState(""),[h,p]=v.useState(null),[m,y]=v.useState([]),[w,g]=v.useState(1),[E,b]=v.useState(0),[_,k]=v.useState(!1),[T,A]=v.useState(""),[N,R]=v.useState(null),[I,M]=v.useState(null),[B,Y]=v.useState(!1),[P,U]=v.useState(""),C=v.useRef(0);v.useEffect(()=>{let H=!0;return u(!0),f(""),pU({region:e,page:s,pageSize:kk}).then(V=>{if(!H)return;const D=V.items||[];r(D),o(V.totalCount||0),p(ne=>D.find(ee=>ee.id===(ne==null?void 0:ne.id))||null)}).catch(V=>{H&&(r([]),o(0),p(null),f(V instanceof Error?V.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{H&&u(!1)}),()=>{H=!1}},[e,s]),v.useEffect(()=>{if(!h){y([]),b(0);return}let H=!0;return k(!0),A(""),gU(h.id,{region:e,page:w,pageSize:Nk,project:h.projectName}).then(V=>{H&&(y(V.items||[]),b(V.totalCount||0))}).catch(V=>{H&&(y([]),b(0),A(V instanceof Error?V.message:"读取技能失败,请稍后重试"))}).finally(()=>{H&&k(!1)}),()=>{H=!1}},[e,h,w]);const L=H=>{H!==e&&(j(),t(H),i(1),g(1),p(null),y([]))},O=H=>{j(),p(H),g(1)},j=()=>{C.current+=1,R(null),M(null),U(""),Y(!1)},S=async H=>{if(!h)return;const V=C.current+1;C.current=V,R(H),M(null),U(""),Y(!0);try{const D=await yU(h.id,H.skillId,H.version,e,h.projectName);C.current===V&&M(D)}catch(D){C.current===V&&U(D instanceof Error?D.message:"读取技能详情失败,请稍后重试")}finally{C.current===V&&Y(!1)}};return c.jsxs("section",{className:"skillcenter",children:[c.jsxs("div",{className:"skillcenter-browser",children:[c.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[c.jsxs("header",{className:"skillcenter-panel-head",children:[c.jsxs("div",{children:[c.jsx("h2",{children:"技能空间"}),c.jsx("span",{className:"skillcenter-count-badge",children:a})]}),c.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[c.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>L("cn-beijing"),children:"北京"}),c.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>L("cn-shanghai"),children:"上海"})]})]}),c.jsxs("div",{className:"skillcenter-listwrap",children:[l&&c.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[c.jsx(k1,{}),"正在读取技能空间…"]}),d?c.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!l?c.jsx(gh,{children:"当前地域暂无可访问的技能空间"}):c.jsx("div",{className:"skillcenter-list",children:n.map(H=>c.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===H.id?"active":""}`,onClick:()=>O(H),children:c.jsxs("span",{className:"skillcenter-item-body",children:[c.jsx("span",{className:"skillcenter-item-title",title:H.name,children:H.name}),c.jsx("span",{className:"skillcenter-item-description",children:H.description||"暂无描述"}),c.jsxs("span",{className:"skillcenter-item-meta",children:[c.jsx("span",{className:`skillcenter-status ${Sk(H.status)}`,children:T1(H.status)}),c.jsxs("span",{className:"skillcenter-meta-text",title:H.projectName||"default",children:["Project · ",H.projectName||"default"]}),c.jsxs("span",{className:"skillcenter-meta-text",children:[H.skillCount??0," 个技能"]}),H.updatedAt&&c.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",GQ(H.updatedAt)]})]})]})},`${H.projectName||"default"}:${H.id}`))})]}),c.jsx(Ck,{page:s,total:a,pageSize:kk,onPage:i})]}),c.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"skillcenter-panel-head",children:[c.jsx("div",{children:c.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),c.jsx("span",{children:E})]}),c.jsxs("div",{className:"skillcenter-listwrap",children:[_&&c.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[c.jsx(k1,{}),"正在读取技能…"]}),T?c.jsx("div",{className:"skillcenter-error",children:T}):m.length===0&&!_?c.jsx(gh,{children:"这个空间中暂无技能"}):c.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(H=>c.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void S(H),children:c.jsxs("span",{className:"skillcenter-item-body",children:[c.jsx("span",{className:"skillcenter-item-title",title:H.skillName,children:H.skillName}),c.jsx("span",{className:"skillcenter-item-description",children:H.skillDescription||"暂无描述"}),c.jsxs("span",{className:"skillcenter-item-meta",children:[c.jsx("span",{className:`skillcenter-status ${Sk(H.skillStatus)}`,children:T1(H.skillStatus)}),c.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",H.version||"—"]})]})]})},`${H.skillId}:${H.version}`))})]}),c.jsx(Ck,{page:w,total:E,pageSize:Nk,onPage:g})]}):c.jsx(gh,{children:"点击 Skill 空间以查看详情"})})]}),N&&h&&c.jsx(eZ,{skill:N,space:h,region:e,detail:I,loading:B,error:P,onClose:j})]})}const rZ=50,Ik=48;function sZ(e){return(e.events??[]).flatMap(t=>{var s,i;const r=(((s=t.content)==null?void 0:s.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return r?[{text:r,role:t.author??((i=t.content)==null?void 0:i.role)??"",ts:t.timestamp}]:[]})}function iZ(e){var t,n;for(const r of e.events??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const s=(((n=r.content)==null?void 0:n.parts)??[]).map(i=>i.text).find(Boolean);if(s)return s}return"未命名会话"}function aZ(e,t,n){const r=Math.max(0,t-Ik),s=Math.min(e.length,t+n+Ik);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var l;if((l=o.events)!=null&&l.length)return o;try{return await dp(t,e,o.id)}catch{return o}})),a=[];for(const o of i)for(const{text:l,role:u,ts:d}of sZ(o)){const f=l.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:o.id,title:iZ(o),snippet:aZ(l,f,r.length),role:u,ts:d??o.lastUpdateTime});break}}return a.sort((o,l)=>(l.ts??0)-(o.ts??0)),a.slice(0,rZ)}async function lZ(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await GI(e,t.trim())}catch(a){const o=String(a);return{results:[],note:o.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${o}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,o)=>({type:"web",index:o,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function cZ(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await qI(t,e,r.trim(),n);if(!s.mounted)return{results:[],note:e==="knowledge"?"该 Agent 未挂载知识库。":"该 Agent 未挂载长期记忆。"};if(s.error)return{results:[],note:s.error};const i=s.sourceName??(e==="knowledge"?"知识库":"长期记忆");return{results:s.results.map((a,o)=>e==="knowledge"?{type:"knowledge",index:o,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:o,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function uZ(e,t,n){return e==="session"?{results:await oZ(n.userId,n.appId,t)}:e==="web"?lZ(n.appId,t):cZ(e,n.appId,n.userId,t)}function $L({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),c.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function dZ({open:e}){return c.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:c.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function fZ({onClick:e}){return c.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"智能搜索",title:"智能搜索",children:[c.jsx($L,{}),c.jsx("span",{className:"sidebar-nav-label",children:"智能搜索"})]})}function hZ(e,t,n){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),i=a=>r?n?"正在检测 Agent 能力":`当前 Agent 未挂载${a}`:"请选择 Agent";return[{id:"session",label:"会话",ready:r,unavailableLabel:"请选择 Agent"},{id:"web",label:"网络",ready:r&&s.has("web"),description:"通过 web_search 工具检索",unavailableLabel:i(" web_search 工具")},{id:"knowledge",label:"知识库",ready:r&&s.has("knowledge"),unavailableLabel:i("知识库")},{id:"memory",label:"长期记忆",ready:r&&s.has("memory"),unavailableLabel:i("长期记忆")}]}function vp(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function Rk(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function pZ({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var U,C;const[a,o]=v.useState("session"),[l,u]=v.useState(""),[d,f]=v.useState([]),[h,p]=v.useState(),[m,y]=v.useState(!1),[w,g]=v.useState(!1),[E,b]=v.useState(!1),_=v.useRef(0),k=v.useRef(null),T=hZ(t,n,r),A=T.find(L=>L.id===a),N=a==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(L=>L.source==="knowledgebase"||L.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(L=>L.source==="long_term_memory"||L.kind==="memory"):void 0;v.useEffect(()=>{_.current+=1,o("session"),f([]),p(void 0),g(!1),y(!1),b(!1)},[t]),v.useEffect(()=>{if(!E)return;function L(O){var j;(j=k.current)!=null&&j.contains(O.target)||b(!1)}return document.addEventListener("pointerdown",L),()=>document.removeEventListener("pointerdown",L)},[E]);async function R(L,O){var V;const j=L.trim();if(!j||!((V=T.find(D=>D.id===O))!=null&&V.ready))return;const S=++_.current;y(!0),g(!0);let H;try{H=await uZ(O,j,{userId:e,appId:t})}catch(D){const ne=D instanceof Error?D.message:String(D);H={results:[],note:`搜索失败:${ne}`}}S===_.current&&(f(H.results),p(H.note),y(!1))}function I(L){_.current+=1,u(L),f([]),p(void 0),g(!1),y(!1)}function M(L){_.current+=1,o(L),b(!1),f([]),p(void 0),g(!1),y(!1)}const B=!!(A!=null&&A.ready),Y=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(N==null?void 0:N.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(N==null?void 0:N.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",P=N!=null&&N.backend?vp(N.backend):"";return c.jsxs("div",{className:"search",children:[c.jsxs("div",{className:"search-box",children:[c.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[c.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(A==null?void 0:A.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":E,onClick:()=>b(L=>!L),children:[c.jsx("span",{children:(A==null?void 0:A.label)??"搜索类型"}),P&&c.jsx("small",{children:P}),c.jsx(dZ,{open:E})]}),E&&c.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:T.map(L=>{var S,H;const O=L.id==="knowledge"?(S=n==null?void 0:n.components)==null?void 0:S.find(V=>V.source==="knowledgebase"||V.kind==="knowledgebase"):L.id==="memory"?(H=n==null?void 0:n.components)==null?void 0:H.find(V=>V.source==="long_term_memory"||V.kind==="memory"):void 0,j=O?[O.name,O.backend?vp(O.backend):""].filter(Boolean).join(" · "):L.ready?L.description:L.unavailableLabel;return c.jsxs("button",{type:"button",role:"option","aria-selected":a===L.id,disabled:!L.ready,onClick:()=>M(L.id),children:[c.jsx("span",{children:L.label}),j&&c.jsx("small",{children:j})]},L.id)})})]}),c.jsx("span",{className:"search-box-divider","aria-hidden":!0}),c.jsx("input",{className:"search-input",value:l,onChange:L=>I(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),R(l,a))},placeholder:Y,disabled:!B,autoFocus:!0}),c.jsx("button",{className:"search-go",onClick:()=>void R(l,a),disabled:!l.trim()||m,"aria-label":"搜索",children:m?c.jsx(bt,{className:"icon spin"}):c.jsx($L,{className:"icon"})})]}),c.jsx("div",{className:"search-results",children:B?w?m?null:h?c.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?c.jsxs("div",{className:"search-empty",children:["未找到匹配「",l.trim(),"」的结果。"]}):d.map((L,O)=>c.jsx(mZ,{result:L,agentLabel:s,onOpen:i},O)):c.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):c.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(A==null?void 0:A.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function mZ({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return c.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[c.jsx(LI,{className:"search-result-icon"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsx("span",{className:"search-result-title",children:e.title}),c.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Rk(e.ts)}`:""]})]}),c.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return c.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[c.jsx(um,{className:"search-result-icon"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsx("span",{className:"search-result-title",children:e.title||e.url}),c.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&c.jsx(kE,{className:"search-result-ext"})]})]}),e.summary&&c.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return c.jsxs("div",{className:"search-result search-result-static",children:[c.jsx(Ok,{source:"knowledge"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),c.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${vp(e.sourceType)}`:""]})]}),c.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return c.jsxs("div",{className:"search-result search-result-static",children:[c.jsx(Ok,{source:"memory"}),c.jsxs("div",{className:"search-result-body",children:[c.jsxs("div",{className:"search-result-head",children:[c.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),c.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${vp(e.sourceType)}`:"",e.ts?` · ${Rk(e.ts)}`:""]})]}),c.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function Ok({source:e,className:t="search-result-icon"}){return e==="knowledge"?c.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),c.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):c.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),c.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}const HL="veadk_agentkit_connections";function Zs(){try{const e=localStorage.getItem(HL);return e?JSON.parse(e):[]}catch{return[]}}function km(e){try{localStorage.setItem(HL,JSON.stringify(e))}catch{}}function Ka(e,t){return`agentkit:${e}:${t}`}function zL(e){try{return new URL(e).host}catch{return e}}function Kl(e){UI();for(const t of e)for(const n of t.apps)FI(Ka(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function VL(e,t,n,r,s){const i={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s},a=[...Zs().filter(o=>o.runtimeId!==e),i];return km(a),Kl(a),i}async function cx(e,t,n){let r;try{r=await tR(e,n)}catch(a){throw a instanceof fd&&N1(e),a}if(!r||r.length===0)throw N1(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const s=Object.fromEntries(r.map(a=>[a,t])),i=VL(e,t,n,r,s);return Ka(i.id,r[0])}async function KL(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await fm(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||zL(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},o=[...Zs().filter(l=>l.base!==s),a];return km(o),Kl(o),a}function gZ(e){const t=Zs().filter(n=>n.id!==e);return km(t),Kl(t),t}function N1(e){const t=Zs().filter(n=>n.runtimeId!==e);return km(t),Kl(t),t}function YL(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var o;const a=((o=s.appLabels)==null?void 0:o[i])??i;return{id:Ka(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:zL(s.base??"")}}));return[...n,...r]}const Lk=Object.freeze(Object.defineProperty({__proto__:null,addConnection:KL,addRuntimeConnection:VL,buildAgentEntries:YL,connectRuntime:cx,loadConnections:Zs,registerConnections:Kl,remoteAppId:Ka,removeConnection:gZ,removeRuntimeConnection:N1},Symbol.toStringTag,{value:"Module"}));function Hu({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),c.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),c.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),c.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),c.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),c.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),c.jsx("path",{d:"m12 7.55 1.28 3.17L16.45 12l-3.17 1.28L12 16.45l-1.28-3.17L7.55 12l3.17-1.28L12 7.55Z",fill:"currentColor",stroke:"none"})]})}function yZ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),c.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),c.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),c.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function bZ({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m4.7 7.2 7.3-3 7.3 3-7.3 3.1Z"}),c.jsx("path",{d:"M7.2 9.2v4.2c0 1.7 2.15 3.05 4.8 3.05s4.8-1.35 4.8-3.05V9.2"}),c.jsx("path",{d:"M19.3 7.2v5.25"}),c.jsx("circle",{cx:"19.3",cy:"14.4",r:"1.15",fill:"currentColor",stroke:"none"})]})}function WL({className:e="icon"}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),c.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),c.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),c.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),c.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const Mk=15,EZ=1e4,xZ=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function wZ(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function qL(e){const t=e.toLowerCase();return t.includes("invalidagentkitruntime.notfound")||t.includes("specified agentkitruntime does not exist")?"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。":t.includes("accessdenied")||t.includes("forbidden")||t.includes("permission")||t.includes("(401)")||t.includes("(403)")?"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。":t.includes("agent-info failed: 404")||t.includes("读取 agent 列表失败 (404)")?"该 Agent Server 版本暂不支持信息预览。":"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。"}function o0(e,t=EZ){return new Promise((n,r)=>{const s=setTimeout(()=>r(new Error("加载超时,请重试")),t);e.then(i=>{clearTimeout(s),n(i)},i=>{clearTimeout(s),r(i)})})}function vZ({open:e,onClose:t,anchorTop:n=0,agentsSource:r,localApps:s,currentId:i,currentRuntime:a,runtimeScope:o,onSelect:l}){const[u,d]=v.useState([]),[f,h]=v.useState([""]),[p,m]=v.useState(0),[y,w]=v.useState(o==="mine"),[g,E]=v.useState(null),[b,_]=v.useState("cn-beijing"),[k,T]=v.useState(!1),[A,N]=v.useState(""),[R,I]=v.useState(""),[M,B]=v.useState(null),[Y,P]=v.useState(new Set),[U,C]=v.useState(),[L,O]=v.useState("agent"),j=v.useRef(!1);function S(W){C(oe=>(oe==null?void 0:oe.runtimeId)===W.runtimeId?void 0:{runtimeId:W.runtimeId,name:W.name,region:W.region})}const H=v.useCallback(async W=>{if(u[W]){m(W);return}const oe=f[W];if(oe!==void 0){T(!0),N("");try{const he=await o0(dh({nextToken:oe,pageSize:Mk,region:b,scope:"all"}));d(J=>{const ce=[...J];return ce[W]=he.runtimes,ce}),h(J=>{const ce=[...J];return he.nextToken&&(ce[W+1]=he.nextToken),ce}),m(W)}catch(he){N(he instanceof Error?he.message:String(he))}finally{T(!1)}}},[f,u,b]),V=v.useCallback(async()=>{T(!0),N("");try{const W=[];let oe="";do{const he=await o0(dh({scope:"mine",nextToken:oe,pageSize:100,region:b}));W.push(...he.runtimes),oe=he.nextToken}while(oe&&W.length<2e3);E(W)}catch(W){N(W instanceof Error?W.message:String(W))}finally{T(!1)}},[b]);v.useEffect(()=>{w(o==="mine"),d([]),h([""]),m(0),E(null),j.current=!1},[o]),v.useEffect(()=>{e&&r==="cloud"&&!y&&!j.current&&(j.current=!0,H(0))},[e,r,y,H]),v.useEffect(()=>{y&&g===null&&r==="cloud"&&V()},[y,g,r,V]),v.useEffect(()=>{e&&(C(void 0),O("agent"))},[e]);function D(){P(new Set),y?(E(null),V()):(d([]),h([""]),m(0),j.current=!0,T(!0),N(""),o0(dh({nextToken:"",pageSize:Mk,region:b,scope:"all"})).then(W=>{d([W.runtimes]),h(W.nextToken?["",W.nextToken]:[""])}).catch(W=>N(W instanceof Error?W.message:String(W))).finally(()=>T(!1)))}function ne(W){W!==b&&(_(W),d([]),h([""]),m(0),E(null),P(new Set),j.current=!1)}const ee=!y&&(u[p+1]!==void 0||f[p+1]!==void 0);function re(W){B(W.runtimeId),cx(W.runtimeId,W.name,W.region).then(oe=>{l(oe),t()}).catch(oe=>{if(oe instanceof fd){N(oe.message);return}if(oe instanceof Lu){oe.unsupported&&P(he=>new Set(he).add(W.runtimeId)),N(oe.message);return}P(he=>new Set(he).add(W.runtimeId))}).finally(()=>B(null))}if(!e)return null;const G=(y?g??[]:u[p]??[]).filter(W=>R?W.name.toLowerCase().includes(R.toLowerCase()):!0);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:t}),c.jsxs("div",{className:`agentsel ${U?"has-detail":""}`,role:"dialog","aria-label":"选择 Agent",style:{top:n,height:`min(640px, calc(100dvh - ${n}px - 10px))`},children:[c.jsxs("div",{className:"agentsel-main",children:[c.jsxs("div",{className:"agentsel-head",children:[c.jsxs("span",{className:"agentsel-title",children:[c.jsx(Hu,{})," 选择 Agent"]}),c.jsxs("div",{className:"agentsel-head-actions",children:[r==="cloud"&&c.jsx("button",{className:"agentsel-refresh",onClick:D,title:"刷新",disabled:k,children:c.jsx(SE,{className:`icon ${k?"spin":""}`})}),c.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:c.jsx(Xr,{className:"icon"})})]})]}),r==="local"?c.jsx("div",{className:"agentsel-body",children:s.length===0?c.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):c.jsx("ul",{className:"agentsel-list",children:s.map(W=>c.jsx("li",{children:c.jsxs("button",{className:`agentsel-item ${W===i?"active":""}`,onClick:()=>{l(W),t()},children:[c.jsx(Hu,{}),c.jsx("span",{className:"agentsel-item-name",children:W})]})},W))})}):c.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[c.jsxs("div",{className:"agentsel-tools",children:[c.jsxs("div",{className:"agentsel-search",children:[c.jsx(e1,{className:"icon"}),c.jsx("input",{value:R,onChange:W=>I(W.target.value),placeholder:"搜索 Runtime 名称"})]}),c.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:xZ.map(W=>c.jsx("button",{type:"button",className:b===W.value?"active":"","aria-pressed":b===W.value,onClick:()=>ne(W.value),children:W.label},W.value))}),o==="all"&&c.jsxs("label",{className:"agentsel-mine",children:[c.jsx("input",{type:"checkbox",checked:y,onChange:W=>w(W.target.checked)}),"只看我创建的"]})]}),A&&c.jsx("div",{className:"agentsel-error",children:A}),c.jsxs("div",{className:"agentsel-listwrap",children:[G.length===0&&!k?c.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):c.jsx("ul",{className:"agentsel-list",children:G.map(W=>{const oe=Y.has(W.runtimeId),he=M===W.runtimeId,J=(a==null?void 0:a.runtimeId)===W.runtimeId,ce=(U==null?void 0:U.runtimeId)===W.runtimeId;return c.jsx("li",{children:c.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${J?"active":""} ${ce?"is-previewed":""}`,title:W.runtimeId,children:[c.jsx(WL,{}),c.jsxs("div",{className:"agentsel-item-main",children:[c.jsx("span",{className:"agentsel-item-name",title:W.name,children:W.name}),c.jsxs("div",{className:"agentsel-item-meta",children:[c.jsx("span",{className:`agentsel-status is-${oe?"bad":CZ(W.status)}`,children:oe?"不支持":GL(W.status)}),W.isMine&&c.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),c.jsxs("div",{className:"agentsel-item-actions",children:[c.jsx("button",{type:"button",className:"agentsel-connect",disabled:he||J,onClick:()=>re(W),children:he?"连接中…":J?"已连接":oe?"重试":"连接"}),c.jsx("button",{type:"button",className:`agentsel-info ${ce?"active":""}`,"aria-label":`查看 ${W.name} 信息`,"aria-pressed":ce,title:"查看信息",onClick:()=>S(W),children:c.jsx(Bl,{className:"icon"})})]})]})},W.runtimeId)})}),k&&c.jsxs("div",{className:"agentsel-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]})]}),c.jsxs("div",{className:"agentsel-pager",children:[c.jsx("button",{disabled:y||p===0||k,onClick:()=>void H(p-1),"aria-label":"上一页",children:c.jsx(lF,{className:"icon"})}),c.jsx("span",{className:"agentsel-pager-label",children:y?1:p+1}),c.jsx("button",{disabled:y||!ee||k,onClick:()=>void H(p+1),"aria-label":"下一页",children:c.jsx(lr,{className:"icon"})})]})]})]}),r==="cloud"&&U&&c.jsx(NZ,{runtime:U,tab:L,onTabChange:O})]})]})}const _Z={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function TZ(e){return _Z[e.toLowerCase()]??e}function kZ(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function NZ({runtime:e,tab:t,onTabChange:n}){return c.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[c.jsx("div",{className:"agentsel-head agentsel-preview-head",children:c.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[c.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),c.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),c.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),c.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:c.jsx(SZ,{runtime:e})}),c.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:c.jsx(AZ,{runtime:e})})]})}function SZ({runtime:e}){const[t,n]=v.useState(null),[r,s]=v.useState(!0),[i,a]=v.useState(""),o=e.runtimeId,l=e.region;v.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),WI(o,l).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(qL(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[o,l]);const u=(t==null?void 0:t.components)??[];return c.jsx("div",{className:"agentsel-detail-body",children:r?c.jsxs("div",{className:"agentsel-panel-state",children:[c.jsx(bt,{className:"icon spin"})," 读取 Agent 信息…"]}):i?c.jsxs("div",{className:"agentsel-panel-empty",children:[c.jsx("span",{children:"暂时无法读取 Agent 信息"}),c.jsx("small",{title:i,children:i})]}):t?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"agentsel-identity",children:[c.jsx(Hu,{className:"agentsel-identity-icon"}),c.jsxs("div",{className:"agentsel-identity-copy",children:[c.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&c.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsx("h3",{children:"描述"}),c.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&c.jsx(Dk,{icon:c.jsx(MI,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&c.jsx(Dk,{icon:c.jsx(yZ,{}),title:"工具",values:t.tools}),t.skills.length>0&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[c.jsx(bZ,{})," 技能"]}),c.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>c.jsxs("div",{className:"agentsel-info-list-item",children:[c.jsx("strong",{title:d.name,children:d.name}),d.description&&c.jsx("span",{title:d.description,children:d.description})]},d.name))})]}),u.length>0&&c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[c.jsx(_I,{className:"icon"})," 挂载组件"]}),c.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>c.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[c.jsxs("div",{className:"agentsel-component-head",children:[c.jsx("strong",{title:d.name,children:d.name}),c.jsxs("span",{children:[TZ(d.kind),d.backend?` · ${kZ(d.backend)}`:""]})]}),d.description&&c.jsx("span",{title:d.description,children:d.description})]},`${d.kind}:${d.name}:${f}`))})]}),!t.description&&t.subAgents.length===0&&t.tools.length===0&&t.skills.length===0&&u.length===0&&c.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function Dk({icon:e,title:t,values:n}){return c.jsxs("section",{className:"agentsel-info-section",children:[c.jsxs("h3",{children:[e,t]}),c.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>c.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function AZ({runtime:e}){const[t,n]=v.useState(null),[r,s]=v.useState(!0),[i,a]=v.useState(""),o=e.runtimeId,l=e.region;v.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),ME(o,l).then(f=>d&&n(f)).catch(f=>d&&a(qL(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[o,l]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",GL(t.status)]),t.region&&u.push(["区域",wZ(t.region)]);const d=t.resources,f=[d.cpuMilli!=null?`CPU ${d.cpuMilli}m`:"",d.memoryMb!=null?`内存 ${d.memoryMb}MB`:"",d.minInstance!=null||d.maxInstance!=null?`实例 ${d.minInstance??"?"}~${d.maxInstance??"?"}`:""].filter(Boolean).join(" · ");f&&u.push(["资源",f]),t.currentVersion!=null&&u.push(["版本",String(t.currentVersion)])}return c.jsxs("div",{className:"agentsel-detail-body",children:[c.jsxs("div",{className:"agentsel-runtime-identity",children:[c.jsx(WL,{}),c.jsxs("div",{children:[c.jsx("strong",{title:e.name,children:e.name}),c.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?c.jsxs("div",{className:"agentsel-apps-note",children:[c.jsx(bt,{className:"icon spin"})," 读取详情…"]}):i?c.jsx("div",{className:"agentsel-error",children:i}):t?c.jsxs(c.Fragment,{children:[c.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>c.jsxs("div",{className:"agentsel-kv-row",children:[c.jsx("dt",{children:d}),c.jsx("dd",{children:f})]},d))}),t.envs.length>0&&c.jsxs("div",{className:"agentsel-envs",children:[c.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>c.jsxs("div",{className:"agentsel-env",children:[c.jsx("span",{className:"agentsel-env-k",children:d.key}),c.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function CZ(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}const IZ={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function GL(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return IZ[t]??(e||"-")}const ux="/assets/volcengine-DM14a-L-.svg",Pk="(max-width: 860px)",RZ=54;function OZ(){return c.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M12.5 3 5.5 13h5l-1 8 8-11h-5l.5-7z",fill:"currentColor",stroke:"none"}),c.jsx("path",{d:"M19 4.5v3M17.5 6h3",opacity:"0.85"})]})}function LZ(){return c.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("circle",{cx:"8.25",cy:"7.75",r:"3.15"}),c.jsx("path",{d:"M2.9 19.2c.45-3.45 2.48-5.35 5.35-5.35 2.4 0 4.2 1.28 4.98 3.66"}),c.jsx("path",{d:"M17.4 4.5v15M14.8 9h5.2M14.8 15.3h5.2"}),c.jsx("circle",{cx:"17.4",cy:"9",r:"1.15",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"17.4",cy:"15.3",r:"1.15",fill:"currentColor",stroke:"none"})]})}function MZ(e){let t=2166136261;for(const r of e)t^=r.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const DZ={admin:"管理员",developer:"开发者",user:"普通用户"};function jk({role:e}){const t=DZ[e];return c.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function PZ({access:e,userInfo:t,onLogout:n}){const[r,s]=v.useState(!1),[i,a]=v.useState("");if(!t)return null;const o=JF(t),l=typeof t.email=="string"?t.email:"",u=(o||"U").slice(0,1).toUpperCase(),d=MZ(o||l||u),f=eU(t),h=f===i?"":f;return c.jsxs("div",{className:"sidebar-user",children:[c.jsxs("button",{className:"sidebar-user-btn",onClick:()=>s(p=>!p),title:l?`${o} +${l}`:o,children:[c.jsxs("span",{className:`account-avatar${h?" has-image":""}`,style:d,children:[u,h?c.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),c.jsxs("span",{className:"sidebar-user-identity",children:[c.jsxs("span",{className:"sidebar-user-primary",children:[c.jsx("span",{className:"sidebar-user-name",children:o}),c.jsx(jk,{role:e.role})]}),l&&l!==o&&c.jsx("span",{className:"sidebar-user-email",children:l})]})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>s(!1)}),c.jsxs("div",{className:"account-pop sidebar-user-pop",children:[c.jsxs("div",{className:"account-head",children:[c.jsxs("span",{className:`account-avatar account-avatar--lg${h?" has-image":""}`,style:d,children:[u,h?c.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),c.jsxs("div",{className:"account-id",children:[c.jsxs("div",{className:"account-name-row",children:[c.jsx("div",{className:"account-name",children:o}),c.jsx(jk,{role:e.role})]}),l&&l!==o&&c.jsx("div",{className:"account-sub",children:l})]})]}),c.jsxs("button",{className:"account-logout",onClick:()=>{s(!1),n()},children:[c.jsx(AF,{className:"icon"})," 退出登录"]})]})]})]})}function jZ({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,agentsSource:a="local",localApps:o=[],currentAgentId:l="",currentAgentLabel:u="",currentRuntime:d,onSelectAgent:f,onNewChat:h,onSearch:p,onQuickCreate:m,onSkillCenter:y,onAddAgent:w,onManageAgents:g,onPickSession:E,onDeleteSession:b,userInfo:_,onLogout:k}){const T=L=>(r==null?void 0:r[L])!==!1,[A,N]=v.useState(null),[R,I]=v.useState(!1),M=v.useRef(typeof window<"u"&&window.matchMedia(Pk).matches),[B,Y]=v.useState(M.current),P=()=>{I(L=>!L)},U=[...t].sort((L,O)=>(O.lastUpdateTime??0)-(L.lastUpdateTime??0)),C=()=>{M.current=!1,Y(L=>!L),I(!1),N(null)};return v.useEffect(()=>{const L=window.matchMedia(Pk),O=j=>{j.matches?Y(S=>S||(M.current=!0,!0)):M.current&&(M.current=!1,Y(!1))};return L.addEventListener("change",O),()=>L.removeEventListener("change",O)},[]),c.jsxs("aside",{className:`sidebar ${B?"is-collapsed":""}`,children:[c.jsxs("div",{className:"sidebar-top",children:[c.jsxs("div",{className:"sidebar-brand-row",children:[c.jsxs("div",{className:"brand",children:[c.jsx("img",{className:"brand-logo",src:e.logoUrl||ux,width:20,height:20,alt:"","aria-hidden":!0}),c.jsx("span",{className:"brand-title",children:e.title})]}),c.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:C,"aria-label":B?"展开侧边栏":"收起侧边栏",title:B?"展开侧边栏":"收起侧边栏",children:B?c.jsx(LF,{className:"icon"}):c.jsx(OF,{className:"icon"})})]}),f&&(()=>{const L=a==="cloud"&&!l,O=a==="cloud"&&!L&&!!d,j=a==="cloud"&&!L&&(d!=null&&d.region)?d.region==="cn-beijing"?"北京":d.region==="cn-shanghai"?"上海":d.region:"";return c.jsxs("button",{className:`agent-row ${L?"agent-row--empty":""} ${O?"agent-row--connected":""}`,onClick:P,"aria-label":L?"请选择 Agent":u||"选择 Agent",title:"切换 Agent",children:[c.jsx(Hu,{className:"icon agent-row-lead"}),c.jsx("span",{className:"agent-row-name",children:L?"请选择 Agent":u||"选择 Agent"}),j&&c.jsx("span",{className:"agent-row-region",children:j}),c.jsx(lr,{className:`icon agent-row-chev ${R?"open":""}`})]})})(),f&&c.jsx(vZ,{open:R,onClose:()=>I(!1),anchorTop:RZ,agentsSource:a,localApps:o,currentId:l,currentRuntime:d,runtimeScope:s.capabilities.runtimeScope,onSelect:f}),T("newChat")&&c.jsxs("button",{className:"new-chat",onClick:h,"aria-label":"新会话",title:"新会话",children:[c.jsx(ms,{className:"icon"}),c.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),T("search")&&c.jsx(fZ,{onClick:p}),T("skillCenter")&&c.jsx(tZ,{onClick:y}),s.capabilities.createAgents&&T("addAgent")&&c.jsxs("button",{className:"new-chat",onClick:m,"aria-label":"添加 Agent",title:"添加 Agent",children:[c.jsx(OZ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"添加 Agent"})]}),s.capabilities.manageAgents&&T("manageAgents")&&c.jsxs("button",{className:"new-chat",onClick:g,"aria-label":"管理 Agent",title:"管理 Agent",children:[c.jsx(LZ,{}),c.jsx("span",{className:"sidebar-nav-label",children:"管理 Agent"})]})]}),T("history")&&c.jsxs("div",{className:"sidebar-history",children:[c.jsxs("div",{className:"history-head",children:[c.jsx("span",{children:"历史会话"}),T("newChat")&&c.jsx("button",{type:"button",className:"history-new-chat",onClick:h,"aria-label":"新建会话",title:"新建会话",children:c.jsx(ms,{className:"icon"})})]}),c.jsxs("div",{className:"history-list",children:[U.length===0&&c.jsx("div",{className:"history-empty",children:"暂无会话"}),U.map(L=>{const O=oR(L.events);return c.jsxs("div",{className:`history-item ${L.id===n?"active":""}`,children:[c.jsxs("button",{className:"history-item-btn",onClick:()=>E(L.id),title:O,children:[(i==null?void 0:i.has(L.id))&&c.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),c.jsx("span",{className:"history-title",children:O})]}),c.jsx("button",{className:"history-more",title:"更多",onClick:()=>N(j=>j===L.id?null:L.id),children:c.jsx(fF,{className:"icon"})}),A===L.id&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>N(null)}),c.jsx("div",{className:"history-menu",children:c.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{N(null),b(L.id)},children:[c.jsx(Fl,{className:"icon"})," 删除"]})})]})]},L.id)})]})]}),c.jsx(PZ,{access:s,userInfo:_,onLogout:k})]})}function BZ({apps:e,appName:t,onAppChange:n,agentLabel:r,title:s,crumbs:i,rightContent:a}){return c.jsxs("div",{className:"navbar",children:[c.jsxs("div",{className:"navbar-left",children:[c.jsx("div",{className:"navbar-default",children:i&&i.length>0?c.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:i.map((o,l)=>c.jsxs(v.Fragment,{children:[l>0&&c.jsx(lr,{className:"crumb-sep"}),o.onClick?c.jsx("button",{className:"crumb crumb-link",onClick:o.onClick,children:o.label}):c.jsx("span",{className:"crumb crumb-current",children:o.label})]},l))}):s?c.jsx("div",{className:"navbar-title",title:s,children:s}):c.jsx(FZ,{apps:e,appName:t,onAppChange:n,agentLabel:r})}),c.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),c.jsxs("div",{className:"navbar-right",children:[c.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),a]})]})}function FZ({apps:e,appName:t,onAppChange:n,agentLabel:r}){const[s,i]=v.useState(!1),[a,o]=v.useState(null),[l,u]=v.useState({}),[d,f]=v.useState(0),h=v.useRef({}),p=w=>r?r(w):w;function m(w){o(w);const g=h.current[w];if(g){const E=g.getBoundingClientRect(),b=g.closest(".agent-dd");if(b){const _=b.getBoundingClientRect();f(E.top-_.top)}}l[w]===void 0&&(u(E=>({...E,[w]:"loading"})),hd(w).then(E=>u(b=>({...b,[w]:E}))).catch(()=>u(E=>({...E,[w]:"error"}))))}function y(){i(!1),o(null)}return c.jsxs("div",{className:"agent-dd",children:[c.jsxs("button",{className:"agent-dd-trigger",onClick:()=>i(w=>!w),children:[c.jsx("span",{className:"agent-dd-current",children:t?p(t):"选择 Agent"}),c.jsx(op,{className:`agent-dd-chev ${s?"open":""}`})]}),s&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:y}),c.jsx("div",{className:"agent-dd-menu",children:e.map(w=>c.jsx("div",{ref:g=>h.current[w]=g,className:"agent-dd-row",onMouseEnter:()=>m(w),onMouseLeave:()=>o(g=>g===w?null:g),children:c.jsxs("button",{className:`agent-dd-item ${w===t?"active":""}`,onClick:()=>{n(w),y()},children:[c.jsx("span",{className:"agent-dd-item-name",children:p(w)}),w===t&&c.jsx("span",{className:"agent-dd-item-dot","aria-label":"当前"})]})},w))}),a&&c.jsx(UZ,{state:l[a],top:d})]})]})}function UZ({state:e,top:t}){return c.jsx("div",{className:"agent-dd-flyout",style:{top:`${t}px`},children:e===void 0||e==="loading"?c.jsxs("div",{className:"agent-dd-fly-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]}):e==="error"?c.jsx("div",{className:"agent-dd-fly-loading",children:"读取信息失败"}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"agent-dd-fly-name",children:e.name}),e.description&&c.jsx("div",{className:"agent-dd-fly-desc",children:e.description}),c.jsxs("div",{className:"agent-dd-fly-field",children:[c.jsx(kI,{className:"icon"}),c.jsx("span",{className:"agent-dd-fly-model",children:e.model})]}),e.tools.length>0&&c.jsxs("div",{className:"agent-dd-fly-field agent-dd-fly-field--tools",children:[c.jsx(CE,{className:"icon"}),c.jsx("div",{className:"agent-dd-fly-chips",children:e.tools.map(n=>c.jsx("span",{className:"agent-dd-chip",children:n},n))})]}),e.subAgents.length>0&&c.jsxs("div",{className:"agent-dd-fly-field",children:[c.jsx("span",{className:"agent-dd-fly-label",children:"子 Agent"}),c.jsx("span",{className:"agent-dd-fly-model",children:e.subAgents.join("、")})]})]})})}const Bk={llm:{icon:Ha,label:"LLM"},sequential:{icon:II,label:"顺序"},parallel:{icon:PI,label:"并行"},loop:{icon:AE,label:"循环"},a2a:{icon:um,label:"A2A"}};function XL(e){return 1+e.children.reduce((t,n)=>t+XL(n),0)}function xl(e){return e.id||e.name}function $Z(e,t){const n=xl(e);if(e.id&&e.name&&e.name!==n)return e.name;if(t&&n==="agent")return"主 Agent";const r=/^agent_sub_(\d+)$/.exec(n);return r?`子 Agent ${r[1]}`:e.name||n}function QL(e,t=!0){return{...e,id:xl(e),name:$Z(e,t),children:e.children.map(n=>QL(n,!1))}}function ZL(e,t){t.set(xl(e),e.name||xl(e)),e.children.forEach(n=>ZL(n,t))}function JL({node:e,activeAgent:t,seen:n,path:r}){const s=Bk[e.type]??Bk.llm,i=s.icon,a=xl(e),o=!!a,l=o&&a===t,u=o&&!l&&r.has(a),d=o&&!l&&!u&&n.has(a);return c.jsxs("div",{className:"topo-branch",children:[c.jsxs("div",{className:`topo-node topo-type-${e.type} ${l?"is-active":""} ${u?"is-onpath":""} ${d?"is-done":""}`,title:e.description||e.name,children:[c.jsx(i,{className:"topo-icon"}),c.jsx("span",{className:"topo-name",children:e.name||"(未命名)"}),c.jsx("span",{className:"topo-badge",children:s.label})]}),l&&e.type==="a2a"&&c.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&c.jsx("div",{className:"topo-children",children:e.children.map((f,h)=>c.jsx(JL,{node:f,activeAgent:t,seen:n,path:r},`${xl(f)}-${h}`))})]})}function Fk({appName:e,activeAgent:t,seenAgents:n,execPath:r=[]}){const[s,i]=v.useState(null);if(v.useEffect(()=>{let l=!1;if(i(null),!!e)return hd(e).then(u=>{l||i(u.graph?QL(u.graph):null)}).catch(()=>{l||i(null)}),()=>{l=!0}},[e]),!s||s.children.length===0)return null;const a=new Set(r),o=new Map;return ZL(s,o),c.jsxs("aside",{className:"topo","aria-label":"Agent 拓扑",children:[c.jsxs("div",{className:"topo-head",children:[c.jsx("span",{className:"topo-head-title",children:"Agent 拓扑"}),c.jsxs("span",{className:"topo-head-sub",children:[XL(s)," 个"]})]}),r.length>0&&c.jsx("div",{className:"topo-path","aria-label":"执行路径",children:r.map((l,u)=>c.jsxs("span",{className:"topo-path-seg",children:[u>0&&c.jsx(lr,{className:"topo-path-sep"}),c.jsx("span",{className:u===r.length-1?"topo-path-name is-current":"topo-path-name",children:o.get(l)??l})]},`${l}-${u}`))}),c.jsx("div",{className:"topo-tree",children:c.jsx(JL,{node:s,activeAgent:t,seen:n,path:a})})]})}function HZ({onAdded:e,onCancel:t}){const[n,r]=v.useState(""),[s,i]=v.useState(""),[a,o]=v.useState(""),[l,u]=v.useState(!1),[d,f]=v.useState(""),h=n.trim().length>0&&s.trim().length>0&&!l;async function p(){if(h){u(!0),f("");try{const m=await KL(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(Ka(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return c.jsx("div",{className:"addagent",children:c.jsxs("div",{className:"addagent-card",children:[c.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),c.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),c.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"API Key"}),c.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),c.jsxs("label",{className:"addagent-field",children:[c.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),c.jsx("input",{className:"addagent-input",value:a,onChange:m=>o(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&c.jsx("div",{className:"addagent-error",children:d}),c.jsxs("div",{className:"addagent-actions",children:[c.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:l,children:"取消"}),c.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[l?c.jsx(bt,{className:"icon spin"}):null,l?"连接中…":"连接并添加"]})]})]})})}function zZ({currentRuntimeId:e,onConnect:t}){const[n,r]=v.useState([]),[s,i]=v.useState(!0),[a,o]=v.useState(""),[l,u]=v.useState(null),[d,f]=v.useState(null),[h,p]=v.useState(null),[m,y]=v.useState({}),[w,g]=v.useState("cn-beijing"),[E,b]=v.useState(!1),_=v.useCallback(async()=>{i(!0),o("");try{r(await QI(w))}catch(R){o(R instanceof Error?R.message:String(R))}finally{i(!1)}},[w]);v.useEffect(()=>{_()},[_]);async function k(R){y(M=>({...M,[R.runtimeId]:{loading:!0}}));const I={loading:!1};try{I.detail=await ME(R.runtimeId,R.region)}catch(M){I.error=M instanceof Error?M.message:String(M)}I.detail&&(I.graphs=[{name:I.detail.name,description:I.detail.description,type:"llm",model:I.detail.model,tools:[],skills:[],path:[I.detail.name],mentionable:!1,children:[]}],I.graphNote="仅显示主 Agent(控制面信息)。"),y(M=>({...M,[R.runtimeId]:I}))}function T(R){const I=h===R.runtimeId;p(I?null:R.runtimeId),!I&&!m[R.runtimeId]&&k(R)}async function A(R){if(!l&&window.confirm(`确定删除 Agent "${R.name}"?该 Runtime 将被永久删除。`)){u(R.runtimeId),o("");try{await nR(R.runtimeId,R.region),r(I=>I.filter(M=>M.runtimeId!==R.runtimeId))}catch(I){o(I instanceof Error?I.message:String(I))}finally{u(null)}}}async function N(R){if(!(d||e===R.runtimeId)){f(R.runtimeId),o("");try{await t(R)}catch(I){o(I instanceof Error?I.message:String(I))}finally{f(null)}}}return c.jsxs("div",{className:"manage",children:[c.jsxs("div",{className:"manage-head",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"manage-title",children:"管理 Agent"}),c.jsx("p",{className:"manage-sub",children:"列出你有权管理的 AgentKit Runtime"})]}),c.jsxs("div",{className:"manage-head-actions",children:[c.jsxs("div",{className:"manage-region-picker",onKeyDown:R=>{R.key==="Escape"&&b(!1)},children:[c.jsxs("button",{type:"button",className:"manage-region",onClick:()=>b(R=>!R),title:"按区域筛选","aria-label":"区域筛选","aria-haspopup":"listbox","aria-expanded":E,children:[c.jsx("span",{children:w==="cn-beijing"?"北京":"上海"}),c.jsx(op,{className:`manage-region-chevron${E?" is-open":""}`})]}),E&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>b(!1)}),c.jsx("div",{className:"manage-region-menu",role:"listbox","aria-label":"区域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(R=>{const I=R.value===w;return c.jsxs("button",{type:"button",role:"option","aria-selected":I,className:`manage-region-option${I?" is-selected":""}`,onClick:()=>{g(R.value),b(!1)},children:[c.jsx("span",{children:R.label}),I&&c.jsx(Bs,{"aria-hidden":"true"})]},R.value)})})]})]}),c.jsxs("button",{type:"button",className:"manage-refresh",onClick:()=>void _(),disabled:s,title:"刷新",children:[c.jsx(SE,{className:`icon ${s?"spin":""}`}),"刷新"]})]})]}),a&&c.jsx("div",{className:"manage-error",children:a}),s?c.jsxs("div",{className:"manage-empty",children:[c.jsx(bt,{className:"icon spin"})," 加载中…"]}):n.length===0?c.jsx("div",{className:"manage-empty",children:"暂无你部署的 Agent。"}):c.jsx("ul",{className:"manage-list",children:n.map(R=>{const I=h===R.runtimeId,M=m[R.runtimeId];return c.jsxs("li",{className:"manage-item",children:[c.jsxs("div",{className:"manage-item-row",children:[c.jsxs("button",{type:"button",className:"manage-item-toggle",onClick:()=>T(R),"aria-expanded":I,children:[I?c.jsx(op,{className:"icon"}):c.jsx(lr,{className:"icon"}),c.jsxs("span",{className:"manage-item-main",children:[c.jsx("span",{className:"manage-item-name",children:R.name}),c.jsx("span",{className:`manage-badge is-${qZ(R.status)}`,children:R.status||"-"})]})]}),c.jsxs("div",{className:"manage-item-actions",children:[c.jsxs("button",{type:"button",className:"manage-connect",onClick:()=>void N(R),disabled:d!==null||e===R.runtimeId,children:[d===R.runtimeId?c.jsx(bt,{className:"icon spin"}):c.jsx(TF,{className:"icon"}),e===R.runtimeId?"已连接":"连接到此 Agent"]}),c.jsx("button",{type:"button",className:"manage-del",onClick:()=>void A(R),disabled:l===R.runtimeId,title:"删除该 Runtime",children:l===R.runtimeId?c.jsx(bt,{className:"icon spin"}):c.jsx(Fl,{className:"icon"})})]})]}),c.jsxs("div",{className:"manage-item-meta",children:[c.jsx("span",{className:"manage-item-id",title:R.runtimeId,children:R.runtimeId}),c.jsx("span",{className:"manage-item-dot",children:"·"}),c.jsx("span",{children:R.region}),R.createdAt&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"manage-item-dot",children:"·"}),c.jsx("span",{children:tM(R.createdAt)})]})]}),I&&c.jsx("div",{className:"manage-detail",children:!M||M.loading?c.jsxs("div",{className:"manage-detail-loading",children:[c.jsx(bt,{className:"icon spin"})," 读取详情…"]}):c.jsxs(c.Fragment,{children:[M.error&&c.jsx("div",{className:"manage-error",children:M.error}),M.detail&&c.jsx(YZ,{detail:M.detail}),c.jsx("div",{className:"manage-tree-head",children:"Agent 结构"}),M.graphs&&M.graphs.length>0?M.graphs.map((B,Y)=>c.jsx(eM,{node:B},Y)):c.jsx("div",{className:"manage-tree-note",children:M.graphNote})]})})]},R.runtimeId)})})]})}const VZ=/KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL/i;function KZ({envKey:e,value:t}){const[n,r]=v.useState(!1);return!VZ.test(e)||n?c.jsx("code",{className:"manage-env-v",children:t}):c.jsx("button",{type:"button",className:"manage-env-v manage-env-masked",title:"敏感值已隐藏,点击显示","aria-label":`显示 ${e} 的值`,onClick:()=>r(!0),children:"••••••••"})}function YZ({detail:e}){const t=e.resources,n=[];e.model&&n.push(["模型",e.model]),e.description&&n.push(["描述",e.description]),e.statusMessage&&n.push(["状态信息",e.statusMessage]),e.project&&n.push(["Project",e.project]),e.currentVersion!=null&&n.push(["版本",String(e.currentVersion)]);const r=[t.cpuMilli!=null?`CPU ${t.cpuMilli}m`:"",t.memoryMb!=null?`内存 ${t.memoryMb}MB`:"",t.minInstance!=null||t.maxInstance!=null?`实例 ${t.minInstance??"?"}~${t.maxInstance??"?"}`:"",t.maxConcurrency!=null?`并发 ${t.maxConcurrency}`:""].filter(Boolean).join(" · ");return r&&n.push(["资源",r]),e.memoryId&&n.push(["Memory",e.memoryId]),e.toolId&&n.push(["Tool",e.toolId]),e.knowledgeId&&n.push(["Knowledge",e.knowledgeId]),e.mcpToolsetId&&n.push(["MCP Toolset",e.mcpToolsetId]),e.updatedAt&&n.push(["更新时间",tM(e.updatedAt)]),c.jsxs("div",{className:"manage-detail-card",children:[c.jsx("dl",{className:"manage-kv",children:n.map(([s,i])=>c.jsxs("div",{className:"manage-kv-row",children:[c.jsx("dt",{children:s}),c.jsx("dd",{children:i})]},s))}),e.envs.length>0&&c.jsxs("div",{className:"manage-envs",children:[c.jsx("div",{className:"manage-envs-head",children:"环境变量"}),e.envs.map(s=>c.jsxs("div",{className:"manage-env",children:[c.jsx("code",{className:"manage-env-k",children:s.key}),c.jsx(KZ,{envKey:s.key,value:s.value})]},s.key))]})]})}const WZ={llm:"LLM",sequential:"Sequential",parallel:"Parallel",loop:"Loop",a2a:"A2A"};function eM({node:e,depth:t=0}){return c.jsxs("div",{className:"manage-tree",style:{marginLeft:t?16:0},children:[c.jsxs("div",{className:"manage-tree-node",children:[c.jsx("span",{className:"manage-tree-name",children:e.name||"(未命名)"}),c.jsx("span",{className:"manage-tree-type",children:WZ[e.type]||e.type}),e.model&&c.jsx("span",{className:"manage-tree-model",children:e.model})]}),e.tools.length>0&&c.jsx("div",{className:"manage-tree-tools",children:e.tools.map(n=>c.jsx("span",{className:"manage-tree-tool",children:n},n))}),e.children.map((n,r)=>c.jsx(eM,{node:n,depth:t+1},r))]})}function qZ(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}function tM(e){const t=Number(e),n=Number.isFinite(t)&&String(t)===e?new Date(t*1e3):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()}const GZ={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function XZ(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(const s of n){if(r==null||typeof r!="object")return;r=r[s]}return r}function QZ(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function ZZ(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dx(e,t){if(QZ(e))return XZ(t,e.path);if(ZZ(e)){const n=GZ[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=dx(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function JZ(e,t){const n=dx(e,t);return n==null?"":typeof n=="string"?n:String(n)}const nM=new Map;function io(e,t){nM.set(e,t)}function eJ(e){return nM.get(e)}function tJ(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;idx(r,e.dataModel),resolveString:r=>JZ(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=eJ(s.component)??nJ;return c.jsx(i,{node:s,ctx:n},r)}};return c.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function sM(e){const t=v.useRef(null),n=v.useRef(!0),r=28,s=v.useCallback(()=>{const i=t.current;i&&(n.current=i.scrollHeight-i.scrollTop-i.clientHeight{const i=t.current;i&&n.current&&(i.scrollTop=i.scrollHeight)},[e]),{ref:t,onScroll:s}}function fx({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:c.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>c.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[c.jsx(za,{"aria-hidden":!0}),c.jsxs("span",{children:["/",r.name]}),t?c.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:c.jsx(Xr,{})}):null]},r.name)),e.targetAgent?c.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[c.jsx(vI,{"aria-hidden":!0}),c.jsx("span",{children:e.targetAgent.name}),n?c.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:c.jsx(Xr,{})}):null]}):null]})}function hx(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function iM(e){var n,r,s,i;const t=hx(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((r=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:r.toUpperCase())??"VIDEO":t==="image"?((i=(s=e.mimeType)==null?void 0:s.split("/")[1])==null?void 0:i.toUpperCase())??"IMAGE":"TXT"}function aM(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function oM(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?VI(t,e.uri):""}function sJ({kind:e}){return e==="image"?c.jsx(RI,{}):e==="video"?c.jsx(AI,{}):e==="pdf"?c.jsx(gF,{}):c.jsx(SI,{})}function px({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=v.useState(null);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const o=hx(a.mimeType),l=oM(a,e),u=a.status==="uploading"||a.status==="error"||!l,d=c.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[o==="image"&&l?c.jsx("img",{className:"media-card-image",src:l,alt:a.name??"图片",loading:"lazy"}):o==="video"&&l?c.jsxs("div",{className:"media-card-video-container",children:[c.jsx("video",{className:"media-card-video",src:l,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),c.jsx("span",{className:"media-card-video-play",children:c.jsx(DF,{})})]}):c.jsx("span",{className:"media-card-icon",children:c.jsx(sJ,{kind:o})}),c.jsxs("span",{className:"media-card-copy",children:[c.jsx("span",{className:"media-card-name",children:a.name??"附件"}),c.jsxs("span",{className:"media-card-meta",children:[c.jsx("span",{className:"media-card-type",children:iM(a)}),a.status==="uploading"?c.jsxs(c.Fragment,{children:[c.jsx(bt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":aM(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?c.jsx(Gc,{className:"media-card-open"}):null]});return c.jsxs(Gt.div,{className:`media-card media-card--${o}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[o==="image"&&!u?c.jsx(yI,{src:l,children:d}):d,r?c.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:c.jsx(Xr,{})}):null]},a.id)})}),c.jsx(Hi,{children:s?c.jsx(iJ,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function iJ({appName:e,item:t,onClose:n}){const r=v.useMemo(()=>oM(t,e),[e,t]),s=hx(t.mimeType),[i,a]=v.useState(""),[o,l]=v.useState(s==="text"||s==="markdown"),[u,d]=v.useState("");return v.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),v.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const f=new AbortController;return l(!0),d(""),fetch(r,{signal:f.signal}).then(h=>{if(!h.ok)throw new Error(`HTTP ${h.status}`);return h.text()}).then(a).catch(h=>{f.signal.aborted||d(h instanceof Error?h.message:String(h))}).finally(()=>{f.signal.aborted||l(!1)}),()=>f.abort()},[s,r]),c.jsx(Gt.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":t.name??"附件预览",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&n()},children:c.jsxs(Gt.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[c.jsxs("header",{className:"media-viewer-header",children:[c.jsxs("div",{children:[c.jsx("strong",{children:t.name??"附件"}),c.jsxs("span",{children:[iM(t),t.sizeBytes?` · ${aM(t.sizeBytes)}`:""]})]}),c.jsxs("nav",{children:[c.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:c.jsx(TE,{})}),c.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:c.jsx(Xr,{})})]})]}),c.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?c.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?c.jsx("div",{className:"media-viewer-video-wrapper",children:c.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?c.jsx("iframe",{src:r,title:t.name??"PDF"}):null,o?c.jsxs("div",{className:"media-viewer-loading",children:[c.jsx(bt,{})," 正在读取文档…"]}):null,!o&&u?c.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!o&&s==="markdown"?c.jsx("div",{className:"media-document",children:c.jsx(_d,{text:i})}):null,!o&&s==="text"?c.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Yl({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const o=Math.min(Math.max(r,5),45);return c.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-o}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+o}%)`,animationDuration:`${n}s`},...a,children:s})}function aJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),c.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function oJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),c.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),c.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),c.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function lJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"3.25",y:"5.5",width:"16.25",height:"13",rx:"2.4"}),c.jsx("path",{d:"m10.2 9.2 4.4 2.8-4.4 2.8V9.2Z"}),c.jsx("path",{d:"m19.25 2.5.42 1.2 1.2.42-1.2.42-.42 1.2-.42-1.2-1.2-.42 1.2-.42.42-1.2Z",fill:"currentColor",stroke:"none"})]})}function cJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),c.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),c.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function uJ(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),c.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),c.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),c.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function lM(e){return c.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:c.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function dJ({definition:e,done:t,open:n,onToggle:r}){const s=e.icon;return c.jsxs("button",{type:"button",className:`builtin-tool-head${t?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":n,children:[c.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:c.jsx(s,{})}),t?c.jsx("span",{className:"builtin-tool-label",children:e.doneLabel}):c.jsx(Yl,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:e.runningLabel}),c.jsx(lM,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}const fJ={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:aJ},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:oJ},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:lJ},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:cJ},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:uJ}};function hJ(e){return fJ[e]}const cM="send_a2ui_json_to_client";function pJ({className:e}){return c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.jsx("path",{d:"M12 2.2l1.7 5.1a3 3 0 0 0 1.9 1.9L20.8 11l-5.1 1.7a3 3 0 0 0-1.9 1.9L12 19.8l-1.7-5.1a3 3 0 0 0-1.9-1.9L3.2 11l5.1-1.7a3 3 0 0 0 1.9-1.9L12 2.2z"})})}function mJ(){return c.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function uM({text:e,done:t}){const[n,r]=v.useState(!t),s=v.useRef(!1);v.useEffect(()=>{s.current||r(!t)},[t]);const i=()=>{s.current=!0,r(u=>!u)},a=e.replace(/^\s+/,""),{ref:o,onScroll:l}=sM(a);return c.jsxs("div",{className:"block-thinking",children:[c.jsxs("button",{className:"think-head",onClick:i,type:"button",children:[c.jsx("span",{className:"think-icon","aria-hidden":"true",children:c.jsx(pJ,{className:`spark ${t?"":"pulse"}`})}),t?c.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):c.jsx(Yl,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),c.jsx(lr,{className:`chev ${n?"open":""}`})]}),c.jsx("div",{className:`think-collapse ${n&&a?"open":""}`,children:c.jsx("div",{className:"think-collapse-inner",children:c.jsx("div",{className:"think-body scroll",ref:o,onScroll:l,children:a})})})]})}function dM(){return c.jsx(uM,{text:"",done:!1})}function gJ({name:e,args:t,response:n,done:r}){const[s,i]=v.useState(!1),a=e===cM?"渲染 UI":e,o=hJ(e),l=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),u=l&&l.length>2e3?l.slice(0,2e3)+` +…(已截断)`:l;return c.jsxs(Gt.div,{className:`block-tool${o?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o?c.jsx(dJ,{definition:o,done:r,open:s,onToggle:()=>i(d=>!d)}):c.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[c.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:c.jsx(mJ,{})}),r?c.jsx("span",{className:"tool-name",children:a}):c.jsx(Yl,{className:"tool-name",duration:2.2,spread:15,children:a}),c.jsx(lM,{className:`tool-chevron${s?" is-open":""}`})]}),c.jsx("div",{className:`think-collapse ${s?"open":""}`,children:c.jsx("div",{className:"think-collapse-inner",children:c.jsxs("div",{className:"tool-detail",children:[t!=null&&c.jsxs("div",{className:"tool-section",children:[c.jsx("div",{className:"tool-section-label",children:"参数"}),c.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&c.jsxs("div",{className:"tool-section",children:[c.jsx("div",{className:"tool-section-label",children:"返回"}),c.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function yJ({block:e,onAuth:t}){const[n,r]=v.useState(e.done?"done":"idle"),[s,i]=v.useState(""),a=e.label||"MCP 工具集",o=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),l=async()=>{if(t){i(""),r("authorizing");try{await t(e),r("done")}catch(d){i(d instanceof Error?d.message:String(d)),r("idle")}}};return e.done||n==="done"?c.jsxs(Gt.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[c.jsx(F_,{className:"auth-card-icon auth-card-icon--done"}),c.jsxs("span",{children:["已授权 · ",a]})]}):c.jsxs(Gt.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[c.jsxs("div",{className:"auth-card-head",children:[c.jsx(F_,{className:"auth-card-icon"}),c.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),c.jsxs("p",{className:"auth-card-desc",children:["工具集 ",c.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",o&&c.jsxs(c.Fragment,{children:[" ","将跳转至 ",c.jsx("code",{className:"auth-card-code",children:o})," 完成登录,"]}),"授权完成后对话自动继续。"]}),c.jsx("button",{className:"auth-card-btn",onClick:l,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?c.jsxs(c.Fragment,{children:[c.jsx(bt,{className:"cw-i spin"})," 等待授权…"]}):c.jsx(c.Fragment,{children:"去授权"})}),!e.authUri&&c.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&c.jsx("div",{className:"auth-card-err",children:s})]})}function mx({blocks:e,appName:t="",onAction:n,onAuth:r}){return c.jsx(c.Fragment,{children:e.map((s,i)=>{switch(s.kind){case"thinking":return c.jsx(uM,{text:s.text,done:s.done},i);case"text":{const a=s.text.replace(/^\s+/,"");return a?c.jsx("div",{className:"bubble",children:c.jsx(_d,{text:a})},i):null}case"attachment":return c.jsx(px,{appName:t,items:s.files},i);case"invocation":return c.jsx(fx,{value:s.value},i);case"tool":return s.name===cM&&s.done?null:c.jsx(gJ,{name:s.name,args:s.args,response:s.response,done:s.done},i);case"auth":return c.jsx(yJ,{block:s,onAuth:r},i);case"a2ui":return rM(s.messages).filter(a=>a.components[a.rootId]).map(a=>c.jsx(Gt.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:c.jsx(rJ,{surface:a,onAction:n})},`${i}-${a.surfaceId}`));default:return null}})})}function bJ(e){return e.isComposing||e.keyCode===229}const _s=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"临时会话",description:"在 AgentKit 沙箱中执行一次性任务"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}];function Uk({mode:e}){return e==="skill-create"?c.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M10 2.2l1.35 4.1 4.15 1.35-4.15 1.35L10 13.1 8.65 9 4.5 7.65 8.65 6.3 10 2.2Z"}),c.jsx("path",{d:"M15.6 12.2l.6 1.8 1.8.6-1.8.6-.6 1.8-.6-1.8-1.8-.6 1.8-.6.6-1.8Z"})]}):e==="temporary"?c.jsx("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M4.1 4.2h11.8v8.7H9l-3.5 2.8v-2.8H4.1z",strokeDasharray:"2.25 1.9"})}):c.jsx(Hu,{className:"new-chat-mode__agent-icon"})}function EJ({value:e,agentName:t,onChange:n,disabled:r=!1,temporaryEnabled:s,skillCreateEnabled:i}){const[a,o]=v.useState(!1),[l,u]=v.useState(()=>_s.findIndex(E=>E.value===e)),d=v.useRef(null),f=v.useRef(null),h=_s.find(E=>E.value===e)??_s[0];function p(E){return E.value==="temporary"?s:E.value==="skill-create"?i:!0}function m(E){return p(E)!==!0}function y(E){const b=p(E);return b===void 0?"正在检查配置":b?E.description:"管理员未配置"}v.useEffect(()=>{if(!a)return;const E=b=>{var _;(_=d.current)!=null&&_.contains(b.target)||o(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[a]);function w(E){let b=l;do b=(b+E+_s.length)%_s.length;while(m(_s[b]));u(b)}function g(E){var b;m(E)||(n(E.value),o(!1),(b=f.current)==null||b.focus())}return c.jsxs("div",{className:"new-chat-mode",ref:d,children:[c.jsxs("button",{ref:f,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":a,disabled:r,onClick:()=>{u(_s.findIndex(E=>E.value===e)),o(E=>!E)},onKeyDown:E=>{E.key==="ArrowDown"||E.key==="ArrowUp"?(E.preventDefault(),a?w(E.key==="ArrowDown"?1:-1):o(!0)):a&&(E.key==="Enter"||E.key===" ")?(E.preventDefault(),g(_s[l])):a&&E.key==="Escape"&&(E.preventDefault(),o(!1))},children:[c.jsx("span",{className:"new-chat-mode__icon",children:c.jsx(Uk,{mode:h.value})}),c.jsx("span",{className:"new-chat-mode__current",title:h.value==="agent"?t:void 0,children:h.value==="agent"?t:h.label}),c.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:c.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),a?c.jsx("div",{className:"new-chat-mode__menu",role:"listbox","aria-label":"新会话模式",tabIndex:-1,onKeyDown:E=>{var b;E.key==="ArrowDown"||E.key==="ArrowUp"?(E.preventDefault(),w(E.key==="ArrowDown"?1:-1)):E.key==="Enter"?(E.preventDefault(),g(_s[l])):E.key==="Escape"&&(E.preventDefault(),o(!1),(b=f.current)==null||b.focus())},children:_s.map((E,b)=>c.jsxs("button",{type:"button",role:"option","aria-selected":e===E.value,"aria-disabled":m(E),disabled:m(E),className:`new-chat-mode__option${b===l?" is-active":""}`,onMouseEnter:()=>u(b),onClick:()=>g(E),children:[c.jsx("span",{className:"new-chat-mode__option-icon",children:c.jsx(Uk,{mode:E.value})}),c.jsxs("span",{className:"new-chat-mode__copy",children:[c.jsxs("span",{className:"new-chat-mode__label",children:[E.value==="agent"?t:E.label,E.value==="skill-create"?c.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),c.jsx("span",{children:y(E)})]}),e===E.value?c.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:c.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},E.value))}):null]})}const gx=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function xJ({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:o,busy:l,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:y=!0,onInvocationChange:w,onAddFiles:g,onRemoveAttachment:E,newChatMode:b="agent",newChatLayout:_=!1,showModeSelector:k=!1,onModeChange:T,temporaryEnabled:A,skillCreateEnabled:N}){const R=v.useRef(null),I=v.useRef(null),M=v.useRef(null),B=v.useRef(null),[Y,P]=v.useState(!1),[U,C]=v.useState(null),[L,O]=v.useState(0),[j,S]=v.useState(!1);async function H(){if(e)try{await navigator.clipboard.writeText(e),S(!0),setTimeout(()=>S(!1),1500)}catch{S(!1)}}v.useLayoutEffect(()=>{const J=R.current;J&&(J.style.height="auto",J.style.height=`${Math.min(J.scrollHeight,200)}px`)},[s]);const V=b==="skill-create";v.useEffect(()=>{V&&(P(!1),C(null))},[V]);const D=!V&&d.some(J=>J.status!=="ready"),ne=!o&&!l&&!D&&(s.trim().length>0||!V&&d.length>0),ee=(U==null?void 0:U.query.toLocaleLowerCase())??"",re=(U==null?void 0:U.kind)==="skill"?f.filter(J=>!p.skills.some(ce=>ce.name===J.name)).filter(J=>`${J.name} ${J.description}`.toLocaleLowerCase().includes(ee)).map(J=>({kind:"skill",value:J})):(U==null?void 0:U.kind)==="agent"?h.filter(J=>`${J.name} ${J.description}`.toLocaleLowerCase().includes(ee)).map(J=>({kind:"agent",value:J})):[];function de(J){var ce;P(!1),C(null),(ce=J.current)==null||ce.click()}function G(J,ce){const Ce=J.slice(0,ce),Ee=/(^|\s)([/@])([^\s/@]*)$/.exec(Ce);if(!Ee){C(null);return}const ge=Ee[2].length+Ee[3].length,Le={kind:Ee[2]==="/"?"skill":"agent",query:Ee[3],start:ce-ge,end:ce},ve=!U||U.kind!==Le.kind||U.query!==Le.query||U.start!==Le.start||U.end!==Le.end;C(Le),ve&&O(0),P(!1)}function W(J){if(!U)return;const ce=s.slice(0,U.start)+s.slice(U.end);i(ce),J.kind==="skill"?w({...p,skills:[...p.skills,J.value]}):w({skills:[],targetAgent:J.value});const Ce=U.start;C(null),requestAnimationFrame(()=>{var Ee,ge;(Ee=R.current)==null||Ee.focus(),(ge=R.current)==null||ge.setSelectionRange(Ce,Ce)})}function oe(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function he(J){const ce=J.target.files?Array.from(J.target.files):[];ce.length&&g(ce),J.target.value=""}return c.jsxs("div",{className:`composer${_?" composer--new-chat":""}`,children:[V?null:c.jsx(fx,{value:p,onRemoveSkill:J=>w({...p,skills:p.skills.filter(ce=>ce.name!==J)}),onRemoveAgent:()=>w({skills:[]})}),!V&&d.length>0&&c.jsx(px,{appName:n,compact:!0,items:d,onRemove:E}),c.jsxs("div",{className:"composer-box",children:[U?c.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":U.kind==="skill"?"可用技能":"可用子 Agent",children:[c.jsxs("div",{className:"composer-command-head",children:[U.kind==="skill"?c.jsx(za,{}):c.jsx(vI,{}),c.jsx("span",{children:U.kind==="skill"?"调用技能":"使用子 Agent"}),c.jsx("kbd",{children:U.kind==="skill"?"/":"@"})]}),m?c.jsxs("div",{className:"composer-command-empty",children:[c.jsx(bt,{className:"spin"})," 正在读取 Agent 能力…"]}):re.length===0?c.jsx("div",{className:"composer-command-empty",children:U.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):c.jsx("div",{className:"composer-command-list",children:re.map((J,ce)=>c.jsxs("button",{type:"button",role:"option","aria-selected":ce===L,className:`composer-command-item${ce===L?" is-active":""}`,onMouseDown:Ce=>{Ce.preventDefault(),W(J)},onMouseEnter:()=>O(ce),children:[c.jsx("span",{className:`composer-command-icon composer-command-icon--${J.kind}`,children:J.kind==="skill"?c.jsx(za,{}):c.jsx(Ha,{})}),c.jsxs("span",{className:"composer-command-copy",children:[c.jsxs("strong",{children:[J.kind==="skill"?"/":"@",J.value.name]}),c.jsx("span",{children:J.value.description||(J.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),c.jsx("kbd",{children:ce===L?"↵":J.kind==="skill"?"技能":"Agent"})]},`${J.kind}-${J.value.name}`))})]}):null,V?null:c.jsxs("div",{className:"composer-menu-wrap",children:[c.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:o||!y,onClick:()=>{C(null),P(J=>!J)},children:c.jsx(ms,{className:"icon"})}),Y&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"menu-scrim",onClick:()=>P(!1)}),c.jsxs("div",{className:"composer-menu",role:"menu",children:[c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(I),children:[c.jsx(RI,{className:"icon"}),"上传图片"]}),c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(M),children:[c.jsx(SI,{className:"icon"}),"上传文档或 PDF"]}),c.jsxs("button",{type:"button",className:"menu-item",onClick:()=>de(B),children:[c.jsx(AI,{className:"icon"}),"上传视频"]})]})]})]}),c.jsx("div",{className:"composer-input-stack",children:c.jsx("textarea",{ref:R,className:"comp-input scroll",rows:_?4:1,value:s,disabled:o,placeholder:V?`描述你想创建的 Skill,将使用 ${gx.join(" 和 ")} 并行创建…`:o?"请选择 Agent":`向 ${r} 发消息…`,"aria-expanded":!!U,onChange:J=>{i(J.target.value),V||G(J.target.value,J.target.selectionStart)},onSelect:J=>{V||G(J.currentTarget.value,J.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>C(null),0),onKeyDown:J=>{if(!bJ(J.nativeEvent)){if(U){if(J.key==="ArrowDown"&&re.length>0){J.preventDefault(),O(ce=>(ce+1)%re.length);return}if(J.key==="ArrowUp"&&re.length>0){J.preventDefault(),O(ce=>(ce-1+re.length)%re.length);return}if((J.key==="Enter"||J.key==="Tab")&&re[L]){J.preventDefault(),W(re[L]);return}if(J.key==="Escape"){J.preventDefault(),C(null);return}}if(J.key==="Backspace"&&!s&&J.currentTarget.selectionStart===0&&J.currentTarget.selectionEnd===0){oe();return}J.key==="Enter"&&!J.shiftKey&&(J.preventDefault(),ne&&a())}}})}),k&&T?c.jsx(EJ,{value:b,agentName:r,onChange:T,disabled:l,temporaryEnabled:A,skillCreateEnabled:N}):null,c.jsx(Gt.button,{type:"button",className:"comp-send",disabled:!ne,onClick:a,"aria-label":"发送",whileTap:ne?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:l?c.jsx(bt,{className:"icon spin"}):c.jsx(wI,{className:"icon"})})]}),u&&c.jsxs("div",{className:"composer-meta",children:[c.jsxs("span",{className:"composer-session-line",children:["会话 ID:",c.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&c.jsx("button",{type:"button",className:"composer-session-copy",title:j?"已复制":"复制会话 ID","aria-label":j?"已复制会话 ID":"复制会话 ID",onClick:()=>void H(),children:j?c.jsx(Bs,{}):c.jsx(_E,{})})]}),c.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),c.jsx("span",{children:"回答仅供参考"})]}),c.jsx("input",{ref:I,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:he}),c.jsx("input",{ref:M,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:he}),c.jsx("input",{ref:B,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:he})]})}function fM({title:e,sub:t,cards:n,footer:r}){return c.jsxs("div",{className:"stk",children:[c.jsxs("div",{className:"stk-head",children:[c.jsx("h1",{className:"stk-title",children:e}),t&&c.jsx("p",{className:"stk-sub",children:t})]}),c.jsx("div",{className:"stk-list",children:n.map((s,i)=>c.jsxs(Gt.button,{type:"button",className:`stk-card ${s.disabled?"stk-card-disabled":""}`,onClick:s.disabled?void 0:s.onClick,disabled:s.disabled,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18,ease:"easeOut",delay:i*.04},children:[c.jsx("span",{className:"stk-card-icon",children:c.jsx(s.icon,{})}),c.jsxs("span",{className:"stk-card-text",children:[c.jsx("span",{className:"stk-card-title",children:s.title}),c.jsx("span",{className:"stk-card-desc",children:s.desc})]}),c.jsx(lr,{className:"stk-card-arrow"})]},s.key))}),r&&c.jsx("div",{className:"stk-footer",children:r})]})}const yx=Symbol.for("yaml.alias"),S1=Symbol.for("yaml.document"),zi=Symbol.for("yaml.map"),hM=Symbol.for("yaml.pair"),js=Symbol.for("yaml.scalar"),Wl=Symbol.for("yaml.seq"),Qr=Symbol.for("yaml.node.type"),ql=e=>!!e&&typeof e=="object"&&e[Qr]===yx,Td=e=>!!e&&typeof e=="object"&&e[Qr]===S1,kd=e=>!!e&&typeof e=="object"&&e[Qr]===zi,mn=e=>!!e&&typeof e=="object"&&e[Qr]===hM,jt=e=>!!e&&typeof e=="object"&&e[Qr]===js,Nd=e=>!!e&&typeof e=="object"&&e[Qr]===Wl;function hn(e){if(e&&typeof e=="object")switch(e[Qr]){case zi:case Wl:return!0}return!1}function pn(e){if(e&&typeof e=="object")switch(e[Qr]){case yx:case zi:case js:case Wl:return!0}return!1}const pM=e=>(jt(e)||hn(e))&&!!e.anchor,ma=Symbol("break visit"),wJ=Symbol("skip children"),iu=Symbol("remove node");function Gl(e,t){const n=vJ(t);Td(e)?$o(null,e.contents,n,Object.freeze([e]))===iu&&(e.contents=null):$o(null,e,n,Object.freeze([]))}Gl.BREAK=ma;Gl.SKIP=wJ;Gl.REMOVE=iu;function $o(e,t,n,r){const s=_J(e,t,n,r);if(pn(s)||mn(s))return TJ(e,r,s),$o(e,s,n,r);if(typeof s!="symbol"){if(hn(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>kJ[t]);class ir{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ir.defaultYaml,t),this.tags=Object.assign({},ir.defaultTags,n)}clone(){const t=new ir(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new ir(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ir.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ir.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:ir.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ir.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,a]=r;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const a=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,a),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+NJ(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&pn(t.contents)){const i={};Gl(t.contents,(a,o)=>{pn(o)&&o.tag&&(i[o.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(o=>o.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` +`)}}ir.defaultYaml={explicit:!1,version:"1.2"};ir.defaultTags={"!!":"tag:yaml.org,2002:"};function mM(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function gM(e){const t=new Set;return Gl(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function yM(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function SJ(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=gM(e));const a=yM(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(jt(a.node)||hn(a.node)))a.node.anchor=a.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=i,o}}},sourceObjects:r}}function Ho(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;sWr(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!pM(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class bx{constructor(t){Object.defineProperty(this,Qr,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Td(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=Wr(this,"",a);if(typeof s=="function")for(const{count:l,res:u}of a.anchors.values())s(u,l);return typeof i=="function"?Ho(i,{"":o},"",o):o}}class Ex extends bx{constructor(t){super(yx),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Gl(t,{Node:(i,a)=>{(ql(a)||pM(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,a=this.resolve(s,n);if(!a){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=r.get(a);if(o||(Wr(a,null,n),o=r.get(a)),(o==null?void 0:o.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=yh(s,a,r)),o.count*o.aliasCount>i)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(mM(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function yh(e,t,n){if(ql(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(hn(t)){let r=0;for(const s of t.items){const i=yh(e,s,n);i>r&&(r=i)}return r}else if(mn(t)){const r=yh(e,t.key,n),s=yh(e,t.value,n);return Math.max(r,s)}return 1}const bM=e=>!e||typeof e!="function"&&typeof e!="object";class Xe extends bx{constructor(t){super(js),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Wr(this.value,t,n)}toString(){return String(this.value)}}Xe.BLOCK_FOLDED="BLOCK_FOLDED";Xe.BLOCK_LITERAL="BLOCK_LITERAL";Xe.PLAIN="PLAIN";Xe.QUOTE_DOUBLE="QUOTE_DOUBLE";Xe.QUOTE_SINGLE="QUOTE_SINGLE";const AJ="tag:yaml.org,2002:";function CJ(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function zu(e,t,n){var f,h,p;if(Td(e)&&(e=e.contents),pn(e))return e;if(mn(e)){const m=(h=(f=n.schema[zi]).createNode)==null?void 0:h.call(f,n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:a,sourceObjects:o}=n;let l;if(r&&e&&typeof e=="object"){if(l=o.get(e),l)return l.anchor??(l.anchor=s(e)),new Ex(l.anchor);l={anchor:null,node:null},o.set(e,l)}t!=null&&t.startsWith("!!")&&(t=AJ+t.slice(2));let u=CJ(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new Xe(e);return l&&(l.node=m),m}u=e instanceof Map?a[zi]:Symbol.iterator in Object(e)?a[Wl]:a[zi]}i&&(i(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((p=u==null?void 0:u.nodeClass)==null?void 0:p.from)=="function"?u.nodeClass.from(n.schema,e,n):new Xe(e);return t?d.tag=t:u.default||(d.tag=u.tag),l&&(l.node=d),d}function _p(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const a=[];a[i]=r,r=a}else r=new Map([[i,r]])}return zu(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Oc=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class EM extends bx{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>pn(r)||mn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Oc(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(hn(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,_p(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(hn(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&jt(i)?i.value:i:hn(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!mn(n))return!1;const r=n.value;return r==null||t&&jt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return hn(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(hn(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,_p(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const IJ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Js(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ka=(e,t,n)=>e.endsWith(` `)?Js(n,t):n.includes(` `)?` -`+Js(n,t):(e.endsWith(" ")?"":" ")+n,xM="flow",C1="block",bh="quoted";function Sm(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:o}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,y=-1,w=-1,g=-1;n===C1&&(y=$N(e,y,t.length),y!==-1&&(f=y+l));for(let b;b=e[y+=1];){if(n===bh&&b==="\\"){switch(w=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}g=y}if(b===` -`)n===C1&&(y=$N(e,y,t.length)),f=y+t.length+l,h=void 0;else{if(b===" "&&p&&p!==" "&&p!==` +`+Js(n,t):(e.endsWith(" ")?"":" ")+n,xM="flow",A1="block",bh="quoted";function Nm(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:o}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,y=-1,w=-1,g=-1;n===A1&&(y=$k(e,y,t.length),y!==-1&&(f=y+l));for(let b;b=e[y+=1];){if(n===bh&&b==="\\"){switch(w=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}g=y}if(b===` +`)n===A1&&(y=$k(e,y,t.length)),f=y+t.length+l,h=void 0;else{if(b===" "&&p&&p!==" "&&p!==` `&&p!==" "){const _=e[y+1];_&&_!==" "&&_!==` -`&&_!==" "&&(h=y)}if(y>=f)if(h)u.push(h),f=h+l,h=void 0;else if(n===bh){for(;p===" "||p===" ";)p=b,b=e[y+=1],m=!0;const _=y>g+1?y-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+l,h=void 0}else m=!0}p=b}if(m&&o&&o(),u.length===0)return e;a&&a();let E=e.slice(0,u[0]);for(let b=0;b({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Cm=e=>/^(%|---|\.\.\.)/m.test(e);function RJ(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,a=0;ir)return!0;if(a=i+1,s-a<=r)return!1}return!0}function au(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Cm(e)?" ":"");let a="",o=0;for(let l=0,u=n[l];u;u=n[++l])if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(a+=n.slice(o,l)+"\\ ",l+=1,o=l,u="\\"),u==="\\")switch(n[l+1]){case"u":{a+=n.slice(o,l);const d=n.substr(l+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(l,6)}l+=5,o=l+1}break;case"n":if(r||n[l+2]==='"'||n.length=f)if(h)u.push(h),f=h+l,h=void 0;else if(n===bh){for(;p===" "||p===" ";)p=b,b=e[y+=1],m=!0;const _=y>g+1?y-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+l,h=void 0}else m=!0}p=b}if(m&&o&&o(),u.length===0)return e;a&&a();let E=e.slice(0,u[0]);for(let b=0;b({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Am=e=>/^(%|---|\.\.\.)/m.test(e);function RJ(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,a=0;ir)return!0;if(a=i+1,s-a<=r)return!1}return!0}function au(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Am(e)?" ":"");let a="",o=0;for(let l=0,u=n[l];u;u=n[++l])if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(a+=n.slice(o,l)+"\\ ",l+=1,o=l,u="\\"),u==="\\")switch(n[l+1]){case"u":{a+=n.slice(o,l);const d=n.substr(l+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(l,6)}l+=5,o=l+1}break;case"n":if(r||n[l+2]==='"'||n.length -`;let f,h;for(h=n.length;h>0;--h){const N=n[h-1];if(N!==` -`&&N!==" "&&N!==" ")break}let p=n.substring(h);const m=p.indexOf(` +`;let f,h;for(h=n.length;h>0;--h){const k=n[h-1];if(k!==` +`&&k!==" "&&k!==" ")break}let p=n.substring(h);const m=p.indexOf(` `);m===-1?f="-":n===p||m!==p.length-1?(f="+",i&&i()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(R1,`$&${u}`));let y=!1,w,g=-1;for(w=0;w{T=!0});const k=Sm(`${E}${N}${p}`,u,C1,A);if(!T)return`>${_} -${u}${k}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} +`&&(p=p.slice(0,-1)),p=p.replace(I1,`$&${u}`));let y=!1,w,g=-1;for(w=0;w{T=!0});const N=Nm(`${E}${k}${p}`,u,A1,A);if(!T)return`>${_} +${u}${N}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} ${u}${E}${n}${p}`}function OJ(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:o,indent:l,indentStep:u,inFlow:d}=t;if(o&&i.includes(` `)||d&&/[[\]{},]/.test(i))return zo(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||d||!i.includes(` `)?zo(i,t):Eh(e,t,n,r);if(!o&&!d&&s!==Xe.PLAIN&&i.includes(` -`))return Eh(e,t,n,r);if(Cm(i)){if(l==="")return t.forceBlockIndent=!0,Eh(e,t,n,r);if(o&&l===u)return zo(i,t)}const f=i.replace(/\n+/g,`$& -${l}`);if(a){const h=y=>{var w;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((w=y.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return zo(i,t)}return o?f:Sm(f,l,xM,Am(t,!1))}function xx(e,t,n,r){const{implicitKey:s,inFlow:i}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;o!==Xe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Xe.QUOTE_DOUBLE);const l=d=>{switch(d){case Xe.BLOCK_FOLDED:case Xe.BLOCK_LITERAL:return s||i?zo(a.value,t):Eh(a,t,n,r);case Xe.QUOTE_DOUBLE:return au(a.value,t);case Xe.QUOTE_SINGLE:return I1(a.value,t);case Xe.PLAIN:return OJ(a,t,n,r);default:return null}};let u=l(o);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=s&&d||f;if(u=l(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function wM(e,t){const n=Object.assign({blockQuote:!0,commentString:IJ,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function LJ(e,t){var s;if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(jt(t)){r=t.value;let i=e.filter(a=>{var o;return(o=a.identify)==null?void 0:o.call(a,r)});if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function MJ(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(jt(e)||hn(e))&&e.anchor;i&&mM(i)&&(n.add(i),s.push(`&${i}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function wl(e,t,n,r){var l;if(mn(e))return e.toString(t,n,r);if(ql(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=pn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=LJ(t.doc.schema.tags,i));const a=MJ(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const o=typeof s.stringify=="function"?s.stringify(i,t,n,r):jt(i)?xx(i,t,n,r):i.toString(t,n,r);return a?jt(i)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} -${t.indent}${o}`:o}function DJ({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:o,indentStep:l,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=pn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(hn(e)||!pn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||hn(e)||(jt(e)?e.type===Xe.BLOCK_FOLDED||e.type===Xe.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:o+l});let m=!1,y=!1,w=wl(e,n,()=>m=!0,()=>y=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Na(w,n.indent,u(h)):y&&s&&s(),w;m&&(h=null),p?(h&&(w+=Na(w,n.indent,u(h))),w=`? ${w} -${o}:`):(w=`${w}:`,h&&(w+=Na(w,n.indent,u(h))));let g,E,b;pn(t)?(g=!!t.spaceBefore,E=t.commentBefore,b=t.comment):(g=!1,E=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&jt(t)&&(n.indentAtStart=w.length+1),y=!1,!d&&l.length>=2&&!n.inFlow&&!p&&kd(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const N=wl(t,n,()=>_=!0,()=>y=!0);let T=" ";if(h||g||E){if(T=g?` +`))return Eh(e,t,n,r);if(Am(i)){if(l==="")return t.forceBlockIndent=!0,Eh(e,t,n,r);if(o&&l===u)return zo(i,t)}const f=i.replace(/\n+/g,`$& +${l}`);if(a){const h=y=>{var w;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((w=y.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return zo(i,t)}return o?f:Nm(f,l,xM,Sm(t,!1))}function xx(e,t,n,r){const{implicitKey:s,inFlow:i}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;o!==Xe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Xe.QUOTE_DOUBLE);const l=d=>{switch(d){case Xe.BLOCK_FOLDED:case Xe.BLOCK_LITERAL:return s||i?zo(a.value,t):Eh(a,t,n,r);case Xe.QUOTE_DOUBLE:return au(a.value,t);case Xe.QUOTE_SINGLE:return C1(a.value,t);case Xe.PLAIN:return OJ(a,t,n,r);default:return null}};let u=l(o);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=s&&d||f;if(u=l(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function wM(e,t){const n=Object.assign({blockQuote:!0,commentString:IJ,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function LJ(e,t){var s;if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(jt(t)){r=t.value;let i=e.filter(a=>{var o;return(o=a.identify)==null?void 0:o.call(a,r)});if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function MJ(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(jt(e)||hn(e))&&e.anchor;i&&mM(i)&&(n.add(i),s.push(`&${i}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function wl(e,t,n,r){var l;if(mn(e))return e.toString(t,n,r);if(ql(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=pn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=LJ(t.doc.schema.tags,i));const a=MJ(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const o=typeof s.stringify=="function"?s.stringify(i,t,n,r):jt(i)?xx(i,t,n,r):i.toString(t,n,r);return a?jt(i)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} +${t.indent}${o}`:o}function DJ({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:o,indentStep:l,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=pn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(hn(e)||!pn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||hn(e)||(jt(e)?e.type===Xe.BLOCK_FOLDED||e.type===Xe.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:o+l});let m=!1,y=!1,w=wl(e,n,()=>m=!0,()=>y=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=ka(w,n.indent,u(h)):y&&s&&s(),w;m&&(h=null),p?(h&&(w+=ka(w,n.indent,u(h))),w=`? ${w} +${o}:`):(w=`${w}:`,h&&(w+=ka(w,n.indent,u(h))));let g,E,b;pn(t)?(g=!!t.spaceBefore,E=t.commentBefore,b=t.comment):(g=!1,E=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&jt(t)&&(n.indentAtStart=w.length+1),y=!1,!d&&l.length>=2&&!n.inFlow&&!p&&Nd(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=wl(t,n,()=>_=!0,()=>y=!0);let T=" ";if(h||g||E){if(T=g?` `:"",E){const A=u(E);T+=` -${Js(A,n.indent)}`}N===""&&!n.inFlow?T===` +${Js(A,n.indent)}`}k===""&&!n.inFlow?T===` `&&b&&(T=` `):T+=` -${n.indent}`}else if(!p&&hn(t)){const A=N[0],k=N.indexOf(` -`),R=k!==-1,I=n.inFlow??t.flow??t.items.length===0;if(R||!I){let M=!1;if(R&&(A==="&"||A==="!")){let B=N.indexOf(" ");A==="&"&&B!==-1&&Be===If||typeof e=="symbol"&&e.description===If,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Xe(Symbol(If)),{addToJSMap:_M}),stringify:()=>If},PJ=(e,t)=>(si.identify(t)||jt(t)&&(!t.type||t.type===Xe.PLAIN)&&si.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===si.tag&&n.default));function _M(e,t,n){const r=TM(e,n);if(kd(r))for(const s of r.items)c0(e,t,s);else if(Array.isArray(r))for(const s of r)c0(e,t,s);else c0(e,t,r)}function c0(e,t,n){const r=TM(e,n);if(!Nd(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,a]of s)t instanceof Map?t.has(i)||t.set(i,a):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function TM(e,t){return e&&ql(t)?t.resolve(e.doc,e):t}function NM(e,t,{key:n,value:r}){if(pn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(PJ(e,n))_M(e,t,r);else{const s=Wr(n,"",e);if(t instanceof Map)t.set(s,Wr(r,s,e));else if(t instanceof Set)t.add(s);else{const i=jJ(n,s,e),a=Wr(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function jJ(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(pn(e)&&(n!=null&&n.doc)){const r=wM(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),vM(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function wx(e,t,n){const r=zu(e,void 0,n),s=zu(t,void 0,n);return new cr(r,s)}class cr{constructor(t,n=null){Object.defineProperty(this,Qr,{value:hM}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return pn(n)&&(n=n.clone(t)),pn(r)&&(r=r.clone(t)),new cr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return NM(n,r,this)}toString(t,n,r){return t!=null&&t.doc?DJ(this,t,n,r):JSON.stringify(this)}}function kM(e,t,n){return(t.inFlow??e.flow?FJ:BJ)(e,t,n)}function BJ({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:l,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(g+=Na(g,i,u(w))),f&&w&&(f=!1),h.push(r+g)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;me===If||typeof e=="symbol"&&e.description===If,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Xe(Symbol(If)),{addToJSMap:_M}),stringify:()=>If},PJ=(e,t)=>(si.identify(t)||jt(t)&&(!t.type||t.type===Xe.PLAIN)&&si.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===si.tag&&n.default));function _M(e,t,n){const r=TM(e,n);if(Nd(r))for(const s of r.items)l0(e,t,s);else if(Array.isArray(r))for(const s of r)l0(e,t,s);else l0(e,t,r)}function l0(e,t,n){const r=TM(e,n);if(!kd(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,a]of s)t instanceof Map?t.has(i)||t.set(i,a):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function TM(e,t){return e&&ql(t)?t.resolve(e.doc,e):t}function kM(e,t,{key:n,value:r}){if(pn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(PJ(e,n))_M(e,t,r);else{const s=Wr(n,"",e);if(t instanceof Map)t.set(s,Wr(r,s,e));else if(t instanceof Set)t.add(s);else{const i=jJ(n,s,e),a=Wr(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function jJ(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(pn(e)&&(n!=null&&n.doc)){const r=wM(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),vM(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function wx(e,t,n){const r=zu(e,void 0,n),s=zu(t,void 0,n);return new cr(r,s)}class cr{constructor(t,n=null){Object.defineProperty(this,Qr,{value:hM}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return pn(n)&&(n=n.clone(t)),pn(r)&&(r=r.clone(t)),new cr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return kM(n,r,this)}toString(t,n,r){return t!=null&&t.doc?DJ(this,t,n,r):JSON.stringify(this)}}function NM(e,t,n){return(t.inFlow??e.flow?FJ:BJ)(e,t,n)}function BJ({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:l,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(g+=ka(g,i,u(w))),f&&w&&(f=!1),h.push(r+g)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;mw=null);u||(u=f.length>d||g.includes(` -`)),m0&&(u||(u=f.reduce((E,b)=>E+b.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),w&&(g+=Na(g,r,o(w))),f.push(g),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((y,w)=>y+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const y of f)m+=y?` +`)),m0&&(u||(u=f.reduce((E,b)=>E+b.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),w&&(g+=ka(g,r,o(w))),f.push(g),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((y,w)=>y+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const y of f)m+=y?` ${i}${s}${y}`:` `;return`${m} -${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function Tp({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Js(t(r),e);n.push(i.trimStart())}}function ka(e,t){const n=jt(t)?t.value:t;for(const r of e)if(mn(r)&&(r.key===t||r.key===n||jt(r.key)&&r.key.value===n))return r}class Vr extends EM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(zi,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),o=(l,u)=>{if(typeof i=="function")u=i.call(n,l,u);else if(Array.isArray(i)&&!i.includes(l))return;(u!==void 0||s)&&a.items.push(wx(l,u,r))};if(n instanceof Map)for(const[l,u]of n)o(l,u);else if(n&&typeof n=="object")for(const l of Object.keys(n))o(l,n[l]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;mn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new cr(t,t==null?void 0:t.value):r=new cr(t.key,t.value);const s=ka(this.items,r.key),i=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);jt(s.value)&&bM(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(l=>i(r,l)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=ka(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=ka(this.items,t),s=r==null?void 0:r.value;return(!n&&jt(s)?s.value:s)??void 0}has(t){return!!ka(this.items,t)}set(t,n){this.add(new cr(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items)NM(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!mn(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),kM(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Xl={collection:"map",default:!0,nodeClass:Vr,tag:"tag:yaml.org,2002:map",resolve(e,t){return Nd(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Vr.from(e,t,n)};class Ya extends EM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Wl,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Rf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Rf(t);if(typeof r!="number")return;const s=this.items[r];return!n&&jt(s)?s.value:s}has(t){const n=Rf(t);return typeof n=="number"&&n=0?t:null}const Ql={collection:"seq",default:!0,nodeClass:Ya,tag:"tag:yaml.org,2002:seq",resolve(e,t){return kd(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ya.from(e,t,n)},Im={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),xx(e,t,n,r)}},Rm={identify:e=>e==null,createNode:()=>new Xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Xe(null),stringify:({source:e},t)=>typeof e=="string"&&Rm.test.test(e)?e:t.options.nullStr},vx={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Xe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&vx.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function Es({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let o=t-(i.length-a-1);for(;o-- >0;)i+="0"}return i}const SM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Es},AM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Es(e)}},CM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Xe(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Es},Om=e=>typeof e=="bigint"||Number.isInteger(e),_x=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function IM(e,t,n){const{value:r}=e;return Om(r)&&r>=0?n+r.toString(t):Es(e)}const RM={identify:e=>Om(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>_x(e,2,8,n),stringify:e=>IM(e,8,"0o")},OM={identify:Om,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>_x(e,0,10,n),stringify:Es},LM={identify:e=>Om(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>_x(e,2,16,n),stringify:e=>IM(e,16,"0x")},UJ=[Xl,Ql,Im,Rm,vx,RM,OM,LM,SM,AM,CM];function HN(e){return typeof e=="bigint"||Number.isInteger(e)}const Of=({value:e})=>JSON.stringify(e),$J=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Of},{identify:e=>e==null,createNode:()=>new Xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Of},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Of},{identify:HN,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>HN(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Of}],HJ={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},zJ=[Xl,Ql].concat($J,HJ),Tx={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new cr(new Xe(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore} +${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function Tp({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Js(t(r),e);n.push(i.trimStart())}}function Na(e,t){const n=jt(t)?t.value:t;for(const r of e)if(mn(r)&&(r.key===t||r.key===n||jt(r.key)&&r.key.value===n))return r}class Vr extends EM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(zi,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),o=(l,u)=>{if(typeof i=="function")u=i.call(n,l,u);else if(Array.isArray(i)&&!i.includes(l))return;(u!==void 0||s)&&a.items.push(wx(l,u,r))};if(n instanceof Map)for(const[l,u]of n)o(l,u);else if(n&&typeof n=="object")for(const l of Object.keys(n))o(l,n[l]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;mn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new cr(t,t==null?void 0:t.value):r=new cr(t.key,t.value);const s=Na(this.items,r.key),i=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);jt(s.value)&&bM(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(l=>i(r,l)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=Na(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Na(this.items,t),s=r==null?void 0:r.value;return(!n&&jt(s)?s.value:s)??void 0}has(t){return!!Na(this.items,t)}set(t,n){this.add(new cr(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items)kM(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!mn(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),NM(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Xl={collection:"map",default:!0,nodeClass:Vr,tag:"tag:yaml.org,2002:map",resolve(e,t){return kd(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Vr.from(e,t,n)};class Ya extends EM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Wl,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Rf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Rf(t);if(typeof r!="number")return;const s=this.items[r];return!n&&jt(s)?s.value:s}has(t){const n=Rf(t);return typeof n=="number"&&n=0?t:null}const Ql={collection:"seq",default:!0,nodeClass:Ya,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Nd(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ya.from(e,t,n)},Cm={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),xx(e,t,n,r)}},Im={identify:e=>e==null,createNode:()=>new Xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Xe(null),stringify:({source:e},t)=>typeof e=="string"&&Im.test.test(e)?e:t.options.nullStr},vx={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Xe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&vx.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function Es({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let o=t-(i.length-a-1);for(;o-- >0;)i+="0"}return i}const SM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Es},AM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Es(e)}},CM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Xe(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Es},Rm=e=>typeof e=="bigint"||Number.isInteger(e),_x=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function IM(e,t,n){const{value:r}=e;return Rm(r)&&r>=0?n+r.toString(t):Es(e)}const RM={identify:e=>Rm(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>_x(e,2,8,n),stringify:e=>IM(e,8,"0o")},OM={identify:Rm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>_x(e,0,10,n),stringify:Es},LM={identify:e=>Rm(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>_x(e,2,16,n),stringify:e=>IM(e,16,"0x")},UJ=[Xl,Ql,Cm,Im,vx,RM,OM,LM,SM,AM,CM];function Hk(e){return typeof e=="bigint"||Number.isInteger(e)}const Of=({value:e})=>JSON.stringify(e),$J=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Of},{identify:e=>e==null,createNode:()=>new Xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Of},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Of},{identify:Hk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Hk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Of}],HJ={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},zJ=[Xl,Ql].concat($J,HJ),Tx={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new cr(new Xe(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore} ${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment} -${i.comment}`:r.comment}r=s}e.items[n]=mn(r)?r:new cr(r)}}else t("Expected a sequence for this tag");return e}function DM(e,t,n){const{replacer:r}=n,s=new Ya(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(i++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)o=u[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=a;s.items.push(wx(o,l,n))}return s}const Nx={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:MM,createNode:DM};class Jo extends Ya{constructor(){super(),this.add=Vr.prototype.add.bind(this),this.delete=Vr.prototype.delete.bind(this),this.get=Vr.prototype.get.bind(this),this.has=Vr.prototype.has.bind(this),this.set=Vr.prototype.set.bind(this),this.tag=Jo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let i,a;if(mn(s)?(i=Wr(s.key,"",n),a=Wr(s.value,i,n)):i=Wr(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,a)}return r}static from(t,n,r){const s=DM(t,n,r),i=new this;return i.items=s.items,i}}Jo.tag="tag:yaml.org,2002:omap";const kx={collection:"seq",identify:e=>e instanceof Map,nodeClass:Jo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=MM(e,t),r=[];for(const{key:s}of n.items)jt(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Jo,n)},createNode:(e,t,n)=>Jo.from(e,t,n)};function PM({value:e,source:t},n){return t&&(e?jM:BM).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const jM={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Xe(!0),stringify:PM},BM={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Xe(!1),stringify:PM},VJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Es},KJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Es(e)}},YJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Xe(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Es},Sd=e=>typeof e=="bigint"||Number.isInteger(e);function Lm(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return s==="-"?BigInt(-1)*a:a}const i=parseInt(e,n);return s==="-"?-1*i:i}function Sx(e,t,n){const{value:r}=e;if(Sd(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Es(e)}const WJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Lm(e,2,2,n),stringify:e=>Sx(e,2,"0b")},qJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Lm(e,1,8,n),stringify:e=>Sx(e,8,"0")},GJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Lm(e,0,10,n),stringify:Es},XJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Lm(e,2,16,n),stringify:e=>Sx(e,16,"0x")};class el extends Vr{constructor(t){super(t),this.tag=el.tag}add(t){let n;mn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new cr(t.key,null):n=new cr(t,null),ka(this.items,n.key)||this.items.push(n)}get(t,n){const r=ka(this.items,t);return!n&&mn(r)?jt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=ka(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new cr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),i.items.push(wx(a,null,r));return i}}el.tag="tag:yaml.org,2002:set";const Ax={collection:"map",identify:e=>e instanceof Set,nodeClass:el,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>el.from(e,t,n),resolve(e,t){if(Nd(e)){if(e.hasAllNullValues(!0))return Object.assign(new el,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Cx(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),i=r.replace(/_/g,"").split(":").reduce((a,o)=>a*s(60)+s(o),s(0));return n==="-"?s(-1)*i:i}function FM(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Es(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const UM={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Cx(e,n),stringify:FM},$M={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Cx(e,!1),stringify:FM},Mm={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Mm.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,o]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,s,i||0,a||0,o||0,l);const d=t[8];if(d&&d!=="Z"){let f=Cx(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},zN=[Xl,Ql,Im,Rm,jM,BM,WJ,qJ,GJ,XJ,VJ,KJ,YJ,Tx,si,kx,Nx,Ax,UM,$M,Mm],VN=new Map([["core",UJ],["failsafe",[Xl,Ql,Im]],["json",zJ],["yaml11",zN],["yaml-1.1",zN]]),KN={binary:Tx,bool:vx,float:CM,floatExp:AM,floatNaN:SM,floatTime:$M,int:OM,intHex:LM,intOct:RM,intTime:UM,map:Xl,merge:si,null:Rm,omap:kx,pairs:Nx,seq:Ql,set:Ax,timestamp:Mm},QJ={"tag:yaml.org,2002:binary":Tx,"tag:yaml.org,2002:merge":si,"tag:yaml.org,2002:omap":kx,"tag:yaml.org,2002:pairs":Nx,"tag:yaml.org,2002:set":Ax,"tag:yaml.org,2002:timestamp":Mm};function u0(e,t,n){const r=VN.get(t);if(r&&!e)return n&&!r.includes(si)?r.concat(si):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(VN.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(si)),s.reduce((i,a)=>{const o=typeof a=="string"?KN[a]:a;if(!o){const l=JSON.stringify(a),u=Object.keys(KN).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return i.includes(o)||i.push(o),i},[])}const ZJ=(e,t)=>e.keyt.key?1:0;class Ix{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?u0(t,"compat"):t?u0(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?QJ:{},this.tags=u0(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,zi,{value:Xl}),Object.defineProperty(this,js,{value:Im}),Object.defineProperty(this,Wl,{value:Ql}),this.sortMapEntries=typeof a=="function"?a:a===!0?ZJ:null}clone(){const t=Object.create(Ix.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function JJ(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=wM(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(Js(u,""))}let a=!1,o=null;if(e.contents){if(pn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(Js(f,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}const u=o?void 0:()=>a=!0;let d=wl(e.contents,s,()=>o=null,u);o&&(d+=Na(d,"",i(o))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(wl(e.contents,s));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const u=i(e.comment);u.includes(` +${i.comment}`:r.comment}r=s}e.items[n]=mn(r)?r:new cr(r)}}else t("Expected a sequence for this tag");return e}function DM(e,t,n){const{replacer:r}=n,s=new Ya(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(i++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)o=u[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=a;s.items.push(wx(o,l,n))}return s}const kx={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:MM,createNode:DM};class Jo extends Ya{constructor(){super(),this.add=Vr.prototype.add.bind(this),this.delete=Vr.prototype.delete.bind(this),this.get=Vr.prototype.get.bind(this),this.has=Vr.prototype.has.bind(this),this.set=Vr.prototype.set.bind(this),this.tag=Jo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let i,a;if(mn(s)?(i=Wr(s.key,"",n),a=Wr(s.value,i,n)):i=Wr(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,a)}return r}static from(t,n,r){const s=DM(t,n,r),i=new this;return i.items=s.items,i}}Jo.tag="tag:yaml.org,2002:omap";const Nx={collection:"seq",identify:e=>e instanceof Map,nodeClass:Jo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=MM(e,t),r=[];for(const{key:s}of n.items)jt(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Jo,n)},createNode:(e,t,n)=>Jo.from(e,t,n)};function PM({value:e,source:t},n){return t&&(e?jM:BM).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const jM={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Xe(!0),stringify:PM},BM={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Xe(!1),stringify:PM},VJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Es},KJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Es(e)}},YJ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Xe(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Es},Sd=e=>typeof e=="bigint"||Number.isInteger(e);function Om(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return s==="-"?BigInt(-1)*a:a}const i=parseInt(e,n);return s==="-"?-1*i:i}function Sx(e,t,n){const{value:r}=e;if(Sd(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Es(e)}const WJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Om(e,2,2,n),stringify:e=>Sx(e,2,"0b")},qJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Om(e,1,8,n),stringify:e=>Sx(e,8,"0")},GJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Om(e,0,10,n),stringify:Es},XJ={identify:Sd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Om(e,2,16,n),stringify:e=>Sx(e,16,"0x")};class el extends Vr{constructor(t){super(t),this.tag=el.tag}add(t){let n;mn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new cr(t.key,null):n=new cr(t,null),Na(this.items,n.key)||this.items.push(n)}get(t,n){const r=Na(this.items,t);return!n&&mn(r)?jt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Na(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new cr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),i.items.push(wx(a,null,r));return i}}el.tag="tag:yaml.org,2002:set";const Ax={collection:"map",identify:e=>e instanceof Set,nodeClass:el,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>el.from(e,t,n),resolve(e,t){if(kd(e)){if(e.hasAllNullValues(!0))return Object.assign(new el,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Cx(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),i=r.replace(/_/g,"").split(":").reduce((a,o)=>a*s(60)+s(o),s(0));return n==="-"?s(-1)*i:i}function FM(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Es(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const UM={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Cx(e,n),stringify:FM},$M={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Cx(e,!1),stringify:FM},Lm={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Lm.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,o]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,s,i||0,a||0,o||0,l);const d=t[8];if(d&&d!=="Z"){let f=Cx(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},zk=[Xl,Ql,Cm,Im,jM,BM,WJ,qJ,GJ,XJ,VJ,KJ,YJ,Tx,si,Nx,kx,Ax,UM,$M,Lm],Vk=new Map([["core",UJ],["failsafe",[Xl,Ql,Cm]],["json",zJ],["yaml11",zk],["yaml-1.1",zk]]),Kk={binary:Tx,bool:vx,float:CM,floatExp:AM,floatNaN:SM,floatTime:$M,int:OM,intHex:LM,intOct:RM,intTime:UM,map:Xl,merge:si,null:Im,omap:Nx,pairs:kx,seq:Ql,set:Ax,timestamp:Lm},QJ={"tag:yaml.org,2002:binary":Tx,"tag:yaml.org,2002:merge":si,"tag:yaml.org,2002:omap":Nx,"tag:yaml.org,2002:pairs":kx,"tag:yaml.org,2002:set":Ax,"tag:yaml.org,2002:timestamp":Lm};function c0(e,t,n){const r=Vk.get(t);if(r&&!e)return n&&!r.includes(si)?r.concat(si):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(Vk.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(si)),s.reduce((i,a)=>{const o=typeof a=="string"?Kk[a]:a;if(!o){const l=JSON.stringify(a),u=Object.keys(Kk).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return i.includes(o)||i.push(o),i},[])}const ZJ=(e,t)=>e.keyt.key?1:0;class Ix{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?c0(t,"compat"):t?c0(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?QJ:{},this.tags=c0(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,zi,{value:Xl}),Object.defineProperty(this,js,{value:Cm}),Object.defineProperty(this,Wl,{value:Ql}),this.sortMapEntries=typeof a=="function"?a:a===!0?ZJ:null}clone(){const t=Object.create(Ix.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function JJ(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=wM(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(Js(u,""))}let a=!1,o=null;if(e.contents){if(pn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(Js(f,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}const u=o?void 0:()=>a=!0;let d=wl(e.contents,s,()=>o=null,u);o&&(d+=ka(d,"",i(o))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(wl(e.contents,s));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const u=i(e.comment);u.includes(` `)?(n.push("..."),n.push(Js(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(Js(i(u),"")))}return n.join(` `)+` -`}class Ad{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qr,{value:A1});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:a}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ar({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Ad.prototype,{[Qr]:{value:A1}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=pn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){po(this.contents)&&this.contents.add(t)}addIn(t,n){po(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=gM(this);t.anchor=!n||r.has(n)?yM(n||"a",r):n}return new Ex(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=E=>typeof E=="number"||E instanceof String||E instanceof Number,g=n.filter(w).map(String);g.length>0&&(n=n.concat(g)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=SJ(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},y=zu(t,d,m);return o&&hn(y)&&(y.flow=!0),h(),y}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new cr(s,i)}delete(t){return po(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Oc(t)?this.contents==null?!1:(this.contents=null,!0):po(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return hn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Oc(t)?!n&&jt(this.contents)?this.contents.value:this.contents:hn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return hn(this.contents)?this.contents.has(t):!1}hasIn(t){return Oc(t)?this.contents!==void 0:hn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=_p(this.schema,[t],n):po(this.contents)&&this.contents.set(t,n)}setIn(t,n){Oc(t)?this.contents=n:this.contents==null?this.contents=_p(this.schema,Array.from(t),n):po(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ar({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ar({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Ix(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:a}={}){const o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=Wr(this.contents,n??"",o);if(typeof i=="function")for(const{count:u,res:d}of o.anchors.values())i(d,u);return typeof a=="function"?Ho(a,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return JJ(this,t)}}function po(e){if(hn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class HM extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Lc extends HM{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class eee extends HM{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const YN=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){const o=Math.min(i-39,a.length-79);a="…"+a.substring(o),i-=o-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`… +`}class Ad{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qr,{value:S1});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:a}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ir({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Ad.prototype,{[Qr]:{value:S1}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=pn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){po(this.contents)&&this.contents.add(t)}addIn(t,n){po(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=gM(this);t.anchor=!n||r.has(n)?yM(n||"a",r):n}return new Ex(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=E=>typeof E=="number"||E instanceof String||E instanceof Number,g=n.filter(w).map(String);g.length>0&&(n=n.concat(g)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=SJ(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},y=zu(t,d,m);return o&&hn(y)&&(y.flow=!0),h(),y}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new cr(s,i)}delete(t){return po(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Oc(t)?this.contents==null?!1:(this.contents=null,!0):po(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return hn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Oc(t)?!n&&jt(this.contents)?this.contents.value:this.contents:hn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return hn(this.contents)?this.contents.has(t):!1}hasIn(t){return Oc(t)?this.contents!==void 0:hn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=_p(this.schema,[t],n):po(this.contents)&&this.contents.set(t,n)}setIn(t,n){Oc(t)?this.contents=n:this.contents==null?this.contents=_p(this.schema,Array.from(t),n):po(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ir({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ir({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Ix(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:a}={}){const o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=Wr(this.contents,n??"",o);if(typeof i=="function")for(const{count:u,res:d}of o.anchors.values())i(d,u);return typeof a=="function"?Ho(a,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return JJ(this,t)}}function po(e){if(hn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class HM extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Lc extends HM{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class eee extends HM{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const Yk=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){const o=Math.min(i-39,a.length-79);a="…"+a.substring(o),i-=o-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`… `),a=o+a}if(/[^ ]/.test(a)){let o=1;const l=n.linePos[1];(l==null?void 0:l.line)===r&&l.col>s&&(o=Math.max(1,Math.min(l.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(o);n.message+=`: ${a} ${u} -`}};function vl(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:o}){let l=!1,u=o,d=o,f="",h="",p=!1,m=!1,y=null,w=null,g=null,E=null,b=null,_=null,N=null;for(const k of e)switch(m&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&i(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),y&&(u&&k.type!=="comment"&&k.type!=="newline"&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),k.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&k.source.includes(" ")&&(y=k),d=!0;break;case"comment":{d||i(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=k.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=k.source:(!_||n!=="seq-item-ind")&&(l=!0):h+=k.source,u=!0,p=!0,(w||g)&&(E=k),d=!0;break;case"anchor":w&&i(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&i(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=k,N??(N=k.offset),u=!1,d=!1,m=!0;break;case"tag":{g&&i(k,"MULTIPLE_TAGS","A node can have at most one tag"),g=k,N??(N=k.offset),u=!1,d=!1,m=!0;break}case n:(w||g)&&i(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),_&&i(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${t??"collection"}`),_=k,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){b&&i(k,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=k,u=!1,d=!1;break}default:i(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),u=!1,d=!1}const T=e[e.length-1],A=T?T.offset+T.source.length:s;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(u&&y.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:l,comment:f,hasNewline:p,anchor:w,tag:g,newlineAfterProp:E,end:A,start:N??A}}function Vu(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Vu(t.key)||Vu(t.value))return!0}return!1;default:return!0}}function O1(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Vu(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function zM(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||jt(i)&&jt(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const WN="All mapping items must start at the same column";function tee({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Vr,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,u=null;for(const f of r.items){const{start:h,key:p,sep:m,value:y}=f,w=vl(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0}),g=!w.found;if(g){if(p&&(p.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&s(l,"BAD_INDENT",WN)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(o.comment?o.comment+=` -`+w.comment:o.comment=w.comment);continue}(w.newlineAfterProp||Vu(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(l,"BAD_INDENT",WN);n.atKey=!0;const E=w.end,b=p?e(n,p,w,s):t(n,E,h,null,w,s);n.schema.compat&&O1(r.indent,p,s),n.atKey=!1,zM(n,o.items,b)&&s(E,"DUPLICATE_KEY","Map keys must be unique");const _=vl(m??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=_.end,_.found){g&&((y==null?void 0:y.type)==="block-map"&&!_.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=y?e(n,y,_,s):t(n,l,m,null,_,s);n.schema.compat&&O1(r.indent,y,s),l=N.range[2];const T=new cr(b,N);n.options.keepSourceTokens&&(T.srcToken=f),o.items.push(T)}else{g&&s(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(b.comment?b.comment+=` -`+_.comment:b.comment=_.comment);const N=new cr(b);n.options.keepSourceTokens&&(N.srcToken=f),o.items.push(N)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function ree({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",o=a?"flow map":"flow sequence",l=(i==null?void 0:i.nodeClass)??(a?Vr:Ya),u=new l(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;g0){const g=Cd(m,y,n.options.strict,s);g.comment&&(u.comment?u.comment+=` -`+g.comment:u.comment=g.comment),u.range=[r.offset,y,g.offset]}else u.range=[r.offset,y,y];return u}function h0(e,t,n,r,s,i){const a=n.type==="block-map"?tee(e,t,n,r,i):n.type==="block-seq"?nee(e,t,n,r,i):ree(e,t,n,r,i),o=a.constructor;return s==="!"||s===o.tagName?(a.tag=o.tagName,a):(s&&(a.tag=s),a)}function see(e,t,n,r,s){var h;const i=r.tag,a=i?t.directives.tagName(i.source,p=>s(i,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=r,y=p&&i?p.offset>i.offset?p:i:p??i;y&&(!m||m.offsetp.tag===a&&p.collection===o);if(!l){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===o)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),h0(e,t,n,s,a)}const u=h0(e,t,n,s,a,l),d=((h=l.resolve)==null?void 0:h.call(l,u,p=>s(i,"TAG_RESOLVE_FAILED",p),t.options))??u,f=pn(d)?d:new Xe(d);return f.range=u.range,f.tag=a,l!=null&&l.format&&(f.format=l.format),f}function iee(e,t,n){const r=t.offset,s=aee(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?Xe.BLOCK_FOLDED:Xe.BLOCK_LITERAL,a=t.source?oee(t.source):[];let o=a.length;for(let y=a.length-1;y>=0;--y){const w=a[y][1];if(w===""||w==="\r")o=y;else break}if(o===0){const y=s.chomp==="+"&&a.length>0?` +`}};function vl(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:o}){let l=!1,u=o,d=o,f="",h="",p=!1,m=!1,y=null,w=null,g=null,E=null,b=null,_=null,k=null;for(const N of e)switch(m&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&i(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),y&&(u&&N.type!=="comment"&&N.type!=="newline"&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),N.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&N.source.includes(" ")&&(y=N),d=!0;break;case"comment":{d||i(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=N.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=N.source:(!_||n!=="seq-item-ind")&&(l=!0):h+=N.source,u=!0,p=!0,(w||g)&&(E=N),d=!0;break;case"anchor":w&&i(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&i(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=N,k??(k=N.offset),u=!1,d=!1,m=!0;break;case"tag":{g&&i(N,"MULTIPLE_TAGS","A node can have at most one tag"),g=N,k??(k=N.offset),u=!1,d=!1,m=!0;break}case n:(w||g)&&i(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),_&&i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${t??"collection"}`),_=N,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){b&&i(N,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=N,u=!1,d=!1;break}default:i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),u=!1,d=!1}const T=e[e.length-1],A=T?T.offset+T.source.length:s;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(u&&y.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:l,comment:f,hasNewline:p,anchor:w,tag:g,newlineAfterProp:E,end:A,start:k??A}}function Vu(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` +`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Vu(t.key)||Vu(t.value))return!0}return!1;default:return!0}}function R1(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Vu(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function zM(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||jt(i)&&jt(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const Wk="All mapping items must start at the same column";function tee({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Vr,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,u=null;for(const f of r.items){const{start:h,key:p,sep:m,value:y}=f,w=vl(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0}),g=!w.found;if(g){if(p&&(p.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&s(l,"BAD_INDENT",Wk)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(o.comment?o.comment+=` +`+w.comment:o.comment=w.comment);continue}(w.newlineAfterProp||Vu(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(l,"BAD_INDENT",Wk);n.atKey=!0;const E=w.end,b=p?e(n,p,w,s):t(n,E,h,null,w,s);n.schema.compat&&R1(r.indent,p,s),n.atKey=!1,zM(n,o.items,b)&&s(E,"DUPLICATE_KEY","Map keys must be unique");const _=vl(m??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=_.end,_.found){g&&((y==null?void 0:y.type)==="block-map"&&!_.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=y?e(n,y,_,s):t(n,l,m,null,_,s);n.schema.compat&&R1(r.indent,y,s),l=k.range[2];const T=new cr(b,k);n.options.keepSourceTokens&&(T.srcToken=f),o.items.push(T)}else{g&&s(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(b.comment?b.comment+=` +`+_.comment:b.comment=_.comment);const k=new cr(b);n.options.keepSourceTokens&&(k.srcToken=f),o.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function ree({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",o=a?"flow map":"flow sequence",l=(i==null?void 0:i.nodeClass)??(a?Vr:Ya),u=new l(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;g0){const g=Cd(m,y,n.options.strict,s);g.comment&&(u.comment?u.comment+=` +`+g.comment:u.comment=g.comment),u.range=[r.offset,y,g.offset]}else u.range=[r.offset,y,y];return u}function f0(e,t,n,r,s,i){const a=n.type==="block-map"?tee(e,t,n,r,i):n.type==="block-seq"?nee(e,t,n,r,i):ree(e,t,n,r,i),o=a.constructor;return s==="!"||s===o.tagName?(a.tag=o.tagName,a):(s&&(a.tag=s),a)}function see(e,t,n,r,s){var h;const i=r.tag,a=i?t.directives.tagName(i.source,p=>s(i,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=r,y=p&&i?p.offset>i.offset?p:i:p??i;y&&(!m||m.offsetp.tag===a&&p.collection===o);if(!l){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===o)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),f0(e,t,n,s,a)}const u=f0(e,t,n,s,a,l),d=((h=l.resolve)==null?void 0:h.call(l,u,p=>s(i,"TAG_RESOLVE_FAILED",p),t.options))??u,f=pn(d)?d:new Xe(d);return f.range=u.range,f.tag=a,l!=null&&l.format&&(f.format=l.format),f}function iee(e,t,n){const r=t.offset,s=aee(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?Xe.BLOCK_FOLDED:Xe.BLOCK_LITERAL,a=t.source?oee(t.source):[];let o=a.length;for(let y=a.length-1;y>=0;--y){const w=a[y][1];if(w===""||w==="\r")o=y;else break}if(o===0){const y=s.chomp==="+"&&a.length>0?` `.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:y,type:i,comment:s.comment,range:[r,w,w]}}let l=t.indent+s.indent,u=t.offset+s.length,d=0;for(let y=0;yl&&(l=w.length);else{w.length=o;--y)a[y][0].length>l&&(o=y+1);let f="",h="",p=!1;for(let y=0;yl||g[0]===" "?(h===" "?h=` @@ -624,50 +624,50 @@ ${u} `);)r===` `&&(n+=` `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const hee={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function pee(e,t,n,r){const s=e.substr(t,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(a)}catch{const o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}function KM(e,t,n,r){const{value:s,type:i,comment:a,range:o}=t.type==="block-scalar"?iee(e,t,r):lee(t,e.options.strict,r),l=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[js]:l?u=mee(e.schema,s,l,n,r):t.type==="scalar"?u=gee(e,s,t,r):u=e.schema[js];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=jt(f)?f:new Xe(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new Xe(s)}return d.range=o,d.source=s,i&&(d.type=i),l&&(d.tag=l),u.format&&(d.format=u.format),a&&(d.comment=a),d}function mee(e,t,n,r,s){var o;if(n==="!")return e[js];const i=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)i.push(l);else return l;for(const l of i)if((o=l.test)!=null&&o.test(t))return l;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[js])}function gee({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(o=>{var l;return(o.default===!0||e&&o.default==="key")&&((l=o.test)==null?void 0:l.test(r))})||n[js];if(n.compat){const o=n.compat.find(l=>{var u;return l.default&&((u=l.test)==null?void 0:u.test(r))})??n[js];if(a.tag!==o.tag){const l=t.tagString(a.tag),u=t.tagString(o.tag),d=`Value may be parsed as either ${l} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function yee(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const bee={composeNode:YM,composeEmptyNode:Rx};function YM(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:o,tag:l}=n;let u,d=!0;switch(t.type){case"alias":u=Eee(e,t,r),(o||l)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=KM(e,t,l,r),o&&(u.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=see(bee,e,t,n,r),o&&(u.anchor=o.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Rx(e,t.offset,void 0,null,n,r)),o&&u.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!jt(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rx(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:o,end:l},u){const d={type:"scalar",offset:yee(t,n,r),indent:-1,source:""},f=KM(e,d,o,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function Eee({options:e},{offset:t,source:n,end:r},s){const i=new Ex(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,o=Cd(r,a,e.strict,s);return i.range=[t,a,o.offset],o.comment&&(i.comment=o.comment),i}function xee(e,t,{offset:n,start:r,value:s,end:i},a){const o=Object.assign({_directives:t},e),l=new Ad(void 0,o),u={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=vl(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?YM(u,s,d,a):Rx(u,d.end,r,null,d,a);const f=l.contents.range[2],h=Cd(i,f,!1,a);return h.comment&&(l.comment=h.comment),l.range=[n,f,h.offset],l}function yc(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function qN(e){var s;let t="",n=!1,r=!1;for(let i=0;ir(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[js]:l?u=mee(e.schema,s,l,n,r):t.type==="scalar"?u=gee(e,s,t,r):u=e.schema[js];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=jt(f)?f:new Xe(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new Xe(s)}return d.range=o,d.source=s,i&&(d.type=i),l&&(d.tag=l),u.format&&(d.format=u.format),a&&(d.comment=a),d}function mee(e,t,n,r,s){var o;if(n==="!")return e[js];const i=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)i.push(l);else return l;for(const l of i)if((o=l.test)!=null&&o.test(t))return l;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[js])}function gee({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(o=>{var l;return(o.default===!0||e&&o.default==="key")&&((l=o.test)==null?void 0:l.test(r))})||n[js];if(n.compat){const o=n.compat.find(l=>{var u;return l.default&&((u=l.test)==null?void 0:u.test(r))})??n[js];if(a.tag!==o.tag){const l=t.tagString(a.tag),u=t.tagString(o.tag),d=`Value may be parsed as either ${l} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function yee(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const bee={composeNode:YM,composeEmptyNode:Rx};function YM(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:o,tag:l}=n;let u,d=!0;switch(t.type){case"alias":u=Eee(e,t,r),(o||l)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=KM(e,t,l,r),o&&(u.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=see(bee,e,t,n,r),o&&(u.anchor=o.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Rx(e,t.offset,void 0,null,n,r)),o&&u.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!jt(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rx(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:o,end:l},u){const d={type:"scalar",offset:yee(t,n,r),indent:-1,source:""},f=KM(e,d,o,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function Eee({options:e},{offset:t,source:n,end:r},s){const i=new Ex(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,o=Cd(r,a,e.strict,s);return i.range=[t,a,o.offset],o.comment&&(i.comment=o.comment),i}function xee(e,t,{offset:n,start:r,value:s,end:i},a){const o=Object.assign({_directives:t},e),l=new Ad(void 0,o),u={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=vl(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?YM(u,s,d,a):Rx(u,d.end,r,null,d,a);const f=l.contents.range[2],h=Cd(i,f,!1,a);return h.comment&&(l.comment=h.comment),l.range=[n,f,h.offset],l}function yc(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function qk(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=yc(n);i?this.warnings.push(new eee(a,r,s)):this.errors.push(new Lc(a,r,s))},this.directives=new ar({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=qN(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment} +`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[i+1])==null?void 0:s[0])!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class wee{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const a=yc(n);i?this.warnings.push(new eee(a,r,s)):this.errors.push(new Lc(a,r,s))},this.directives=new ir({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=qk(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment} ${r}`:r;else if(s||t.directives.docStart||!i)t.commentBefore=r;else if(hn(i)&&!i.flow&&i.items.length>0){let a=i.items[0];mn(a)&&(a=a.key);const o=a.commentBefore;a.commentBefore=o?`${r} ${o}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r} -${a}`:r}}if(n){for(let i=0;i{const i=yc(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=xee(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Lc(yc(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Lc(yc(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Cd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Lc(yc(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new Ad(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const WM="\uFEFF",qM="",GM="",L1="";function vee(e){switch(e){case WM:return"byte-order-mark";case qM:return"doc-mode";case GM:return"flow-error-end";case L1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${a}`:r}}if(n){for(let i=0;i{const i=yc(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=xee(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Lc(yc(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Lc(yc(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Cd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Lc(yc(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new Ad(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const WM="\uFEFF",qM="",GM="",O1="";function vee(e){switch(e){case WM:return"byte-order-mark";case qM:return"doc-mode";case GM:return"flow-error-end";case O1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ts(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const GN=new Set("0123456789ABCDEFabcdef"),_ee=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Lf=new Set(",[]{}"),Tee=new Set(` ,[]{} -\r `),p0=e=>!e||Tee.has(e);class Nee{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`:case"\r":case" ":return!0;default:return!1}}const Gk=new Set("0123456789ABCDEFabcdef"),_ee=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Lf=new Set(",[]{}"),Tee=new Set(` ,[]{} +\r `),h0=e=>!e||Tee.has(e);class kee{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===` `||!s&&!this.atEnd)return t+r+1}return n===` `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ts(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ts(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ts(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(p0),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&rthis.indentValue&&!ts(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ts(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(h0),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ts(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case` `:t=i,n=0;break;case"\r":{const a=this.buffer[i+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===` `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(` `,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` `;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let i=t-1,a=this.buffer[i];a==="\r"&&(a=this.buffer[--i]);const o=i;for(;a===" ";)a=this.buffer[--i];if(a===` -`&&i>=this.pos&&i+1+n>o)t=i;else break}while(!0);return yield L1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(ts(i)||t&&Lf.has(i))break;n=r}else if(ts(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` +`&&i>=this.pos&&i+1+n>o)t=i;else break}while(!0);return yield O1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(ts(i)||t&&Lf.has(i))break;n=r}else if(ts(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` `?(r+=1,s=` `,i=this.buffer[r+1]):n=r),i==="#"||t&&Lf.has(i))break;if(s===` -`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Lf.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield L1,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(p0),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ts(r)||n&&Lf.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ts(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(_ee.has(n))n=this.buffer[++t];else if(n==="%"&&GN.has(this.buffer[t+1])&&GN.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Lf.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield O1,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(h0),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ts(r)||n&&Lf.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ts(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(_ee.has(n))n=this.buffer[++t];else if(n==="%"&&Gk.has(this.buffer[t+1])&&Gk.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class kee{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[i]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Np(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&QN(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&XN(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Nee{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[i]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function kp(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Qk(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Xk(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let l=0;lt.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ki(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(XM(n.key)&&!ki(n.sep,"newline")){const o=mo(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(ki(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=mo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):ki(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ki(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Np(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ki(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Mf(r),i=mo(s);QN(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){kp(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let l=0;lt.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ni(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(XM(n.key)&&!Ni(n.sep,"newline")){const o=mo(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ni(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=mo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Ni(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ni(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){kp(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ni(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Mf(r),i=mo(s);Qk(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Mf(t),r=mo(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Mf(t),r=mo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Aee(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new kee||null,prettyErrors:t}}function Cee(e,t={}){const{lineCounter:n,prettyErrors:r}=Aee(t),s=new See(n==null?void 0:n.addNewLine),i=new wee(t);let a=null;for(const o of i.compose(s.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new Lc(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(YN(e,n)),a.warnings.forEach(YN(e,n))),a}function Iee(e,t,n){let r;const s=Cee(e,n);if(!s)return null;if(s.warnings.forEach(i=>vM(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function Ree(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return Td(e)&&!r?e.toString(n):new Ad(e,r,n).toString(n)}const Oee="https://ark.cn-beijing.volces.com/api/v3/",ou=[{key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615",comment:"向量化模型(记忆/知识库需要)"},{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:Oee}],_l=[],bc=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],hs={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},QM=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:hs.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:hs.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:hs.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],Ox=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:_l},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:_l},{id:"link_reader",label:"网页读取",desc:"抓取并阅读给定链接的正文内容。",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",label:"网页爬取",desc:"结构化爬取网页(需要 Scraper 服务)。",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",label:"图像生成",desc:"文生图(Doubao Seedream)。",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",label:"图像编辑",desc:"图生图 / 编辑(Doubao SeedEdit)。",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",label:"视频生成",desc:"文/图生视频(Doubao Seedance),含任务查询。",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",label:"语音合成 (TTS)",desc:"把文本转成语音(火山语音)。",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"vesearch",label:"VeSearch 智能搜索",desc:"火山 VeSearch(需要 bot 端点)。",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],kp=[{id:"local",label:"本地内存",desc:"进程内,不持久化。适合开发调试。",env:[]},{id:"sqlite",label:"SQLite 文件",desc:"持久化到本地 .db 文件。",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",label:"MySQL",desc:"持久化到 MySQL。",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",label:"PostgreSQL",desc:"持久化到 PostgreSQL。",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],Sp=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:ou,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",label:"Redis",desc:"Redis 向量检索。",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:_l},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Ap=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:ou,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:_l},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[..._l,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],Cp=[{id:"apmplus",label:"APMPlus",desc:"火山 APMPlus 应用性能监控。",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",label:"CozeLoop",desc:"扣子 CozeLoop 链路观测。",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",label:"TLS (日志服务)",desc:"火山 TLS 日志服务导出。",enableFlag:"ENABLE_TLS",env:[..._l,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],Lee=e=>Ox.find(t=>t.id===e),Mee=e=>kp.find(t=>t.id===e),Dee=e=>Sp.find(t=>t.id===e),Pee=e=>Ap.find(t=>t.id===e),jee=e=>Cp.find(t=>t.id===e),Bee="doubao-seed-2-1-pro-260628",Fee="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Uee=`你是一个专业、可靠的智能助手。 +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Mf(t),r=mo(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Mf(t),r=mo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Aee(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Nee||null,prettyErrors:t}}function Cee(e,t={}){const{lineCounter:n,prettyErrors:r}=Aee(t),s=new See(n==null?void 0:n.addNewLine),i=new wee(t);let a=null;for(const o of i.compose(s.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new Lc(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(Yk(e,n)),a.warnings.forEach(Yk(e,n))),a}function Iee(e,t,n){let r;const s=Cee(e,n);if(!s)return null;if(s.warnings.forEach(i=>vM(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function Ree(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return Td(e)&&!r?e.toString(n):new Ad(e,r,n).toString(n)}const Oee="https://ark.cn-beijing.volces.com/api/v3/",ou=[{key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615",comment:"向量化模型(记忆/知识库需要)"},{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:Oee}],_l=[],bc=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],hs={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},QM=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:hs.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:hs.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:hs.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],Ox=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:_l},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:_l},{id:"link_reader",label:"网页读取",desc:"抓取并阅读给定链接的正文内容。",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",label:"网页爬取",desc:"结构化爬取网页(需要 Scraper 服务)。",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",label:"图像生成",desc:"文生图(Doubao Seedream)。",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",label:"图像编辑",desc:"图生图 / 编辑(Doubao SeedEdit)。",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",label:"视频生成",desc:"文/图生视频(Doubao Seedance),含任务查询。",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",label:"语音合成 (TTS)",desc:"把文本转成语音(火山语音)。",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"vesearch",label:"VeSearch 智能搜索",desc:"火山 VeSearch(需要 bot 端点)。",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],Np=[{id:"local",label:"本地内存",desc:"进程内,不持久化。适合开发调试。",env:[]},{id:"sqlite",label:"SQLite 文件",desc:"持久化到本地 .db 文件。",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",label:"MySQL",desc:"持久化到 MySQL。",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",label:"PostgreSQL",desc:"持久化到 PostgreSQL。",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],Sp=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:ou,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",label:"Redis",desc:"Redis 向量检索。",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:_l},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Ap=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:ou,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ou],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:_l},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[..._l,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],Cp=[{id:"apmplus",label:"APMPlus",desc:"火山 APMPlus 应用性能监控。",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",label:"CozeLoop",desc:"扣子 CozeLoop 链路观测。",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",label:"TLS (日志服务)",desc:"火山 TLS 日志服务导出。",enableFlag:"ENABLE_TLS",env:[..._l,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],Lee=e=>Ox.find(t=>t.id===e),Mee=e=>Np.find(t=>t.id===e),Dee=e=>Sp.find(t=>t.id===e),Pee=e=>Ap.find(t=>t.id===e),jee=e=>Cp.find(t=>t.id===e),Bee="doubao-seed-2-1-pro-260628",Fee="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Uee=`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`;function Xi(){return{name:"",description:Fee,instruction:Uee,agentType:"llm",maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:Bee,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:"local",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const $ee=new Set(["local","sqlite","mysql","postgresql"]),Hee=new Set(["local","opensearch","redis","viking","mem0"]),zee=new Set(["local","opensearch","viking","context_search"]),Vee=new Set(["apmplus","cozeloop","tls"]),ZM=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","vesearch"]),Kee=new Set(["llm","sequential","parallel","loop","a2a"]);function lt(e,t=""){return typeof e=="string"?e:t}function ga(e){return e===!0}function xh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function JM(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:lt(t.name),description:lt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function m0(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function e3(e){return typeof e=="string"&&Kee.has(e)?e:"llm"}function t3(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function n3(e){const t=e&&typeof e=="object"?e:{};return{enabled:ga(t.enabled),registrySpaceId:lt(t.registrySpaceId),registryTopK:lt(t.registryTopK),registryRegion:lt(t.registryRegion),registryEndpoint:lt(t.registryEndpoint)}}function r3(e){return Array.isArray(e)?e.map(t=>{const n=t&&typeof t=="object"?t:{},r=n3(n.a2aRegistry),s=e3(n.agentType),i=r.enabled&&s==="llm"?"a2a":s;return{...Xi(),name:lt(n.name),description:lt(n.description),instruction:lt(n.instruction),agentType:i,maxIterations:t3(n.maxIterations),a2aUrl:lt(n.a2aUrl),builtinTools:xh(n.builtinTools).filter(a=>ZM.has(a)),customTools:JM(n.customTools),a2aRegistry:i==="a2a"?{...r,enabled:!0}:r,subAgents:r3(n.subAgents)}}):[]}function Yee(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=lt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=lt(r.name)||lt(r.slug)||lt(r.skillName)||lt(r.skillId)||"skill",o=lt(r.folder)||a,l=lt(r.description);if(i==="skillhub"){const f=lt(r.slug);if(!f)continue;t.push({source:i,folder:o,name:a,description:l,slug:f,namespace:lt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},y=lt(m.path),w=lt(m.content);return y?{path:y,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:o,name:a,description:l,localFiles:h});continue}const u=lt(r.skillSpaceId),d=lt(r.skillId);!u||!d||t.push({source:i,folder:o,name:a,description:l,skillSpaceId:u,skillSpaceName:lt(r.skillSpaceName),skillId:d,version:lt(r.version)})}return t}function s3(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},r=t.deployment&&typeof t.deployment=="object"?t.deployment:{},s=n3(t.a2aRegistry),i=e3(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,o=Array.isArray(t.mcpTools)?t.mcpTools.map(l=>{const u=l&&typeof l=="object"?l:{},d=u.transport==="stdio"?"stdio":"http";return{name:lt(u.name),transport:d,url:lt(u.url),authToken:lt(u.authToken),command:lt(u.command),args:xh(u.args)}}).filter(l=>l.transport==="http"?!!l.url:!!l.command):[];return{...Xi(),name:lt(t.name)||"my_agent",description:lt(t.description),instruction:lt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:t3(t.maxIterations),a2aUrl:lt(t.a2aUrl),modelName:lt(t.modelName),modelProvider:lt(t.modelProvider),modelApiBase:lt(t.modelApiBase),builtinTools:xh(t.builtinTools).filter(l=>ZM.has(l)),customTools:JM(t.customTools),mcpTools:o,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:ga(n.shortTerm),longTerm:ga(n.longTerm)},shortTermBackend:m0(t.shortTermBackend,$ee,"local"),longTermBackend:m0(t.longTermBackend,Hee,"local"),autoSaveSession:ga(t.autoSaveSession),knowledgebase:ga(t.knowledgebase),knowledgebaseBackend:m0(t.knowledgebaseBackend,zee,"local"),tracing:ga(t.tracing),tracingExporters:xh(t.tracingExporters).filter(l=>Vee.has(l)),deployment:{feishuEnabled:ga(r.feishuEnabled)},subAgents:r3(t.subAgents),selectedSkills:Yee(t)}}function i3(e){var n,r,s,i,a,o,l,u,d,f,h,p,m,y,w,g,E;const t={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((n=e.a2aRegistry)!=null&&n.enabled){const b={enabled:!0};(r=e.a2aRegistry.registrySpaceId)!=null&&r.trim()&&(b.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),b.registryTopK=((s=e.a2aRegistry.registryTopK)==null?void 0:s.trim())||hs.topK,b.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||hs.region,b.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||hs.endpoint,t.a2aRegistry=b}return t}return t.name=e.name,t.description=e.description,t.instruction=e.instruction,e.agentType==="loop"&&(t.maxIterations=e.maxIterations??3),(o=e.modelName)!=null&&o.trim()&&(t.modelName=e.modelName.trim()),(l=e.modelProvider)!=null&&l.trim()&&(t.modelProvider=e.modelProvider.trim()),(u=e.modelApiBase)!=null&&u.trim()&&(t.modelApiBase=e.modelApiBase.trim()),(d=e.builtinTools)!=null&&d.length&&(t.builtinTools=[...e.builtinTools]),(f=e.customTools)!=null&&f.length&&(t.customTools=e.customTools.map(b=>({name:b.name,description:b.description}))),(h=e.mcpTools)!=null&&h.length&&(t.mcpTools=e.mcpTools.map(b=>{var N,T,A,k;const _={name:b.name,transport:b.transport};return(N=b.url)!=null&&N.trim()&&(_.url=b.url.trim()),(T=b.authToken)!=null&&T.trim()&&(_.authToken=b.authToken.trim()),(A=b.command)!=null&&A.trim()&&(_.command=b.command.trim()),(k=b.args)!=null&&k.length&&(_.args=b.args),_})),((p=e.memory)!=null&&p.shortTerm||(m=e.memory)!=null&&m.longTerm)&&(t.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(t.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(t.longTermBackend=e.longTermBackend||"local",t.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(t.knowledgebase=!0,t.knowledgebaseBackend=e.knowledgebaseBackend||"local"),e.tracing&&((y=e.tracingExporters)!=null&&y.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(w=e.deployment)!=null&&w.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(g=e.selectedSkills)!=null&&g.length&&(t.selectedSkills=e.selectedSkills.map(b=>{const _={source:b.source,name:b.name,folder:b.folder};return b.description&&(_.description=b.description),b.source==="skillhub"?(_.slug=b.slug,_.namespace=b.namespace??"public"):b.source==="local"?_.localFiles=b.localFiles??[]:(_.skillSpaceId=b.skillSpaceId,_.skillSpaceName=b.skillSpaceName,_.skillId=b.skillId,b.version&&(_.version=b.version)),_})),(E=e.subAgents)!=null&&E.length&&(t.subAgents=e.subAgents.map(i3)),t}function Wee(e){return`# VeADK Agent 结构配置 +- 保持礼貌、专业的语气。`;function Xi(){return{name:"",description:Fee,instruction:Uee,agentType:"llm",maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:Bee,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:"local",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const $ee=new Set(["local","sqlite","mysql","postgresql"]),Hee=new Set(["local","opensearch","redis","viking","mem0"]),zee=new Set(["local","opensearch","viking","context_search"]),Vee=new Set(["apmplus","cozeloop","tls"]),ZM=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","vesearch"]),Kee=new Set(["llm","sequential","parallel","loop","a2a"]);function lt(e,t=""){return typeof e=="string"?e:t}function ga(e){return e===!0}function xh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function JM(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:lt(t.name),description:lt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function p0(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function e3(e){return typeof e=="string"&&Kee.has(e)?e:"llm"}function t3(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function n3(e){const t=e&&typeof e=="object"?e:{};return{enabled:ga(t.enabled),registrySpaceId:lt(t.registrySpaceId),registryTopK:lt(t.registryTopK),registryRegion:lt(t.registryRegion),registryEndpoint:lt(t.registryEndpoint)}}function r3(e){return Array.isArray(e)?e.map(t=>{const n=t&&typeof t=="object"?t:{},r=n3(n.a2aRegistry),s=e3(n.agentType),i=r.enabled&&s==="llm"?"a2a":s;return{...Xi(),name:lt(n.name),description:lt(n.description),instruction:lt(n.instruction),agentType:i,maxIterations:t3(n.maxIterations),a2aUrl:lt(n.a2aUrl),builtinTools:xh(n.builtinTools).filter(a=>ZM.has(a)),customTools:JM(n.customTools),a2aRegistry:i==="a2a"?{...r,enabled:!0}:r,subAgents:r3(n.subAgents)}}):[]}function Yee(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=lt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=lt(r.name)||lt(r.slug)||lt(r.skillName)||lt(r.skillId)||"skill",o=lt(r.folder)||a,l=lt(r.description);if(i==="skillhub"){const f=lt(r.slug);if(!f)continue;t.push({source:i,folder:o,name:a,description:l,slug:f,namespace:lt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},y=lt(m.path),w=lt(m.content);return y?{path:y,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:o,name:a,description:l,localFiles:h});continue}const u=lt(r.skillSpaceId),d=lt(r.skillId);!u||!d||t.push({source:i,folder:o,name:a,description:l,skillSpaceId:u,skillSpaceName:lt(r.skillSpaceName),skillId:d,version:lt(r.version)})}return t}function s3(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},r=t.deployment&&typeof t.deployment=="object"?t.deployment:{},s=n3(t.a2aRegistry),i=e3(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,o=Array.isArray(t.mcpTools)?t.mcpTools.map(l=>{const u=l&&typeof l=="object"?l:{},d=u.transport==="stdio"?"stdio":"http";return{name:lt(u.name),transport:d,url:lt(u.url),authToken:lt(u.authToken),command:lt(u.command),args:xh(u.args)}}).filter(l=>l.transport==="http"?!!l.url:!!l.command):[];return{...Xi(),name:lt(t.name)||"my_agent",description:lt(t.description),instruction:lt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:t3(t.maxIterations),a2aUrl:lt(t.a2aUrl),modelName:lt(t.modelName),modelProvider:lt(t.modelProvider),modelApiBase:lt(t.modelApiBase),builtinTools:xh(t.builtinTools).filter(l=>ZM.has(l)),customTools:JM(t.customTools),mcpTools:o,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:ga(n.shortTerm),longTerm:ga(n.longTerm)},shortTermBackend:p0(t.shortTermBackend,$ee,"local"),longTermBackend:p0(t.longTermBackend,Hee,"local"),autoSaveSession:ga(t.autoSaveSession),knowledgebase:ga(t.knowledgebase),knowledgebaseBackend:p0(t.knowledgebaseBackend,zee,"local"),tracing:ga(t.tracing),tracingExporters:xh(t.tracingExporters).filter(l=>Vee.has(l)),deployment:{feishuEnabled:ga(r.feishuEnabled)},subAgents:r3(t.subAgents),selectedSkills:Yee(t)}}function i3(e){var n,r,s,i,a,o,l,u,d,f,h,p,m,y,w,g,E;const t={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((n=e.a2aRegistry)!=null&&n.enabled){const b={enabled:!0};(r=e.a2aRegistry.registrySpaceId)!=null&&r.trim()&&(b.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),b.registryTopK=((s=e.a2aRegistry.registryTopK)==null?void 0:s.trim())||hs.topK,b.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||hs.region,b.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||hs.endpoint,t.a2aRegistry=b}return t}return t.name=e.name,t.description=e.description,t.instruction=e.instruction,e.agentType==="loop"&&(t.maxIterations=e.maxIterations??3),(o=e.modelName)!=null&&o.trim()&&(t.modelName=e.modelName.trim()),(l=e.modelProvider)!=null&&l.trim()&&(t.modelProvider=e.modelProvider.trim()),(u=e.modelApiBase)!=null&&u.trim()&&(t.modelApiBase=e.modelApiBase.trim()),(d=e.builtinTools)!=null&&d.length&&(t.builtinTools=[...e.builtinTools]),(f=e.customTools)!=null&&f.length&&(t.customTools=e.customTools.map(b=>({name:b.name,description:b.description}))),(h=e.mcpTools)!=null&&h.length&&(t.mcpTools=e.mcpTools.map(b=>{var k,T,A,N;const _={name:b.name,transport:b.transport};return(k=b.url)!=null&&k.trim()&&(_.url=b.url.trim()),(T=b.authToken)!=null&&T.trim()&&(_.authToken=b.authToken.trim()),(A=b.command)!=null&&A.trim()&&(_.command=b.command.trim()),(N=b.args)!=null&&N.length&&(_.args=b.args),_})),((p=e.memory)!=null&&p.shortTerm||(m=e.memory)!=null&&m.longTerm)&&(t.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(t.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(t.longTermBackend=e.longTermBackend||"local",t.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(t.knowledgebase=!0,t.knowledgebaseBackend=e.knowledgebaseBackend||"local"),e.tracing&&((y=e.tracingExporters)!=null&&y.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(w=e.deployment)!=null&&w.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(g=e.selectedSkills)!=null&&g.length&&(t.selectedSkills=e.selectedSkills.map(b=>{const _={source:b.source,name:b.name,folder:b.folder};return b.description&&(_.description=b.description),b.source==="skillhub"?(_.slug=b.slug,_.namespace=b.namespace??"public"):b.source==="local"?_.localFiles=b.localFiles??[]:(_.skillSpaceId=b.skillSpaceId,_.skillSpaceName=b.skillSpaceName,_.skillId=b.skillId,b.version&&(_.version=b.version)),_})),(E=e.subAgents)!=null&&E.length&&(t.subAgents=e.subAgents.map(i3)),t}function Wee(e){return`# VeADK Agent 结构配置 # 可在「创建 Agent」页通过「导入 YAML」重新载入。 -`+Ree(i3(e))}function qee(e){const t=Iee(e);return s3(t)}const Gee=[{kind:"custom",icon:HF,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:CF,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:_F,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:zF,title:"工作流",desc:"敬请期待",disabled:!0}];function Xee({onSelect:e,onImport:t}){const n=v.useRef(null),[r,s]=v.useState(""),i=Gee.map(o=>({key:o.kind,icon:o.icon,title:o.title,desc:o.desc,disabled:o.disabled,onClick:()=>e(o.kind)})),a=async o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];if(o.target.value="",!!l)try{const d=await l.text();t(qee(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return c.jsx(fM,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c.jsxs("button",{className:"stk-import",onClick:()=>{var o;return(o=n.current)==null?void 0:o.click()},children:[c.jsx(UF,{}),"导入 YAML 配置"]}),r&&c.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),c.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const Qee="modulepreload",Zee=function(e){return"/"+e},ZN={},tl=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=Zee(l),l in ZN)return;ZN[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Qee,u||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})};function Jee({className:e,...t}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[c.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),c.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}const wo={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:Jee},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:II},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:PI},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:AE},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:um}},Df=[wo.llm,wo.sequential,wo.parallel,wo.loop,wo.a2a];function Lx(e){return wo[e??"llm"]}const a3=e=>e==="sequential"||e==="parallel"||e==="loop",Id=e=>e==="a2a";function o3(e){const t=new Map,n={};for(const r of e){for(const s of r.env){const i=t.get(s.key);(!i||s.required&&!i.required)&&t.set(s.key,s)}r.enableFlag&&(t.set(r.enableFlag,{key:r.enableFlag,required:!0}),n[r.enableFlag]="true")}return{specs:[...t.values()],fixedValues:n}}function ete(e,t){return o3([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function tte(e,t){const n=new Map;for(const r of e){const s=t[r.key]??"";s.trim()&&n.set(r.key,s)}return[...n].map(([r,s])=>({key:r,value:s}))}function JN(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const nte=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function rte(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function en(e,t){e.push(t&255,t>>>8&255)}function Nr(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const ek=2048,g0=20,tk=0;function ste(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),y=t.encode(p.content),w=rte(y),g=y.length,E=[];Nr(E,67324752),en(E,g0),en(E,ek),en(E,tk),en(E,0),en(E,0),Nr(E,w),Nr(E,g),Nr(E,g),en(E,m.length),en(E,0);const b=Uint8Array.from(E);n.push(b,m,y),r.push({nameBytes:m,dataBytes:y,crc:w,size:g,offset:s}),s+=b.length+m.length+y.length}const i=s,a=[];let o=0;for(const p of r){const m=[];Nr(m,33639248),en(m,g0),en(m,g0),en(m,ek),en(m,tk),en(m,0),en(m,0),Nr(m,p.crc),Nr(m,p.size),Nr(m,p.size),en(m,p.nameBytes.length),en(m,0),en(m,0),en(m,0),en(m,0),Nr(m,0),Nr(m,p.offset);const y=Uint8Array.from(m);a.push(y,p.nameBytes),o+=y.length+p.nameBytes.length}const l=[];Nr(l,101010256),en(l,0),en(l,0),en(l,r.length),en(l,r.length),Nr(l,o),Nr(l,i),en(l,0);const u=[...n,...a,Uint8Array.from(l)],d=u.reduce((p,m)=>p+m.length,0),f=new Uint8Array(d);let h=0;for(const p of u)f.set(p,h),h+=p.length;return new Blob([f],{type:"application/zip"})}const ite=v.lazy(()=>tl(()=>import("./CodeEditor-C8L3YPfR.js"),[]));function ate(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t;r.forEach((i,a)=>{let o=s.children.get(i);o||(o={name:i,children:new Map},s.children.set(i,o)),a===r.length-1&&(o.path=n.path),s=o})}return t}function ote(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,s=n.children.size>0&&n.path===void 0;return r!==s?r?-1:1:t.name.localeCompare(n.name)})}function lte({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=v.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,o]=v.useState(new Set),l=v.useRef(null),u=v.useMemo(()=>ate(e.files),[e.files]),d=e.files.find(y=>y.path===s)??null;if(v.useEffect(()=>{var g;if(!t)return;const y=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const w=E=>{E.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=y,window.removeEventListener("keydown",w)}},[n,t]),v.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(y){o(w=>{const g=new Set(w);return g.has(y)?g.delete(y):g.add(y),g})}function h(y,w,g){return ote(y).map(E=>{const b=g?`${g}/${E.name}`:E.name;if(!(E.children.size>0&&E.path===void 0)&&E.path)return c.jsxs("button",{type:"button",className:`code-browser-file${s===E.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(E.path??null),title:E.path,children:[c.jsx(B_,{"aria-hidden":"true"}),c.jsx("span",{children:E.name})]},b);const N=a.has(b);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(b),"aria-expanded":!N,children:[c.jsx(Xn,{className:N?"":"is-open","aria-hidden":"true"}),c.jsx(CI,{"aria-hidden":"true"}),c.jsx("span",{children:E.name})]}),!N&&h(E,w+1,b)]},b)})}function p(y){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:y}:w)})}return $a.createPortal(c.jsx("div",{className:"code-browser-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&n()},children:c.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[c.jsxs("header",{className:"code-browser-head",children:[c.jsxs("div",{className:"code-browser-title-wrap",children:[c.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:c.jsx(_E,{})}),c.jsxs("div",{children:[c.jsx("h2",{id:"code-browser-title",children:"项目代码"}),c.jsx("p",{children:e.name||"Agent 项目"})]})]}),c.jsx("button",{ref:l,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:c.jsx(Xr,{"aria-hidden":"true"})})]}),c.jsxs("div",{className:"code-browser-workspace",children:[c.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[c.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",c.jsx("span",{children:e.files.length})]}),c.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):c.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),c.jsxs("main",{className:"code-browser-main",children:[c.jsxs("div",{className:"code-browser-path",children:[c.jsx(B_,{"aria-hidden":"true"}),c.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),c.jsx("div",{className:"code-browser-editor",children:d?c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:c.jsx(ite,{value:d.content,path:d.path,onChange:p})}):c.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function cte({project:e,onChange:t,className:n=""}){const[r,s]=v.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[c.jsx(_E,{"aria-hidden":"true"}),c.jsx("span",{children:"查看源码"})]}),c.jsx(lte,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function ute({className:e,...t}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[c.jsx("path",{d:"m12 2.75 4.25 2.45v4.9L12 12.55 7.75 10.1V5.2L12 2.75Z"}),c.jsx("path",{d:"m7.75 5.2 4.25 2.45 4.25-2.45M12 7.65v4.9"}),c.jsx("path",{d:"M12 12.55v4.7m-2.25-2.2L12 17.3l2.25-2.25"}),c.jsx("path",{d:"M5.5 17.25v2.25a1.75 1.75 0 0 0 1.75 1.75h9.5a1.75 1.75 0 0 0 1.75-1.75v-2.25"})]})}function Ip({message:e,className:t="",onRetry:n}){const[r,s]=v.useState(!1),[i,a]=v.useState(!1),[o,l]=v.useState(!1),u=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{a(!1)}},d=async()=>{if(!(!n||o)){l(!0);try{await n()}finally{l(!1)}}};return c.jsxs("div",{className:`deploy-error-message${r?" is-expanded":""}${t?` ${t}`:""}`,children:[c.jsx("p",{className:"deploy-error-message-text",children:e}),c.jsxs("div",{className:"deploy-error-message-actions",children:[n&&c.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:o,onClick:()=>void d(),children:[o?c.jsx(bt,{className:"spin"}):c.jsx(DI,{}),o?"重试中…":"重试部署"]}),c.jsx("button",{type:"button",title:r?"收起错误信息":"展开完整错误信息","aria-label":r?"收起错误信息":"展开完整错误信息",onClick:()=>s(f=>!f),children:r?c.jsx(RF,{}):c.jsx(Gc,{})}),c.jsx("button",{type:"button",title:i?"已复制":"复制完整错误信息","aria-label":i?"已复制":"复制完整错误信息",onClick:()=>void u(),children:i?c.jsx(Bs,{}):c.jsx(TE,{})})]})]})}wr.registerLanguage("python",OO);wr.registerLanguage("typescript",VO);wr.registerLanguage("javascript",kO);wr.registerLanguage("json",SO);wr.registerLanguage("yaml",KO);wr.registerLanguage("markdown",RO);wr.registerLanguage("bash",xO);wr.registerLanguage("ini",wO);wr.registerLanguage("dockerfile",_Y);wr.registerLanguage("makefile",IO);const dte=v.lazy(()=>tl(()=>import("./CodeEditor-C8L3YPfR.js"),[]));function fte({open:e,onCancel:t,onConfirm:n}){const r=v.useRef(null);return v.useEffect(()=>{var a;if(!e)return;const s=document.body.style.overflow;document.body.style.overflow="hidden",(a=r.current)==null||a.focus();const i=o=>{o.key==="Escape"&&t()};return window.addEventListener("keydown",i),()=>{document.body.style.overflow=s,window.removeEventListener("keydown",i)}},[t,e]),e?$a.createPortal(c.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:s=>{s.target===s.currentTarget&&t()},children:c.jsxs("section",{className:"code-browser-dialog pp-confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"pp-confirm-title","aria-describedby":"pp-confirm-description",children:[c.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[c.jsxs("div",{className:"code-browser-title-wrap",children:[c.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:c.jsx(FF,{})}),c.jsx("h2",{id:"pp-confirm-title",children:"确认部署"})]}),c.jsx("button",{type:"button",className:"code-browser-close",onClick:t,"aria-label":"关闭部署确认",children:c.jsx(Xr,{"aria-hidden":"true"})})]}),c.jsx("div",{className:"pp-confirm-body",children:c.jsx("p",{id:"pp-confirm-description",children:"部署后暂不支持修改 Agent 配置,确定部署吗?"})}),c.jsxs("footer",{className:"pp-confirm-actions",children:[c.jsx("button",{ref:r,type:"button",onClick:t,children:"取消"}),c.jsx("button",{type:"button",className:"is-primary",onClick:n,children:"确定部署"})]})]})}),document.body):null}const hte={py:"python",pyi:"python",ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",env:"ini",txt:"plaintext"},nk={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function rk(e){return e.replace(/&/g,"&").replace(//g,">")}function pte(e){const n=(e.split("/").pop()??e).toLowerCase();if(nk[n])return nk[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const r=n.lastIndexOf(".");if(r===-1)return null;const s=n.slice(r+1);return hte[s]??null}function mte(e,t){try{const n=pte(t);return n&&wr.getLanguage(n)?wr.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?wr.highlightAuto(e).value:rk(e)}catch{return rk(e)}}const Pf=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}];function gte(e){return e.trim().replace(/[。.!!]+$/u,"")}function y0(e,t="未配置"){return[...new Set(e.map(r=>r==null?void 0:r.trim()).filter(Boolean))].join("、")||t}function l3(e,t="root"){var a,o,l;const n=e.agentType??"llm",r=[...(e.builtinTools??[]).map(u=>{var d;return((d=Lee(u))==null?void 0:d.label)??u}),...(e.customTools??[]).map(u=>u.name),...(e.mcpTools??[]).map(u=>u.name),...e.tools??[]],s=[...(e.selectedSkills??[]).map(u=>u.name),...e.skills??[]],i=e.memory.longTerm?((a=Dee(e.longTermBackend??"local"))==null?void 0:a.label)??e.longTermBackend:void 0;return{id:t,name:e.name.trim()||"未命名 Agent",type:n,description:gte(e.description),model:n==="llm"?e.modelName||e.model||"默认模型":"不适用",tools:y0(r),skills:y0(s),knowledgebase:e.knowledgebase?((o=Pee(e.knowledgebaseBackend??"local"))==null?void 0:o.label)??e.knowledgebaseBackend??"默认知识库":"未配置",shortTerm:e.memory.shortTerm?((l=Mee(e.shortTermBackend??"local"))==null?void 0:l.label)??e.shortTermBackend??"默认后端":"未配置",longTerm:i?`${i}${e.autoSaveSession?" · 自动保存会话":""}`:"未配置",tracing:e.tracing?y0((e.tracingExporters??[]).map(u=>{var d;return((d=jee(u))==null?void 0:d.label)??u}),"默认观测"):"未配置",children:e.subAgents.map((u,d)=>l3(u,`${t}.${d}`))}}function c3(e,t){if(e.id===t)return e;for(const n of e.children){const r=c3(n,t);if(r)return r}}function u3({agent:e,depth:t,inspectedId:n,onHover:r,onFocus:s}){const i=Lx(e.type),a=i.icon;return c.jsxs("div",{className:"pp-topology-branch",children:[c.jsxs("button",{type:"button",className:`pp-agent-node${e.id===n?" is-inspected":""}`,style:{marginLeft:t*16,width:`calc(100% - ${t*16}px)`},onMouseEnter:()=>r(e.id),onMouseLeave:()=>r(null),onFocus:()=>s(e.id),onBlur:()=>s(null),"aria-label":`查看 ${e.name} 配置`,children:[c.jsx("span",{className:"pp-agent-node-icon",children:c.jsx(a,{"aria-hidden":"true"})}),c.jsxs("span",{className:"pp-agent-node-main",children:[c.jsx("span",{className:"pp-agent-node-name",children:e.name}),c.jsx("span",{className:"pp-agent-node-type",children:i.label})]}),e.children.length>0&&c.jsx("span",{className:"pp-agent-child-count",children:e.children.length})]}),e.children.length>0&&c.jsx("div",{className:"pp-topology-children",children:e.children.map(o=>c.jsx(u3,{agent:o,depth:t+1,inspectedId:n,onHover:r,onFocus:s},o.id))})]})}function yte(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t;r.forEach((i,a)=>{let o=s.children.get(i);o||(o={name:i,children:new Map},s.children.set(i,o)),a===r.length-1&&(o.path=n.path),s=o})}return t}function bte(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,s=n.children.size>0&&n.path===void 0;return r!==s?r?-1:1:t.name.localeCompare(n.name)})}function Ete(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function xte({left:e,right:t}){const[n,r]=v.useState(null);return v.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?c.jsxs(c.Fragment,{children:[$a.createPortal(e,n.left),$a.createPortal(t,n.right)]}):c.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function Mx({project:e,agentDraft:t,agentName:n,agentCount:r,onChange:s,onDeploy:i,onAgentAdded:a,onDeploymentTaskChange:o,feishuEnabled:l=!1,onFeishuEnabledChange:u,deploymentEnv:d=[],deploymentEnvValues:f={},onDeploymentEnvChange:h,network:p,onNetworkChange:m,deployRegion:y="cn-beijing",onDeployRegionChange:w,onBack:g,onExportYaml:E}){var Qe,cn,an;const b=typeof s=="function",[_,N]=v.useState(((cn=(Qe=e==null?void 0:e.files)==null?void 0:Qe[0])==null?void 0:cn.path)??null),[T,A]=v.useState(new Set),[k,R]=v.useState(!1),[I,M]=v.useState(""),[B,Y]=v.useState(!1),[P,U]=v.useState(!1),[C,L]=v.useState(!1),[O,j]=v.useState(null),[S,H]=v.useState(null),[V,D]=v.useState({}),[ne,ee]=v.useState(null),[re,de]=v.useState(!1),[G,W]=v.useState([]),[oe,he]=v.useState(!1),[J,ce]=v.useState(null),[Ce,Ee]=v.useState(null),ge=v.useRef(!0),Le=v.useMemo(()=>t?l3(t):{id:"root",name:n||(e==null?void 0:e.name)||"未命名 Agent",type:"llm",description:"",model:"默认模型",tools:"未配置",skills:"未配置",knowledgebase:"未配置",shortTerm:"未配置",longTerm:"未配置",tracing:"未配置",children:[]},[t,n,e==null?void 0:e.name]),ve=Ce??J,Ue=ve?c3(Le,ve):void 0,Ie=Ue?Lx(Ue.type):void 0,ae=Ie==null?void 0:Ie.icon;v.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const wt=v.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:yte(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return c.jsx("div",{className:"pp-error",children:"项目数据无效"});const we=e.files.find(ie=>ie.path===_)??null,vt=(p==null?void 0:p.mode)??"public",ct=ete(l?[...d,...bc]:d,f),K=ct.length+G.length;function X(ie){A(_e=>{const ye=new Set(_e);return ye.has(ie)?ye.delete(ie):ye.add(ie),ye})}function le(ie,_e){s&&(s({...e,files:ie}),_e!==void 0&&N(_e))}function Ne(ie){we&&le(e.files.map(_e=>_e.path===we.path?{..._e,content:ie}:_e))}function Re(){const ie=I.trim();if(R(!1),M(""),!!ie){if(e.files.some(_e=>_e.path===ie)){N(ie);return}le([...e.files,{path:ie,content:""}],ie)}}function ut(){if(!we)return;const ie=window.prompt("重命名文件",we.path),_e=ie==null?void 0:ie.trim();!_e||_e===we.path||e.files.some(ye=>ye.path===_e)||le(e.files.map(ye=>ye.path===we.path?{...ye,path:_e}:ye),_e)}function We(){var _e;if(!we)return;const ie=e.files.filter(ye=>ye.path!==we.path);le(ie,((_e=ie[0])==null?void 0:_e.path)??null)}function ot(ie,_e){W(ye=>ye.map(Pe=>Pe.id===ie?{...Pe,..._e}:Pe))}function Zt(ie){W(_e=>_e.filter(ye=>ye.id!==ie))}function Ct(){W(ie=>[...ie,Ete()])}function Ge(ie){m&&m(ie==="public"?void 0:{...p??{mode:ie},mode:ie})}function Et(ie){m==null||m({...p??{mode:"private"},...ie})}function Ht(){const ie=new Map(G.map(ye=>({key:ye.key.trim(),value:ye.value})).filter(ye=>ye.key.length>0).map(ye=>[ye.key,ye.value])),_e=l?[...d,...bc]:d;for(const ye of tte(_e,f))ie.set(ye.key,ye.value);return[...ie].map(([ye,Pe])=>({key:ye,value:Pe}))}async function Nn(){if(!(!u||B||C)){j(null),L(!0);try{await u(!l)}catch(ie){ge.current&&j(`更新飞书配置失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{ge.current&&L(!1)}}}async function Fe(){var _e;if(!i||B)return;if(vt!=="public"&&!((_e=p==null?void 0:p.vpcId)!=null&&_e.trim())){j("使用 VPC 网络时,请填写 VPC ID。");return}const ie=JN(d,f);if(ie){const ye=d.find(Pe=>Pe.key===ie.key);j(`请返回配置页填写 ${(ye==null?void 0:ye.comment)||(ye==null?void 0:ye.key)}(${ye==null?void 0:ye.key})。`);return}if(l){const ye=JN(bc,f);if(ye){const Pe=bc.find($e=>$e.key===ye.key);j(`启用飞书后,请填写${(Pe==null?void 0:Pe.comment)||(Pe==null?void 0:Pe.key)}。`);return}}U(!0)}async function rt(){if(!i||B)return;U(!1);const ie=Ht();ge.current&&(j(null),H(null),D({}),ee(null),Y(!0));const _e=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let ye="生成中…";const Pe=Date.now();o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"running",label:"准备部署"});try{const $e=await i(e,qe=>{var gt;qe.runtimeName&&(ye=qe.runtimeName),ge.current&&(D(It=>({...It,[qe.phase]:qe})),ee(qe.phase)),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"running",label:((gt=Pf.find(It=>It.phase===qe.phase))==null?void 0:gt.label)??qe.phase,message:qe.message,pct:qe.pct})},l?{taskId:_e,im:{feishu:{enabled:!0}},envs:ie}:{taskId:_e,envs:ie});ge.current&&(H($e),ee(null)),o==null||o({id:_e,runtimeName:$e.agentName||ye,runtimeId:$e.runtimeId,region:$e.region||y,startedAt:Pe,status:"success",label:"部署完成"})}catch($e){const qe=$e instanceof Error?$e.message:String($e);if($e instanceof DOMException&&$e.name==="AbortError"){ge.current&&(j(null),ee(null)),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"});return}ge.current&&j(qe),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"error",label:"部署失败",message:qe,retry:Fe})}finally{ge.current&&Y(!1)}}function tt(){U(!1)}async function mt(){if(!(!S||re)){de(!0),j(null);try{const{addConnection:ie,addRuntimeConnection:_e,remoteAppId:ye,loadConnections:Pe}=await tl(async()=>{const{addConnection:gt,addRuntimeConnection:It,remoteAppId:Rt,loadConnections:gn}=await Promise.resolve().then(()=>LN);return{addConnection:gt,addRuntimeConnection:It,remoteAppId:Rt,loadConnections:gn}},void 0),{probeRuntimeApps:$e}=await tl(async()=>{const{probeRuntimeApps:gt}=await Promise.resolve().then(()=>sU);return{probeRuntimeApps:gt}},void 0);let qe;if(S.runtimeId){const gt=S.region??"cn-beijing",It=await $e(S.runtimeId,gt)??[];qe=_e(S.runtimeId,S.agentName,gt,It,It.length>0?{[It[0]]:S.agentName}:void 0)}else qe=await ie(S.agentName,S.url,S.apikey,"");if(qe.apps.length===0)j("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const gt={[qe.apps[0]]:S.agentName},It={...qe,appLabels:{...qe.appLabels??{},...gt}},gn=Pe().map(zt=>zt.id===qe.id?It:zt);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(gn));const{registerConnections:yn}=await tl(async()=>{const{registerConnections:zt}=await Promise.resolve().then(()=>LN);return{registerConnections:zt}},void 0);if(yn(gn),a){const zt=ye(qe.id,qe.apps[0]);a(zt,S.agentName)}else alert(`🎉 Agent "${S.agentName}" 已添加到左上角下拉列表!`)}}catch(ie){j(`添加 Agent 失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{de(!1)}}}function ue(){const ie=ste(e.files),_e=URL.createObjectURL(ie),ye=document.createElement("a");ye.href=_e,ye.download=`${e.name||"project"}.zip`,document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(_e)}function Oe(ie,_e,ye){return bte(ie).map(Pe=>{const $e=ye?`${ye}/${Pe.name}`:Pe.name,qe=Pe.path!==void 0,gt={paddingLeft:8+_e*14};if(qe){const Rt=Pe.path===_;return c.jsxs("button",{type:"button",className:`pp-row pp-file${Rt?" pp-active":""}`,style:gt,onClick:()=>N(Pe.path),title:Pe.path,children:[c.jsx(yF,{className:"pp-ic"}),c.jsx("span",{className:"pp-label",children:Pe.name})]},$e)}const It=T.has($e);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",className:"pp-row pp-folder",style:gt,onClick:()=>X($e),children:[c.jsx(Xn,{className:`pp-ic pp-chevron${It?"":" pp-open"}`}),c.jsx(CI,{className:"pp-ic"}),c.jsx("span",{className:"pp-label",children:Pe.name})]}),!It&&Oe(Pe,_e+1,$e)]},$e)})}return c.jsxs("div",{className:`pp-root${i?" is-deploy":""}`,children:[i&&c.jsx(xte,{left:c.jsxs("div",{className:"pp-toolbar-left",children:[g&&c.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:g,children:[c.jsx(EI,{className:"pp-ic"}),"返回配置"]}),c.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",n||e.name||"未命名 Agent",r&&r>1?` 等 ${r} 个智能体`:""]})]}),right:null}),c.jsxs("div",{className:"pp-body",children:[i&&c.jsxs("section",{className:"pp-topology-pane","aria-label":"Agent 拓扑",children:[c.jsxs("div",{className:"pp-topology-head",children:[c.jsxs("div",{children:[c.jsx("div",{className:"pp-topology-title",children:"Agent 拓扑"}),c.jsxs("div",{className:"pp-topology-count",children:[r??1," 个智能体"]})]}),b&&s&&c.jsx(cte,{project:e,onChange:s})]}),c.jsxs("div",{className:"pp-topology-scroll",children:[c.jsx("div",{className:"pp-topology-tree",children:c.jsx(u3,{agent:Le,depth:0,inspectedId:ve,onHover:ce,onFocus:Ee})}),Ue&&Ie&&ae&&c.jsxs("div",{className:"pp-agent-inspector","aria-live":"polite",children:[c.jsxs("div",{className:"pp-agent-inspector-head",children:[c.jsx("span",{className:"pp-agent-inspector-icon",children:c.jsx(ae,{"aria-hidden":"true"})}),c.jsxs("div",{children:[c.jsx("strong",{children:Ue.name}),c.jsx("span",{children:Ie.label})]})]}),Ue.description&&c.jsx("p",{children:Ue.description}),c.jsxs("dl",{className:"pp-agent-config-grid",children:[c.jsx("dt",{children:"模型"}),c.jsx("dd",{children:Ue.model}),c.jsx("dt",{children:"工具"}),c.jsx("dd",{children:Ue.tools}),c.jsx("dt",{children:"技能"}),c.jsx("dd",{children:Ue.skills}),c.jsx("dt",{children:"知识库"}),c.jsx("dd",{children:Ue.knowledgebase}),c.jsx("dt",{children:"短期记忆"}),c.jsx("dd",{children:Ue.shortTerm}),c.jsx("dt",{children:"长期记忆"}),c.jsx("dd",{children:Ue.longTerm}),c.jsx("dt",{children:"观测"}),c.jsx("dd",{children:Ue.tracing})]})]})]}),c.jsxs("div",{className:"pp-topology-actions",children:[E&&c.jsxs("button",{type:"button",className:"pp-secondary",onClick:E,children:[c.jsx(pF,{className:"pp-ic"}),"导出配置"]}),e.files.length>0&&c.jsxs("button",{type:"button",className:"pp-secondary",onClick:ue,children:[c.jsx(NE,{className:"pp-ic"}),"下载源码"]})]})]}),c.jsxs("div",{className:"pp-files-area",children:[c.jsxs("div",{className:"pp-sidebar",children:[c.jsxs("div",{className:"pp-sidebar-head",children:[c.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),b&&c.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{R(!0),M("")},children:c.jsx(mF,{className:"pp-ic"})})]}),c.jsxs("div",{className:"pp-tree",children:[k&&c.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:I,onChange:ie=>M(ie.target.value),onBlur:Re,onKeyDown:ie=>{ie.key==="Enter"&&Re(),ie.key==="Escape"&&(R(!1),M(""))}}),e.files.length===0&&!k?c.jsx("div",{className:"pp-empty",children:"暂无文件"}):Oe(wt,0,"")]})]}),c.jsxs("div",{className:"pp-main",children:[c.jsxs("div",{className:"pp-main-head",children:[c.jsx("span",{className:"pp-path",title:we==null?void 0:we.path,children:(we==null?void 0:we.path)??"未选择文件"}),c.jsx("div",{className:"pp-actions",children:b&&we&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:ut,children:c.jsx(MF,{className:"pp-ic"})}),c.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:We,children:c.jsx(Fl,{className:"pp-ic"})})]})})]}),c.jsx("div",{className:"pp-content",children:we==null?c.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):b?c.jsx("div",{className:"pp-codemirror",children:c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:c.jsx(dte,{value:we.content,path:we.path,onChange:Ne})})}):c.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:mte(we.content,we.path)}})})]})]}),i&&c.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[c.jsx("div",{className:"pp-config-head",children:c.jsx("div",{className:"pp-config-title",children:"部署配置"})}),c.jsxs("div",{className:"pp-config-scroll",children:[c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"发布区域"}),c.jsxs("select",{className:"pp-config-select",value:y,onChange:ie=>w==null?void 0:w(ie.target.value),"aria-label":"部署区域",disabled:B||!w,children:[c.jsx("option",{value:"cn-beijing",children:"华北 2(北京)"}),c.jsx("option",{value:"cn-shanghai",children:"华东 2(上海)"})]})]}),c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"消息渠道"}),c.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:`pp-channel${l?" is-on":""}`,onClick:()=>void Nn(),disabled:B||C||!u,children:[c.jsx("span",{className:"pp-channel-title",children:C?"飞书(正在更新代码…)":"飞书"}),c.jsx("span",{className:"pp-switch","aria-hidden":!0,children:c.jsx("span",{})})]}),l&&c.jsx("div",{className:"pp-channel-fields",children:bc.map(ie=>c.jsxs("label",{children:[c.jsxs("span",{children:[ie.comment||ie.key,ie.required&&c.jsx("small",{children:"必填"})]}),c.jsx("code",{children:ie.key}),c.jsx("input",{type:ie.key.includes("SECRET")?"password":"text",value:f[ie.key]??"",placeholder:ie.placeholder,disabled:B||!h,autoComplete:"off",onChange:_e=>h==null?void 0:h(ie.key,_e.currentTarget.value)})]},ie.key))})]}),c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"网络"}),c.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ie=>c.jsx("button",{type:"button",role:"radio","aria-checked":vt===ie,className:vt===ie?"is-on":"",onClick:()=>Ge(ie),disabled:B||!m,children:ie==="public"?"公网":ie==="private"?"VPC":"公网 + VPC"},ie))}),vt!=="public"&&c.jsxs("div",{className:"pp-network-fields",children:[c.jsxs("label",{children:[c.jsx("span",{children:"VPC ID"}),c.jsx("input",{value:(p==null?void 0:p.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:B,onChange:ie=>Et({vpcId:ie.target.value})})]}),c.jsxs("label",{children:[c.jsxs("span",{children:["子网 ID ",c.jsx("small",{children:"可选,多个用逗号分隔"})]}),c.jsx("input",{value:(p==null?void 0:p.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:B,onChange:ie=>Et({subnetIds:ie.target.value})})]}),c.jsxs("label",{className:"pp-network-check",children:[c.jsx("input",{type:"checkbox",checked:!!(p!=null&&p.enableSharedInternetAccess),disabled:B,onChange:ie=>Et({enableSharedInternetAccess:ie.target.checked})}),"VPC 内共享公网出口"]})]})]}),c.jsxs("section",{className:"pp-config-section pp-env-section",children:[c.jsxs("div",{className:"pp-env-head",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"pp-config-label",children:["环境变量",c.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[K," 项"]})]}),c.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),c.jsx("button",{type:"button",className:"pp-icon-btn",title:oe?"隐藏值":"显示值",onClick:()=>he(ie=>!ie),children:oe?c.jsx(hF,{className:"pp-ic"}):c.jsx(kI,{className:"pp-ic"})})]}),c.jsxs("button",{type:"button",className:"pp-env-add",onClick:Ct,disabled:B,children:[c.jsx(ms,{className:"pp-ic"}),"添加变量"]}),(ct.length>0||G.length>0)&&c.jsxs("div",{className:"pp-env-table",children:[ct.length>0&&c.jsxs("div",{className:"pp-env-group",children:[c.jsxs("div",{className:"pp-env-group-head",children:[c.jsx("span",{children:"组件自动生成"}),c.jsxs("small",{children:[ct.length," 项"]})]}),ct.map(ie=>{const _e=ie.key.startsWith("ENABLE_");return c.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[c.jsx("input",{className:"pp-env-key-fixed",value:ie.key,readOnly:!0,disabled:B,"aria-label":`${ie.key} 环境变量名`}),c.jsx("input",{type:_e||oe?"text":"password",value:ie.value,placeholder:ie.required?"必填,尚未填写":"可选,尚未填写",readOnly:_e,disabled:B||!_e&&!h,autoComplete:"off","aria-label":`${ie.key} 环境变量值`,onChange:ye=>h==null?void 0:h(ie.key,ye.currentTarget.value)}),c.jsx("span",{className:"pp-env-source",children:_e?"自动":"同步"})]},ie.key)})]}),G.length>0&&c.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[c.jsx("span",{children:"自定义变量"}),c.jsxs("small",{children:[G.length," 项"]})]}),G.map(ie=>c.jsxs("div",{className:"pp-env-row",children:[c.jsx("input",{value:ie.key,placeholder:"名称",disabled:B,autoComplete:"off",onChange:_e=>ot(ie.id,{key:_e.currentTarget.value})}),c.jsx("input",{type:oe?"text":"password",value:ie.value,placeholder:"值",disabled:B,autoComplete:"off",onChange:_e=>ot(ie.id,{value:_e.currentTarget.value})}),c.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:B,onClick:()=>Zt(ie.id),children:c.jsx(Xr,{className:"pp-ic"})})]},ie.id))]})]}),(B||S||Object.keys(V).length>0)&&c.jsxs("section",{className:"pp-config-section pp-progress-section",children:[c.jsx("div",{className:"pp-config-label",children:"部署进度"}),c.jsx("ol",{className:"pp-steps",children:Pf.map((ie,_e)=>{const ye=ne?Pf.findIndex(gt=>gt.phase===ne):-1,Pe=!!O&&(ye===-1?_e===0:_e===ye);let $e;S?$e="done":Pe?$e="failed":ye===-1?$e=B?"active":"pending":_eie.phase===ne))==null?void 0:an.label)??ne}阶段):`:""}${O}`,onRetry:Fe}),S&&c.jsxs("section",{className:"pp-deploy-result",children:[c.jsx("div",{className:"pp-deploy-result-header",children:"部署成功"}),c.jsxs("div",{className:"pp-deploy-result-body",children:[S.region&&c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"区域"}),c.jsx("code",{children:S.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"Agent 名称"}),c.jsx("code",{children:S.agentName})]}),c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"API 端点"}),c.jsx("code",{className:"pp-deploy-result-url",children:S.url})]})]}),c.jsxs("div",{className:"pp-deploy-result-actions",children:[c.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:mt,disabled:re,children:[re?c.jsx(bt,{className:"pp-ic spin"}):c.jsx(LI,{className:"pp-ic"}),re?"连接中…":"立即对话"]}),S.consoleUrl&&c.jsxs("a",{href:S.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[c.jsx(kE,{className:"pp-ic"}),"控制台"]})]})]})]}),c.jsx("div",{className:"pp-config-actions",children:c.jsxs("button",{type:"button",className:"pp-deploy",onClick:Fe,disabled:B||C,children:[B?c.jsx(bt,{className:"pp-ic spin"}):O?c.jsx(DI,{className:"pp-ic"}):c.jsx(ute,{className:"pp-ic"}),B?"部署中…":O?"重试部署":"部署"]})})]})]}),c.jsx(fte,{open:P,onCancel:tt,onConfirm:()=>void rt()})]})}const sk="dogfooding",b0="dogfooding",E0="dogfooding_b";let wte=0;const x0=()=>++wte;function ik(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function vte(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function ak(e){const t=[],n=vte(e);t.push(n);const r=n.indexOf("{"),s=n.lastIndexOf("}");r>=0&&s>r&&t.push(n.slice(r,s+1));for(const i of t)try{const a=JSON.parse(i);if(a&&typeof a=="object"&&(typeof a.name=="string"||typeof a.instruction=="string"))return await fp(s3(a))}catch{}return null}function _te({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=v.useState([{id:x0(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[o,l]=v.useState(""),[u,d]=v.useState(!1),[f,h]=v.useState(null),[p,m]=v.useState(null),[y,w]=v.useState(!1),[g,E]=v.useState(null),[b,_]=v.useState(null),[N,T]=v.useState(!1),[A,k]=v.useState(!1),[R,I]=v.useState({}),M=v.useRef(null),B=v.useRef(null),Y=v.useRef(null),P=v.useRef(null),U=v.useRef(null);v.useEffect(()=>{const ee=P.current;ee&&ee.scrollTo({top:ee.scrollHeight,behavior:"smooth"})},[i,u]),v.useEffect(()=>{const ee=U.current;ee&&(ee.style.height="auto",ee.style.height=Math.min(ee.scrollHeight,160)+"px")},[o]);const C=ee=>a(re=>[...re,{id:x0(),role:"assistant",text:ee}]);async function L(){if(M.current)return M.current;const ee=await up(sk,e);return M.current=ee,ee}async function O(ee,re){if(re.current)return re.current;const de=await up(ee,e);return re.current=de,de}async function j(ee,re){if(!R[ee])try{const de=await hd(re);I(G=>({...G,[ee]:de.model||re}))}catch{I(de=>({...de,[ee]:re}))}}async function S(ee,re,de){const G=await O(ee,re);let W=Qs();for await(const he of Mu({appName:ee,userId:e,sessionId:G,text:de}))W=ml(W,he);const oe=ik(W).trim();return{project:await ak(oe),finalText:oe}}const H=async(ee,re,de)=>LE(ee.name,ee.files,{region:"cn-beijing",projectName:"default"},{...de,onStage:re}),V=async()=>{const ee=o.trim();if(!(!ee||u)){if(a(re=>[...re,{id:x0(),role:"user",text:ee}]),l(""),h(null),d(!0),y){E(null),_(null),T(!0),k(!0),j("a",b0),j("b",E0);const re=S(b0,B,ee).then(({project:G})=>(E(G),G)).catch(G=>{const W=G instanceof Error?G.message:String(G);return h(W),null}).finally(()=>T(!1)),de=S(E0,Y,ee).then(({project:G})=>(_(G),G)).catch(G=>{const W=G instanceof Error?G.message:String(G);return h(W),null}).finally(()=>k(!1));try{const[G,W]=await Promise.all([re,de]),oe=[G?`方案 A:${G.name}`:null,W?`方案 B:${W.name}`:null].filter(Boolean);oe.length?C(`已生成两个方案(${oe.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const re=await L();let de=Qs();for await(const oe of Mu({appName:sk,userId:e,sessionId:re,text:ee}))de=ml(de,oe);const G=ik(de).trim(),W=await ak(G);W?(m(W),C(`已生成项目:${W.name}(${W.files.length} 个文件),可在右侧预览和编辑。`)):C(G||"(助手没有返回内容,请再描述一下你的需求。)")}catch(re){const de=re instanceof Error?re.message:String(re);h(de),C(`抱歉,调用智能构建助手失败:${de}`)}finally{d(!1)}}},D=ee=>{const re=ee==="a"?g:b;if(!re)return;m(re),w(!1),E(null),_(null),T(!1),k(!1);const de=ee==="a"?"A":"B",G=ee==="a"?R.a:R.b;C(`已采用方案 ${de}(${G??(ee==="a"?b0:E0)}),可继续编辑。`)},ne=ee=>{ee.key==="Enter"&&!ee.shiftKey&&!ee.nativeEvent.isComposing&&(ee.preventDefault(),V())};return c.jsx("div",{className:"ic-root",children:c.jsxs("div",{className:"ic-body",children:[c.jsxs("div",{className:"ic-chat",children:[c.jsxs("div",{className:"ic-transcript",ref:P,children:[c.jsx(Hi,{initial:!1,children:i.map(ee=>c.jsxs(Gt.div,{className:`ic-turn ic-turn--${ee.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[ee.role==="assistant"&&c.jsx("div",{className:"ic-avatar",children:c.jsx(Ha,{className:"ic-avatar-icon"})}),c.jsx("div",{className:"ic-bubble",children:ee.role==="assistant"?c.jsx(_d,{text:ee.text}):ee.text})]},ee.id))}),u&&c.jsxs(Gt.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[c.jsx("div",{className:"ic-avatar",children:c.jsx(Ha,{className:"ic-avatar-icon"})}),c.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[c.jsx("span",{className:"ic-dot"}),c.jsx("span",{className:"ic-dot"}),c.jsx("span",{className:"ic-dot"})]})]})]}),f&&c.jsxs("div",{className:"ic-error",children:[c.jsx(TI,{className:"ic-error-icon"}),f]}),c.jsxs("div",{className:"ic-composer",children:[c.jsxs("div",{className:"ic-composer-box",children:[c.jsx("textarea",{ref:U,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:o,onChange:ee=>l(ee.target.value),onKeyDown:ne,disabled:u}),c.jsx("button",{className:"ic-send",onClick:()=>void V(),disabled:!o.trim()||u,title:"发送 (Enter)",children:c.jsx(jF,{className:"ic-send-icon"})})]}),c.jsxs("div",{className:"ic-composer-foot",children:[c.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[c.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:y,disabled:u,onChange:ee=>w(ee.target.checked)}),c.jsx("span",{className:"ic-ab-track",children:c.jsx("span",{className:"ic-ab-thumb"})}),c.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),c.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),c.jsx("aside",{className:"ic-preview",children:y?c.jsxs("div",{className:"ic-compare",children:[c.jsx(ok,{side:"a",project:g,loading:N,model:R.a,onAdopt:()=>D("a")}),c.jsx("div",{className:"ic-compare-divider"}),c.jsx(ok,{side:"b",project:b,loading:A,model:R.b,onAdopt:()=>D("b")})]}):p?c.jsx(Mx,{project:p,onChange:m,onDeploy:H,onAgentAdded:r,onDeploymentTaskChange:s}):c.jsxs("div",{className:"ic-preview-empty",children:[c.jsxs("div",{className:"ic-preview-empty-icon",children:[c.jsx(bF,{className:"ic-preview-empty-glyph"}),c.jsx(za,{className:"ic-preview-empty-spark"})]}),c.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),c.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function ok({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return c.jsxs("div",{className:"ic-pane",children:[c.jsxs("div",{className:"ic-pane-head",children:[c.jsxs("div",{className:"ic-pane-title",children:[c.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&c.jsx("span",{className:"ic-pane-model",children:r})]}),c.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),c.jsx("div",{className:"ic-pane-body",children:n?c.jsxs("div",{className:"ic-pane-loading",children:[c.jsx(bt,{className:"ic-pane-spinner"}),c.jsx("span",{children:"正在生成…"})]}):t?c.jsx(Mx,{project:t}):c.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const Tte=/^[A-Za-z_][A-Za-z0-9_]*$/;function nl(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":Tte.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function d3(e){const t=new Set,n=new Set,r=s=>{nl(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function Zr(e){return e.trimEnd().replace(/[。.]+$/,"")}function ua(e,t){return e[t]|e[t+1]<<8}function Ec(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function Nte(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function kte(e){let n=-1;for(let o=e.length-22;o>=0&&o>e.length-65557;o--)if(Ec(e,o)===101010256){n=o;break}if(n<0)throw new Error("无效的 zip:找不到 EOCD");const r=ua(e,n+10);let s=Ec(e,n+16);const i=new TextDecoder("utf-8"),a=[];for(let o=0;o{var o;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((o=a.Metadata)==null?void 0:o.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function Cte({selected:e,onChange:t}){const[n,r]=v.useState(""),[s,i]=v.useState([]),[a,o]=v.useState(!1),[l,u]=v.useState(null),[d,f]=v.useState(!1),h=y=>e.some(w=>w.source==="skillhub"&&w.slug===y),p=y=>{y.slug&&(h(y.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===y.slug))):t([...e,{source:"skillhub",slug:y.slug,name:y.name,folder:y.slug.split("/").pop()||y.name,namespace:y.namespace||"public",description:y.description}]))},m=async y=>{o(!0),u(null),f(!0);try{const w=await Ate(y);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{o(!1)}};return v.useEffect(()=>{const y=n.trim();if(!y){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(y),300);return()=>clearTimeout(w)},[n]),c.jsxs("div",{className:"cw-skillhub",children:[c.jsxs("div",{className:"cw-skill-searchrow",children:[c.jsxs("div",{className:"cw-skill-searchbox",children:[c.jsx(t1,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),c.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:y=>r(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),n.trim()&&m(n))}})]}),c.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(t1,{className:"cw-i"}),"搜索"]})]}),l&&c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:l})]}),a&&s.length===0?c.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?c.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const w=h(y.slug||"");return c.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(y),"aria-pressed":w,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsx("span",{className:"cw-skill-result-name",children:y.name}),y.description&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(y.description)}),y.sourceRepo&&c.jsx("span",{className:"cw-skill-result-repo",children:y.sourceRepo})]})]},y.id||y.slug)})}):d&&!l?c.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&c.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const M1=/(^|\/)skill\.md$/i;class Vi extends Error{}function Ite(e,t){const n=(e??"").replace(/\r\n?/g,` +`+Ree(i3(e))}function qee(e){const t=Iee(e);return s3(t)}const Gee=[{kind:"custom",icon:HF,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:CF,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:_F,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:zF,title:"工作流",desc:"敬请期待",disabled:!0}];function Xee({onSelect:e,onImport:t}){const n=v.useRef(null),[r,s]=v.useState(""),i=Gee.map(o=>({key:o.kind,icon:o.icon,title:o.title,desc:o.desc,disabled:o.disabled,onClick:()=>e(o.kind)})),a=async o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];if(o.target.value="",!!l)try{const d=await l.text();t(qee(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return c.jsx(fM,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c.jsxs("button",{className:"stk-import",onClick:()=>{var o;return(o=n.current)==null?void 0:o.click()},children:[c.jsx(UF,{}),"导入 YAML 配置"]}),r&&c.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),c.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const Qee="modulepreload",Zee=function(e){return"/"+e},Zk={},tl=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=Zee(l),l in Zk)return;Zk[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Qee,u||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})};function Jee({className:e,...t}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[c.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),c.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}const wo={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:Jee},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:II},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:PI},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:AE},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:um}},Df=[wo.llm,wo.sequential,wo.parallel,wo.loop,wo.a2a];function Lx(e){return wo[e??"llm"]}const a3=e=>e==="sequential"||e==="parallel"||e==="loop",Id=e=>e==="a2a";function o3(e){const t=new Map,n={};for(const r of e){for(const s of r.env){const i=t.get(s.key);(!i||s.required&&!i.required)&&t.set(s.key,s)}r.enableFlag&&(t.set(r.enableFlag,{key:r.enableFlag,required:!0}),n[r.enableFlag]="true")}return{specs:[...t.values()],fixedValues:n}}function ete(e,t){return o3([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function tte(e,t){const n=new Map;for(const r of e){const s=t[r.key]??"";s.trim()&&n.set(r.key,s)}return[...n].map(([r,s])=>({key:r,value:s}))}function Jk(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const nte=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function rte(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function en(e,t){e.push(t&255,t>>>8&255)}function kr(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const eN=2048,m0=20,tN=0;function ste(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),y=t.encode(p.content),w=rte(y),g=y.length,E=[];kr(E,67324752),en(E,m0),en(E,eN),en(E,tN),en(E,0),en(E,0),kr(E,w),kr(E,g),kr(E,g),en(E,m.length),en(E,0);const b=Uint8Array.from(E);n.push(b,m,y),r.push({nameBytes:m,dataBytes:y,crc:w,size:g,offset:s}),s+=b.length+m.length+y.length}const i=s,a=[];let o=0;for(const p of r){const m=[];kr(m,33639248),en(m,m0),en(m,m0),en(m,eN),en(m,tN),en(m,0),en(m,0),kr(m,p.crc),kr(m,p.size),kr(m,p.size),en(m,p.nameBytes.length),en(m,0),en(m,0),en(m,0),en(m,0),kr(m,0),kr(m,p.offset);const y=Uint8Array.from(m);a.push(y,p.nameBytes),o+=y.length+p.nameBytes.length}const l=[];kr(l,101010256),en(l,0),en(l,0),en(l,r.length),en(l,r.length),kr(l,o),kr(l,i),en(l,0);const u=[...n,...a,Uint8Array.from(l)],d=u.reduce((p,m)=>p+m.length,0),f=new Uint8Array(d);let h=0;for(const p of u)f.set(p,h),h+=p.length;return new Blob([f],{type:"application/zip"})}const ite=v.lazy(()=>tl(()=>import("./CodeEditor-Bryey6AH.js"),[]));function ate(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t;r.forEach((i,a)=>{let o=s.children.get(i);o||(o={name:i,children:new Map},s.children.set(i,o)),a===r.length-1&&(o.path=n.path),s=o})}return t}function ote(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,s=n.children.size>0&&n.path===void 0;return r!==s?r?-1:1:t.name.localeCompare(n.name)})}function lte({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=v.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,o]=v.useState(new Set),l=v.useRef(null),u=v.useMemo(()=>ate(e.files),[e.files]),d=e.files.find(y=>y.path===s)??null;if(v.useEffect(()=>{var g;if(!t)return;const y=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const w=E=>{E.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=y,window.removeEventListener("keydown",w)}},[n,t]),v.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(y){o(w=>{const g=new Set(w);return g.has(y)?g.delete(y):g.add(y),g})}function h(y,w,g){return ote(y).map(E=>{const b=g?`${g}/${E.name}`:E.name;if(!(E.children.size>0&&E.path===void 0)&&E.path)return c.jsxs("button",{type:"button",className:`code-browser-file${s===E.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(E.path??null),title:E.path,children:[c.jsx(B_,{"aria-hidden":"true"}),c.jsx("span",{children:E.name})]},b);const k=a.has(b);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(b),"aria-expanded":!k,children:[c.jsx(lr,{className:k?"":"is-open","aria-hidden":"true"}),c.jsx(CI,{"aria-hidden":"true"}),c.jsx("span",{children:E.name})]}),!k&&h(E,w+1,b)]},b)})}function p(y){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:y}:w)})}return $a.createPortal(c.jsx("div",{className:"code-browser-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&n()},children:c.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[c.jsxs("header",{className:"code-browser-head",children:[c.jsxs("div",{className:"code-browser-title-wrap",children:[c.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:c.jsx(vE,{})}),c.jsxs("div",{children:[c.jsx("h2",{id:"code-browser-title",children:"项目代码"}),c.jsx("p",{children:e.name||"Agent 项目"})]})]}),c.jsx("button",{ref:l,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:c.jsx(Xr,{"aria-hidden":"true"})})]}),c.jsxs("div",{className:"code-browser-workspace",children:[c.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[c.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",c.jsx("span",{children:e.files.length})]}),c.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):c.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),c.jsxs("main",{className:"code-browser-main",children:[c.jsxs("div",{className:"code-browser-path",children:[c.jsx(B_,{"aria-hidden":"true"}),c.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),c.jsx("div",{className:"code-browser-editor",children:d?c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:c.jsx(ite,{value:d.content,path:d.path,onChange:p})}):c.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function cte({project:e,onChange:t,className:n=""}){const[r,s]=v.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[c.jsx(vE,{"aria-hidden":"true"}),c.jsx("span",{children:"查看源码"})]}),c.jsx(lte,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function ute({className:e,...t}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[c.jsx("path",{d:"m12 2.75 4.25 2.45v4.9L12 12.55 7.75 10.1V5.2L12 2.75Z"}),c.jsx("path",{d:"m7.75 5.2 4.25 2.45 4.25-2.45M12 7.65v4.9"}),c.jsx("path",{d:"M12 12.55v4.7m-2.25-2.2L12 17.3l2.25-2.25"}),c.jsx("path",{d:"M5.5 17.25v2.25a1.75 1.75 0 0 0 1.75 1.75h9.5a1.75 1.75 0 0 0 1.75-1.75v-2.25"})]})}function Ip({message:e,className:t="",onRetry:n}){const[r,s]=v.useState(!1),[i,a]=v.useState(!1),[o,l]=v.useState(!1),u=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{a(!1)}},d=async()=>{if(!(!n||o)){l(!0);try{await n()}finally{l(!1)}}};return c.jsxs("div",{className:`deploy-error-message${r?" is-expanded":""}${t?` ${t}`:""}`,children:[c.jsx("p",{className:"deploy-error-message-text",children:e}),c.jsxs("div",{className:"deploy-error-message-actions",children:[n&&c.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:o,onClick:()=>void d(),children:[o?c.jsx(bt,{className:"spin"}):c.jsx(DI,{}),o?"重试中…":"重试部署"]}),c.jsx("button",{type:"button",title:r?"收起错误信息":"展开完整错误信息","aria-label":r?"收起错误信息":"展开完整错误信息",onClick:()=>s(f=>!f),children:r?c.jsx(RF,{}):c.jsx(Gc,{})}),c.jsx("button",{type:"button",title:i?"已复制":"复制完整错误信息","aria-label":i?"已复制":"复制完整错误信息",onClick:()=>void u(),children:i?c.jsx(Bs,{}):c.jsx(_E,{})})]})]})}wr.registerLanguage("python",OO);wr.registerLanguage("typescript",VO);wr.registerLanguage("javascript",NO);wr.registerLanguage("json",SO);wr.registerLanguage("yaml",KO);wr.registerLanguage("markdown",RO);wr.registerLanguage("bash",xO);wr.registerLanguage("ini",wO);wr.registerLanguage("dockerfile",_Y);wr.registerLanguage("makefile",IO);const dte=v.lazy(()=>tl(()=>import("./CodeEditor-Bryey6AH.js"),[]));function fte({open:e,onCancel:t,onConfirm:n}){const r=v.useRef(null);return v.useEffect(()=>{var a;if(!e)return;const s=document.body.style.overflow;document.body.style.overflow="hidden",(a=r.current)==null||a.focus();const i=o=>{o.key==="Escape"&&t()};return window.addEventListener("keydown",i),()=>{document.body.style.overflow=s,window.removeEventListener("keydown",i)}},[t,e]),e?$a.createPortal(c.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:s=>{s.target===s.currentTarget&&t()},children:c.jsxs("section",{className:"code-browser-dialog pp-confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"pp-confirm-title","aria-describedby":"pp-confirm-description",children:[c.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[c.jsxs("div",{className:"code-browser-title-wrap",children:[c.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:c.jsx(FF,{})}),c.jsx("h2",{id:"pp-confirm-title",children:"确认部署"})]}),c.jsx("button",{type:"button",className:"code-browser-close",onClick:t,"aria-label":"关闭部署确认",children:c.jsx(Xr,{"aria-hidden":"true"})})]}),c.jsx("div",{className:"pp-confirm-body",children:c.jsx("p",{id:"pp-confirm-description",children:"部署后暂不支持修改 Agent 配置,确定部署吗?"})}),c.jsxs("footer",{className:"pp-confirm-actions",children:[c.jsx("button",{ref:r,type:"button",onClick:t,children:"取消"}),c.jsx("button",{type:"button",className:"is-primary",onClick:n,children:"确定部署"})]})]})}),document.body):null}const hte={py:"python",pyi:"python",ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",env:"ini",txt:"plaintext"},nN={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function rN(e){return e.replace(/&/g,"&").replace(//g,">")}function pte(e){const n=(e.split("/").pop()??e).toLowerCase();if(nN[n])return nN[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const r=n.lastIndexOf(".");if(r===-1)return null;const s=n.slice(r+1);return hte[s]??null}function mte(e,t){try{const n=pte(t);return n&&wr.getLanguage(n)?wr.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?wr.highlightAuto(e).value:rN(e)}catch{return rN(e)}}const Pf=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}];function gte(e){return e.trim().replace(/[。.!!]+$/u,"")}function g0(e,t="未配置"){return[...new Set(e.map(r=>r==null?void 0:r.trim()).filter(Boolean))].join("、")||t}function l3(e,t="root"){var a,o,l;const n=e.agentType??"llm",r=[...(e.builtinTools??[]).map(u=>{var d;return((d=Lee(u))==null?void 0:d.label)??u}),...(e.customTools??[]).map(u=>u.name),...(e.mcpTools??[]).map(u=>u.name),...e.tools??[]],s=[...(e.selectedSkills??[]).map(u=>u.name),...e.skills??[]],i=e.memory.longTerm?((a=Dee(e.longTermBackend??"local"))==null?void 0:a.label)??e.longTermBackend:void 0;return{id:t,name:e.name.trim()||"未命名 Agent",type:n,description:gte(e.description),model:n==="llm"?e.modelName||e.model||"默认模型":"不适用",tools:g0(r),skills:g0(s),knowledgebase:e.knowledgebase?((o=Pee(e.knowledgebaseBackend??"local"))==null?void 0:o.label)??e.knowledgebaseBackend??"默认知识库":"未配置",shortTerm:e.memory.shortTerm?((l=Mee(e.shortTermBackend??"local"))==null?void 0:l.label)??e.shortTermBackend??"默认后端":"未配置",longTerm:i?`${i}${e.autoSaveSession?" · 自动保存会话":""}`:"未配置",tracing:e.tracing?g0((e.tracingExporters??[]).map(u=>{var d;return((d=jee(u))==null?void 0:d.label)??u}),"默认观测"):"未配置",children:e.subAgents.map((u,d)=>l3(u,`${t}.${d}`))}}function c3(e,t){if(e.id===t)return e;for(const n of e.children){const r=c3(n,t);if(r)return r}}function u3({agent:e,depth:t,inspectedId:n,onHover:r,onFocus:s}){const i=Lx(e.type),a=i.icon;return c.jsxs("div",{className:"pp-topology-branch",children:[c.jsxs("button",{type:"button",className:`pp-agent-node${e.id===n?" is-inspected":""}`,style:{marginLeft:t*16,width:`calc(100% - ${t*16}px)`},onMouseEnter:()=>r(e.id),onMouseLeave:()=>r(null),onFocus:()=>s(e.id),onBlur:()=>s(null),"aria-label":`查看 ${e.name} 配置`,children:[c.jsx("span",{className:"pp-agent-node-icon",children:c.jsx(a,{"aria-hidden":"true"})}),c.jsxs("span",{className:"pp-agent-node-main",children:[c.jsx("span",{className:"pp-agent-node-name",children:e.name}),c.jsx("span",{className:"pp-agent-node-type",children:i.label})]}),e.children.length>0&&c.jsx("span",{className:"pp-agent-child-count",children:e.children.length})]}),e.children.length>0&&c.jsx("div",{className:"pp-topology-children",children:e.children.map(o=>c.jsx(u3,{agent:o,depth:t+1,inspectedId:n,onHover:r,onFocus:s},o.id))})]})}function yte(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t;r.forEach((i,a)=>{let o=s.children.get(i);o||(o={name:i,children:new Map},s.children.set(i,o)),a===r.length-1&&(o.path=n.path),s=o})}return t}function bte(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,s=n.children.size>0&&n.path===void 0;return r!==s?r?-1:1:t.name.localeCompare(n.name)})}function Ete(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function xte({left:e,right:t}){const[n,r]=v.useState(null);return v.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?c.jsxs(c.Fragment,{children:[$a.createPortal(e,n.left),$a.createPortal(t,n.right)]}):c.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function Mx({project:e,agentDraft:t,agentName:n,agentCount:r,onChange:s,onDeploy:i,onAgentAdded:a,onDeploymentTaskChange:o,feishuEnabled:l=!1,onFeishuEnabledChange:u,deploymentEnv:d=[],deploymentEnvValues:f={},onDeploymentEnvChange:h,network:p,onNetworkChange:m,deployRegion:y="cn-beijing",onDeployRegionChange:w,onBack:g,onExportYaml:E}){var Qe,cn,an;const b=typeof s=="function",[_,k]=v.useState(((cn=(Qe=e==null?void 0:e.files)==null?void 0:Qe[0])==null?void 0:cn.path)??null),[T,A]=v.useState(new Set),[N,R]=v.useState(!1),[I,M]=v.useState(""),[B,Y]=v.useState(!1),[P,U]=v.useState(!1),[C,L]=v.useState(!1),[O,j]=v.useState(null),[S,H]=v.useState(null),[V,D]=v.useState({}),[ne,ee]=v.useState(null),[re,de]=v.useState(!1),[G,W]=v.useState([]),[oe,he]=v.useState(!1),[J,ce]=v.useState(null),[Ce,Ee]=v.useState(null),ge=v.useRef(!0),Le=v.useMemo(()=>t?l3(t):{id:"root",name:n||(e==null?void 0:e.name)||"未命名 Agent",type:"llm",description:"",model:"默认模型",tools:"未配置",skills:"未配置",knowledgebase:"未配置",shortTerm:"未配置",longTerm:"未配置",tracing:"未配置",children:[]},[t,n,e==null?void 0:e.name]),ve=Ce??J,Ue=ve?c3(Le,ve):void 0,Ie=Ue?Lx(Ue.type):void 0,ae=Ie==null?void 0:Ie.icon;v.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const wt=v.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:yte(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return c.jsx("div",{className:"pp-error",children:"项目数据无效"});const we=e.files.find(ie=>ie.path===_)??null,vt=(p==null?void 0:p.mode)??"public",ct=ete(l?[...d,...bc]:d,f),K=ct.length+G.length;function X(ie){A(_e=>{const ye=new Set(_e);return ye.has(ie)?ye.delete(ie):ye.add(ie),ye})}function le(ie,_e){s&&(s({...e,files:ie}),_e!==void 0&&k(_e))}function ke(ie){we&&le(e.files.map(_e=>_e.path===we.path?{..._e,content:ie}:_e))}function Re(){const ie=I.trim();if(R(!1),M(""),!!ie){if(e.files.some(_e=>_e.path===ie)){k(ie);return}le([...e.files,{path:ie,content:""}],ie)}}function ut(){if(!we)return;const ie=window.prompt("重命名文件",we.path),_e=ie==null?void 0:ie.trim();!_e||_e===we.path||e.files.some(ye=>ye.path===_e)||le(e.files.map(ye=>ye.path===we.path?{...ye,path:_e}:ye),_e)}function We(){var _e;if(!we)return;const ie=e.files.filter(ye=>ye.path!==we.path);le(ie,((_e=ie[0])==null?void 0:_e.path)??null)}function ot(ie,_e){W(ye=>ye.map(Pe=>Pe.id===ie?{...Pe,..._e}:Pe))}function Zt(ie){W(_e=>_e.filter(ye=>ye.id!==ie))}function Ct(){W(ie=>[...ie,Ete()])}function Ge(ie){m&&m(ie==="public"?void 0:{...p??{mode:ie},mode:ie})}function Et(ie){m==null||m({...p??{mode:"private"},...ie})}function Ht(){const ie=new Map(G.map(ye=>({key:ye.key.trim(),value:ye.value})).filter(ye=>ye.key.length>0).map(ye=>[ye.key,ye.value])),_e=l?[...d,...bc]:d;for(const ye of tte(_e,f))ie.set(ye.key,ye.value);return[...ie].map(([ye,Pe])=>({key:ye,value:Pe}))}async function kn(){if(!(!u||B||C)){j(null),L(!0);try{await u(!l)}catch(ie){ge.current&&j(`更新飞书配置失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{ge.current&&L(!1)}}}async function Fe(){var _e;if(!i||B)return;if(vt!=="public"&&!((_e=p==null?void 0:p.vpcId)!=null&&_e.trim())){j("使用 VPC 网络时,请填写 VPC ID。");return}const ie=Jk(d,f);if(ie){const ye=d.find(Pe=>Pe.key===ie.key);j(`请返回配置页填写 ${(ye==null?void 0:ye.comment)||(ye==null?void 0:ye.key)}(${ye==null?void 0:ye.key})。`);return}if(l){const ye=Jk(bc,f);if(ye){const Pe=bc.find($e=>$e.key===ye.key);j(`启用飞书后,请填写${(Pe==null?void 0:Pe.comment)||(Pe==null?void 0:Pe.key)}。`);return}}U(!0)}async function rt(){if(!i||B)return;U(!1);const ie=Ht();ge.current&&(j(null),H(null),D({}),ee(null),Y(!0));const _e=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let ye="生成中…";const Pe=Date.now();o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"running",label:"准备部署"});try{const $e=await i(e,qe=>{var gt;qe.runtimeName&&(ye=qe.runtimeName),ge.current&&(D(It=>({...It,[qe.phase]:qe})),ee(qe.phase)),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"running",label:((gt=Pf.find(It=>It.phase===qe.phase))==null?void 0:gt.label)??qe.phase,message:qe.message,pct:qe.pct})},l?{taskId:_e,im:{feishu:{enabled:!0}},envs:ie}:{taskId:_e,envs:ie});ge.current&&(H($e),ee(null)),o==null||o({id:_e,runtimeName:$e.agentName||ye,runtimeId:$e.runtimeId,region:$e.region||y,startedAt:Pe,status:"success",label:"部署完成"})}catch($e){const qe=$e instanceof Error?$e.message:String($e);if($e instanceof DOMException&&$e.name==="AbortError"){ge.current&&(j(null),ee(null)),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"});return}ge.current&&j(qe),o==null||o({id:_e,runtimeName:ye,region:y,startedAt:Pe,status:"error",label:"部署失败",message:qe,retry:Fe})}finally{ge.current&&Y(!1)}}function tt(){U(!1)}async function mt(){if(!(!S||re)){de(!0),j(null);try{const{addConnection:ie,addRuntimeConnection:_e,remoteAppId:ye,loadConnections:Pe}=await tl(async()=>{const{addConnection:gt,addRuntimeConnection:It,remoteAppId:Rt,loadConnections:gn}=await Promise.resolve().then(()=>Lk);return{addConnection:gt,addRuntimeConnection:It,remoteAppId:Rt,loadConnections:gn}},void 0),{probeRuntimeApps:$e}=await tl(async()=>{const{probeRuntimeApps:gt}=await Promise.resolve().then(()=>sU);return{probeRuntimeApps:gt}},void 0);let qe;if(S.runtimeId){const gt=S.region??"cn-beijing",It=await $e(S.runtimeId,gt)??[];qe=_e(S.runtimeId,S.agentName,gt,It,It.length>0?{[It[0]]:S.agentName}:void 0)}else qe=await ie(S.agentName,S.url,S.apikey,"");if(qe.apps.length===0)j("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const gt={[qe.apps[0]]:S.agentName},It={...qe,appLabels:{...qe.appLabels??{},...gt}},gn=Pe().map(zt=>zt.id===qe.id?It:zt);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(gn));const{registerConnections:yn}=await tl(async()=>{const{registerConnections:zt}=await Promise.resolve().then(()=>Lk);return{registerConnections:zt}},void 0);if(yn(gn),a){const zt=ye(qe.id,qe.apps[0]);a(zt,S.agentName)}else alert(`🎉 Agent "${S.agentName}" 已添加到左上角下拉列表!`)}}catch(ie){j(`添加 Agent 失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{de(!1)}}}function ue(){const ie=ste(e.files),_e=URL.createObjectURL(ie),ye=document.createElement("a");ye.href=_e,ye.download=`${e.name||"project"}.zip`,document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(_e)}function Oe(ie,_e,ye){return bte(ie).map(Pe=>{const $e=ye?`${ye}/${Pe.name}`:Pe.name,qe=Pe.path!==void 0,gt={paddingLeft:8+_e*14};if(qe){const Rt=Pe.path===_;return c.jsxs("button",{type:"button",className:`pp-row pp-file${Rt?" pp-active":""}`,style:gt,onClick:()=>k(Pe.path),title:Pe.path,children:[c.jsx(yF,{className:"pp-ic"}),c.jsx("span",{className:"pp-label",children:Pe.name})]},$e)}const It=T.has($e);return c.jsxs("div",{children:[c.jsxs("button",{type:"button",className:"pp-row pp-folder",style:gt,onClick:()=>X($e),children:[c.jsx(lr,{className:`pp-ic pp-chevron${It?"":" pp-open"}`}),c.jsx(CI,{className:"pp-ic"}),c.jsx("span",{className:"pp-label",children:Pe.name})]}),!It&&Oe(Pe,_e+1,$e)]},$e)})}return c.jsxs("div",{className:`pp-root${i?" is-deploy":""}`,children:[i&&c.jsx(xte,{left:c.jsxs("div",{className:"pp-toolbar-left",children:[g&&c.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:g,children:[c.jsx(EI,{className:"pp-ic"}),"返回配置"]}),c.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",n||e.name||"未命名 Agent",r&&r>1?` 等 ${r} 个智能体`:""]})]}),right:null}),c.jsxs("div",{className:"pp-body",children:[i&&c.jsxs("section",{className:"pp-topology-pane","aria-label":"Agent 拓扑",children:[c.jsxs("div",{className:"pp-topology-head",children:[c.jsxs("div",{children:[c.jsx("div",{className:"pp-topology-title",children:"Agent 拓扑"}),c.jsxs("div",{className:"pp-topology-count",children:[r??1," 个智能体"]})]}),b&&s&&c.jsx(cte,{project:e,onChange:s})]}),c.jsxs("div",{className:"pp-topology-scroll",children:[c.jsx("div",{className:"pp-topology-tree",children:c.jsx(u3,{agent:Le,depth:0,inspectedId:ve,onHover:ce,onFocus:Ee})}),Ue&&Ie&&ae&&c.jsxs("div",{className:"pp-agent-inspector","aria-live":"polite",children:[c.jsxs("div",{className:"pp-agent-inspector-head",children:[c.jsx("span",{className:"pp-agent-inspector-icon",children:c.jsx(ae,{"aria-hidden":"true"})}),c.jsxs("div",{children:[c.jsx("strong",{children:Ue.name}),c.jsx("span",{children:Ie.label})]})]}),Ue.description&&c.jsx("p",{children:Ue.description}),c.jsxs("dl",{className:"pp-agent-config-grid",children:[c.jsx("dt",{children:"模型"}),c.jsx("dd",{children:Ue.model}),c.jsx("dt",{children:"工具"}),c.jsx("dd",{children:Ue.tools}),c.jsx("dt",{children:"技能"}),c.jsx("dd",{children:Ue.skills}),c.jsx("dt",{children:"知识库"}),c.jsx("dd",{children:Ue.knowledgebase}),c.jsx("dt",{children:"短期记忆"}),c.jsx("dd",{children:Ue.shortTerm}),c.jsx("dt",{children:"长期记忆"}),c.jsx("dd",{children:Ue.longTerm}),c.jsx("dt",{children:"观测"}),c.jsx("dd",{children:Ue.tracing})]})]})]}),c.jsxs("div",{className:"pp-topology-actions",children:[E&&c.jsxs("button",{type:"button",className:"pp-secondary",onClick:E,children:[c.jsx(pF,{className:"pp-ic"}),"导出配置"]}),e.files.length>0&&c.jsxs("button",{type:"button",className:"pp-secondary",onClick:ue,children:[c.jsx(TE,{className:"pp-ic"}),"下载源码"]})]})]}),c.jsxs("div",{className:"pp-files-area",children:[c.jsxs("div",{className:"pp-sidebar",children:[c.jsxs("div",{className:"pp-sidebar-head",children:[c.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),b&&c.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{R(!0),M("")},children:c.jsx(mF,{className:"pp-ic"})})]}),c.jsxs("div",{className:"pp-tree",children:[N&&c.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:I,onChange:ie=>M(ie.target.value),onBlur:Re,onKeyDown:ie=>{ie.key==="Enter"&&Re(),ie.key==="Escape"&&(R(!1),M(""))}}),e.files.length===0&&!N?c.jsx("div",{className:"pp-empty",children:"暂无文件"}):Oe(wt,0,"")]})]}),c.jsxs("div",{className:"pp-main",children:[c.jsxs("div",{className:"pp-main-head",children:[c.jsx("span",{className:"pp-path",title:we==null?void 0:we.path,children:(we==null?void 0:we.path)??"未选择文件"}),c.jsx("div",{className:"pp-actions",children:b&&we&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:ut,children:c.jsx(MF,{className:"pp-ic"})}),c.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:We,children:c.jsx(Fl,{className:"pp-ic"})})]})})]}),c.jsx("div",{className:"pp-content",children:we==null?c.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):b?c.jsx("div",{className:"pp-codemirror",children:c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:c.jsx(dte,{value:we.content,path:we.path,onChange:ke})})}):c.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:mte(we.content,we.path)}})})]})]}),i&&c.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[c.jsx("div",{className:"pp-config-head",children:c.jsx("div",{className:"pp-config-title",children:"部署配置"})}),c.jsxs("div",{className:"pp-config-scroll",children:[c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"发布区域"}),c.jsxs("select",{className:"pp-config-select",value:y,onChange:ie=>w==null?void 0:w(ie.target.value),"aria-label":"部署区域",disabled:B||!w,children:[c.jsx("option",{value:"cn-beijing",children:"华北 2(北京)"}),c.jsx("option",{value:"cn-shanghai",children:"华东 2(上海)"})]})]}),c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"消息渠道"}),c.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:`pp-channel${l?" is-on":""}`,onClick:()=>void kn(),disabled:B||C||!u,children:[c.jsx("span",{className:"pp-channel-title",children:C?"飞书(正在更新代码…)":"飞书"}),c.jsx("span",{className:"pp-switch","aria-hidden":!0,children:c.jsx("span",{})})]}),l&&c.jsx("div",{className:"pp-channel-fields",children:bc.map(ie=>c.jsxs("label",{children:[c.jsxs("span",{children:[ie.comment||ie.key,ie.required&&c.jsx("small",{children:"必填"})]}),c.jsx("code",{children:ie.key}),c.jsx("input",{type:ie.key.includes("SECRET")?"password":"text",value:f[ie.key]??"",placeholder:ie.placeholder,disabled:B||!h,autoComplete:"off",onChange:_e=>h==null?void 0:h(ie.key,_e.currentTarget.value)})]},ie.key))})]}),c.jsxs("section",{className:"pp-config-section",children:[c.jsx("div",{className:"pp-config-label",children:"网络"}),c.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ie=>c.jsx("button",{type:"button",role:"radio","aria-checked":vt===ie,className:vt===ie?"is-on":"",onClick:()=>Ge(ie),disabled:B||!m,children:ie==="public"?"公网":ie==="private"?"VPC":"公网 + VPC"},ie))}),vt!=="public"&&c.jsxs("div",{className:"pp-network-fields",children:[c.jsxs("label",{children:[c.jsx("span",{children:"VPC ID"}),c.jsx("input",{value:(p==null?void 0:p.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:B,onChange:ie=>Et({vpcId:ie.target.value})})]}),c.jsxs("label",{children:[c.jsxs("span",{children:["子网 ID ",c.jsx("small",{children:"可选,多个用逗号分隔"})]}),c.jsx("input",{value:(p==null?void 0:p.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:B,onChange:ie=>Et({subnetIds:ie.target.value})})]}),c.jsxs("label",{className:"pp-network-check",children:[c.jsx("input",{type:"checkbox",checked:!!(p!=null&&p.enableSharedInternetAccess),disabled:B,onChange:ie=>Et({enableSharedInternetAccess:ie.target.checked})}),"VPC 内共享公网出口"]})]})]}),c.jsxs("section",{className:"pp-config-section pp-env-section",children:[c.jsxs("div",{className:"pp-env-head",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"pp-config-label",children:["环境变量",c.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[K," 项"]})]}),c.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),c.jsx("button",{type:"button",className:"pp-icon-btn",title:oe?"隐藏值":"显示值",onClick:()=>he(ie=>!ie),children:oe?c.jsx(hF,{className:"pp-ic"}):c.jsx(NI,{className:"pp-ic"})})]}),c.jsxs("button",{type:"button",className:"pp-env-add",onClick:Ct,disabled:B,children:[c.jsx(ms,{className:"pp-ic"}),"添加变量"]}),(ct.length>0||G.length>0)&&c.jsxs("div",{className:"pp-env-table",children:[ct.length>0&&c.jsxs("div",{className:"pp-env-group",children:[c.jsxs("div",{className:"pp-env-group-head",children:[c.jsx("span",{children:"组件自动生成"}),c.jsxs("small",{children:[ct.length," 项"]})]}),ct.map(ie=>{const _e=ie.key.startsWith("ENABLE_");return c.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[c.jsx("input",{className:"pp-env-key-fixed",value:ie.key,readOnly:!0,disabled:B,"aria-label":`${ie.key} 环境变量名`}),c.jsx("input",{type:_e||oe?"text":"password",value:ie.value,placeholder:ie.required?"必填,尚未填写":"可选,尚未填写",readOnly:_e,disabled:B||!_e&&!h,autoComplete:"off","aria-label":`${ie.key} 环境变量值`,onChange:ye=>h==null?void 0:h(ie.key,ye.currentTarget.value)}),c.jsx("span",{className:"pp-env-source",children:_e?"自动":"同步"})]},ie.key)})]}),G.length>0&&c.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[c.jsx("span",{children:"自定义变量"}),c.jsxs("small",{children:[G.length," 项"]})]}),G.map(ie=>c.jsxs("div",{className:"pp-env-row",children:[c.jsx("input",{value:ie.key,placeholder:"名称",disabled:B,autoComplete:"off",onChange:_e=>ot(ie.id,{key:_e.currentTarget.value})}),c.jsx("input",{type:oe?"text":"password",value:ie.value,placeholder:"值",disabled:B,autoComplete:"off",onChange:_e=>ot(ie.id,{value:_e.currentTarget.value})}),c.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:B,onClick:()=>Zt(ie.id),children:c.jsx(Xr,{className:"pp-ic"})})]},ie.id))]})]}),(B||S||Object.keys(V).length>0)&&c.jsxs("section",{className:"pp-config-section pp-progress-section",children:[c.jsx("div",{className:"pp-config-label",children:"部署进度"}),c.jsx("ol",{className:"pp-steps",children:Pf.map((ie,_e)=>{const ye=ne?Pf.findIndex(gt=>gt.phase===ne):-1,Pe=!!O&&(ye===-1?_e===0:_e===ye);let $e;S?$e="done":Pe?$e="failed":ye===-1?$e=B?"active":"pending":_eie.phase===ne))==null?void 0:an.label)??ne}阶段):`:""}${O}`,onRetry:Fe}),S&&c.jsxs("section",{className:"pp-deploy-result",children:[c.jsx("div",{className:"pp-deploy-result-header",children:"部署成功"}),c.jsxs("div",{className:"pp-deploy-result-body",children:[S.region&&c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"区域"}),c.jsx("code",{children:S.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"Agent 名称"}),c.jsx("code",{children:S.agentName})]}),c.jsxs("div",{className:"pp-deploy-result-field",children:[c.jsx("label",{children:"API 端点"}),c.jsx("code",{className:"pp-deploy-result-url",children:S.url})]})]}),c.jsxs("div",{className:"pp-deploy-result-actions",children:[c.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:mt,disabled:re,children:[re?c.jsx(bt,{className:"pp-ic spin"}):c.jsx(LI,{className:"pp-ic"}),re?"连接中…":"立即对话"]}),S.consoleUrl&&c.jsxs("a",{href:S.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[c.jsx(kE,{className:"pp-ic"}),"控制台"]})]})]})]}),c.jsx("div",{className:"pp-config-actions",children:c.jsxs("button",{type:"button",className:"pp-deploy",onClick:Fe,disabled:B||C,children:[B?c.jsx(bt,{className:"pp-ic spin"}):O?c.jsx(DI,{className:"pp-ic"}):c.jsx(ute,{className:"pp-ic"}),B?"部署中…":O?"重试部署":"部署"]})})]})]}),c.jsx(fte,{open:P,onCancel:tt,onConfirm:()=>void rt()})]})}const sN="dogfooding",y0="dogfooding",b0="dogfooding_b";let wte=0;const E0=()=>++wte;function iN(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function vte(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function aN(e){const t=[],n=vte(e);t.push(n);const r=n.indexOf("{"),s=n.lastIndexOf("}");r>=0&&s>r&&t.push(n.slice(r,s+1));for(const i of t)try{const a=JSON.parse(i);if(a&&typeof a=="object"&&(typeof a.name=="string"||typeof a.instruction=="string"))return await fp(s3(a))}catch{}return null}function _te({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=v.useState([{id:E0(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[o,l]=v.useState(""),[u,d]=v.useState(!1),[f,h]=v.useState(null),[p,m]=v.useState(null),[y,w]=v.useState(!1),[g,E]=v.useState(null),[b,_]=v.useState(null),[k,T]=v.useState(!1),[A,N]=v.useState(!1),[R,I]=v.useState({}),M=v.useRef(null),B=v.useRef(null),Y=v.useRef(null),P=v.useRef(null),U=v.useRef(null);v.useEffect(()=>{const ee=P.current;ee&&ee.scrollTo({top:ee.scrollHeight,behavior:"smooth"})},[i,u]),v.useEffect(()=>{const ee=U.current;ee&&(ee.style.height="auto",ee.style.height=Math.min(ee.scrollHeight,160)+"px")},[o]);const C=ee=>a(re=>[...re,{id:E0(),role:"assistant",text:ee}]);async function L(){if(M.current)return M.current;const ee=await up(sN,e);return M.current=ee,ee}async function O(ee,re){if(re.current)return re.current;const de=await up(ee,e);return re.current=de,de}async function j(ee,re){if(!R[ee])try{const de=await hd(re);I(G=>({...G,[ee]:de.model||re}))}catch{I(de=>({...de,[ee]:re}))}}async function S(ee,re,de){const G=await O(ee,re);let W=Qs();for await(const he of Mu({appName:ee,userId:e,sessionId:G,text:de}))W=ml(W,he);const oe=iN(W).trim();return{project:await aN(oe),finalText:oe}}const H=async(ee,re,de)=>LE(ee.name,ee.files,{region:"cn-beijing",projectName:"default"},{...de,onStage:re}),V=async()=>{const ee=o.trim();if(!(!ee||u)){if(a(re=>[...re,{id:E0(),role:"user",text:ee}]),l(""),h(null),d(!0),y){E(null),_(null),T(!0),N(!0),j("a",y0),j("b",b0);const re=S(y0,B,ee).then(({project:G})=>(E(G),G)).catch(G=>{const W=G instanceof Error?G.message:String(G);return h(W),null}).finally(()=>T(!1)),de=S(b0,Y,ee).then(({project:G})=>(_(G),G)).catch(G=>{const W=G instanceof Error?G.message:String(G);return h(W),null}).finally(()=>N(!1));try{const[G,W]=await Promise.all([re,de]),oe=[G?`方案 A:${G.name}`:null,W?`方案 B:${W.name}`:null].filter(Boolean);oe.length?C(`已生成两个方案(${oe.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const re=await L();let de=Qs();for await(const oe of Mu({appName:sN,userId:e,sessionId:re,text:ee}))de=ml(de,oe);const G=iN(de).trim(),W=await aN(G);W?(m(W),C(`已生成项目:${W.name}(${W.files.length} 个文件),可在右侧预览和编辑。`)):C(G||"(助手没有返回内容,请再描述一下你的需求。)")}catch(re){const de=re instanceof Error?re.message:String(re);h(de),C(`抱歉,调用智能构建助手失败:${de}`)}finally{d(!1)}}},D=ee=>{const re=ee==="a"?g:b;if(!re)return;m(re),w(!1),E(null),_(null),T(!1),N(!1);const de=ee==="a"?"A":"B",G=ee==="a"?R.a:R.b;C(`已采用方案 ${de}(${G??(ee==="a"?y0:b0)}),可继续编辑。`)},ne=ee=>{ee.key==="Enter"&&!ee.shiftKey&&!ee.nativeEvent.isComposing&&(ee.preventDefault(),V())};return c.jsx("div",{className:"ic-root",children:c.jsxs("div",{className:"ic-body",children:[c.jsxs("div",{className:"ic-chat",children:[c.jsxs("div",{className:"ic-transcript",ref:P,children:[c.jsx(Hi,{initial:!1,children:i.map(ee=>c.jsxs(Gt.div,{className:`ic-turn ic-turn--${ee.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[ee.role==="assistant"&&c.jsx("div",{className:"ic-avatar",children:c.jsx(Ha,{className:"ic-avatar-icon"})}),c.jsx("div",{className:"ic-bubble",children:ee.role==="assistant"?c.jsx(_d,{text:ee.text}):ee.text})]},ee.id))}),u&&c.jsxs(Gt.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[c.jsx("div",{className:"ic-avatar",children:c.jsx(Ha,{className:"ic-avatar-icon"})}),c.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[c.jsx("span",{className:"ic-dot"}),c.jsx("span",{className:"ic-dot"}),c.jsx("span",{className:"ic-dot"})]})]})]}),f&&c.jsxs("div",{className:"ic-error",children:[c.jsx(TI,{className:"ic-error-icon"}),f]}),c.jsxs("div",{className:"ic-composer",children:[c.jsxs("div",{className:"ic-composer-box",children:[c.jsx("textarea",{ref:U,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:o,onChange:ee=>l(ee.target.value),onKeyDown:ne,disabled:u}),c.jsx("button",{className:"ic-send",onClick:()=>void V(),disabled:!o.trim()||u,title:"发送 (Enter)",children:c.jsx(jF,{className:"ic-send-icon"})})]}),c.jsxs("div",{className:"ic-composer-foot",children:[c.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[c.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:y,disabled:u,onChange:ee=>w(ee.target.checked)}),c.jsx("span",{className:"ic-ab-track",children:c.jsx("span",{className:"ic-ab-thumb"})}),c.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),c.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),c.jsx("aside",{className:"ic-preview",children:y?c.jsxs("div",{className:"ic-compare",children:[c.jsx(oN,{side:"a",project:g,loading:k,model:R.a,onAdopt:()=>D("a")}),c.jsx("div",{className:"ic-compare-divider"}),c.jsx(oN,{side:"b",project:b,loading:A,model:R.b,onAdopt:()=>D("b")})]}):p?c.jsx(Mx,{project:p,onChange:m,onDeploy:H,onAgentAdded:r,onDeploymentTaskChange:s}):c.jsxs("div",{className:"ic-preview-empty",children:[c.jsxs("div",{className:"ic-preview-empty-icon",children:[c.jsx(bF,{className:"ic-preview-empty-glyph"}),c.jsx(za,{className:"ic-preview-empty-spark"})]}),c.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),c.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function oN({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return c.jsxs("div",{className:"ic-pane",children:[c.jsxs("div",{className:"ic-pane-head",children:[c.jsxs("div",{className:"ic-pane-title",children:[c.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&c.jsx("span",{className:"ic-pane-model",children:r})]}),c.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),c.jsx("div",{className:"ic-pane-body",children:n?c.jsxs("div",{className:"ic-pane-loading",children:[c.jsx(bt,{className:"ic-pane-spinner"}),c.jsx("span",{children:"正在生成…"})]}):t?c.jsx(Mx,{project:t}):c.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const Tte=/^[A-Za-z_][A-Za-z0-9_]*$/;function nl(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":Tte.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function d3(e){const t=new Set,n=new Set,r=s=>{nl(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function Zr(e){return e.trimEnd().replace(/[。.]+$/,"")}function ua(e,t){return e[t]|e[t+1]<<8}function Ec(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function kte(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function Nte(e){let n=-1;for(let o=e.length-22;o>=0&&o>e.length-65557;o--)if(Ec(e,o)===101010256){n=o;break}if(n<0)throw new Error("无效的 zip:找不到 EOCD");const r=ua(e,n+10);let s=Ec(e,n+16);const i=new TextDecoder("utf-8"),a=[];for(let o=0;o{var o;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((o=a.Metadata)==null?void 0:o.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function Cte({selected:e,onChange:t}){const[n,r]=v.useState(""),[s,i]=v.useState([]),[a,o]=v.useState(!1),[l,u]=v.useState(null),[d,f]=v.useState(!1),h=y=>e.some(w=>w.source==="skillhub"&&w.slug===y),p=y=>{y.slug&&(h(y.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===y.slug))):t([...e,{source:"skillhub",slug:y.slug,name:y.name,folder:y.slug.split("/").pop()||y.name,namespace:y.namespace||"public",description:y.description}]))},m=async y=>{o(!0),u(null),f(!0);try{const w=await Ate(y);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{o(!1)}};return v.useEffect(()=>{const y=n.trim();if(!y){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(y),300);return()=>clearTimeout(w)},[n]),c.jsxs("div",{className:"cw-skillhub",children:[c.jsxs("div",{className:"cw-skill-searchrow",children:[c.jsxs("div",{className:"cw-skill-searchbox",children:[c.jsx(e1,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),c.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:y=>r(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),n.trim()&&m(n))}})]}),c.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(e1,{className:"cw-i"}),"搜索"]})]}),l&&c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:l})]}),a&&s.length===0?c.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?c.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const w=h(y.slug||"");return c.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(y),"aria-pressed":w,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsx("span",{className:"cw-skill-result-name",children:y.name}),y.description&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(y.description)}),y.sourceRepo&&c.jsx("span",{className:"cw-skill-result-repo",children:y.sourceRepo})]})]},y.id||y.slug)})}):d&&!l?c.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&c.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const L1=/(^|\/)skill\.md$/i;class Vi extends Error{}function Ite(e,t){const n=(e??"").replace(/\r\n?/g,` `).split(` -`);if(!n.length||n[0].trim()!=="---")throw new Vi(`${t} 的 SKILL.md 必须以 YAML frontmatter (--- ... ---) 开头`);let r=-1;for(let o=1;o=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function Ote(e,t){if(!e)throw new Vi(`${t} 的 SKILL.md 缺少必填的 name frontmatter`);if(e.length>64)throw new Vi(`${t} 的 name 长度超过 64 个字符`);if(!/^[a-z0-9-]+$/.test(e))throw new Vi(`${t} 的 name 必须匹配 [a-z0-9-]+(小写字母、数字、短横线)`)}function Lte(e,t){if(!e)throw new Vi(`${t} 的 SKILL.md 缺少必填的 description frontmatter`);if(e.length>1024)throw new Vi(`${t} 的 description 长度超过 1024 个字符`);if(/<[^>]+>/.test(e))throw new Vi(`${t} 的 description 不能包含 XML 标签`)}function f3(e){const t=e.map(r=>({path:r.path.replace(/\\/g,"/").replace(/^\.\//,""),text:r.text})).filter(r=>r.path.length>0&&!r.path.endsWith("/")),n=new Set(t.map(r=>r.path.split("/")[0]));if(n.size===1&&t.every(r=>r.path.includes("/"))){const r=[...n][0]+"/";return t.map(s=>({path:s.path.slice(r.length),text:s.text}))}return t}function Mte(e){const t=new Map,n=new Set;for(const r of e)if(M1.test("/"+r.path)){const s=r.path.split("/");n.add(s.slice(0,-1).join("/"))}for(const r of e){const s=r.path.split("/");let i="";for(let u=s.length-1;u>=0;u--){const d=s.slice(0,u).join("/");if(n.has(d)){i=d;break}}const a=M1.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const o=i?r.path.slice(i.length+1):r.path,l=t.get(i)||[];l.push({path:o,text:r.text}),t.set(i,l)}return t}function Dte(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(l=>M1.test("/"+l.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};let i;try{i=Ite(s.text,r)}catch(l){return{hit:null,error:l instanceof Error?l.message:String(l)}}const a=i.name,o=[];for(const l of t){if(l.path.split("/").some(f=>f===".."))return{hit:null,error:`${r} 包含非法路径(..):${l.path}`};const d=`skills/${a}/${l.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${r} 包含非法路径:${l.path}`};o.push({path:d,content:l.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:i.name,description:i.description,folder:a,localFiles:o},error:null}}async function Pte(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await kte(t)).map(s=>({path:s.name,text:s.text}));return h3(f3(r),e.name)}async function jte(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function Fte(e){const t=e.createReader(),n=[];for(;;){const r=await new Promise((s,i)=>t.readEntries(s,i));if(r.length===0)return n;n.push(...r)}}async function p3(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await Bte(e),path:n}];if(!e.isDirectory)return[];const r=await Fte(e);return(await Promise.all(r.map(s=>p3(s,n)))).flat()}function Ute({selected:e,onChange:t}){const[n,r]=v.useState([]),[s,i]=v.useState([]),[a,o]=v.useState(!1),[l,u]=v.useState(!1),d=v.useRef(0),f=b=>e.some(_=>_.source==="local"&&_.folder===b),h=b=>{b.localFiles&&(f(b.folder||b.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(b.folder||b.name)))):t([...e,{source:"local",folder:b.folder||b.name,name:b.name,description:b.description,localFiles:b.localFiles}]))},p=v.useRef([]),m=v.useRef(e);v.useEffect(()=>{p.current=s},[s]),v.useEffect(()=>{m.current=e},[e]);const y=b=>{const _=new Set([...p.current.map(k=>k.folder||k.name),...m.current.filter(k=>k.source==="local").map(k=>k.folder)]),N=[],T=[];for(const k of b.hits){const R=k.folder||k.name;if(_.has(R)){N.push(k.name);continue}_.add(R),T.push(k)}i(k=>[...k,...T]);const A=[...b.errors];if(N.length>0&&A.push(`已跳过重复技能:${N.join("、")}`),r(A),T.length===1&&b.errors.length===0&&N.length===0){const k=T[0];k.localFiles&&t([...m.current,{source:"local",folder:k.folder||k.name,name:k.name,description:k.description,localFiles:k.localFiles}])}},w=b=>{b.preventDefault(),d.current+=1,u(!0)},g=b=>{b.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},E=async b=>{if(b.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(b.dataTransfer.items).map(N=>{var T;return(T=N.webkitGetAsEntry)==null?void 0:T.call(N)}).filter(N=>N!==null);if(_.length===0){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}o(!0);try{const N=(await Promise.all(_.map(k=>p3(k)))).flat(),T=_.some(k=>k.isDirectory);if(!T&&N.length===1&&N[0].file.name.toLowerCase().endsWith(".zip")){y(await Pte(N[0].file));return}if(!T){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const A=new Map(N.map(({file:k,path:R})=>[k,R]));y(await jte(N.map(({file:k})=>k),A))}catch(N){r([`读取失败:${N instanceof Error?N.message:String(N)}`])}finally{o(!1)}};return c.jsxs("div",{className:"cw-local",children:[c.jsxs("div",{className:`cw-local-dropzone ${l?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:b=>b.preventDefault(),onDragLeave:g,onDrop:b=>void E(b),children:[c.jsx(SE,{className:"cw-local-drop-icon","aria-hidden":!0}),c.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),c.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md(含 name / description frontmatter)。支持包含多个技能的目录。"}),a&&c.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:n.join(";")})]}),s.length>0&&c.jsx("div",{className:"cw-skill-results",children:s.map(b=>{var N;const _=f(b.folder||b.name);return c.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(b),"aria-pressed":_,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(b.description)}),c.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((N=b.localFiles)==null?void 0:N.length)??0," 个文件"]})]})]},b.id)})})]})}function $te({selected:e,onChange:t}){const[n,r]=v.useState([]),[s,i]=v.useState([]),[a,o]=v.useState(""),[l,u]=v.useState(!0),[d,f]=v.useState(!1),[h,p]=v.useState(null);v.useEffect(()=>{let g=!1;return(async()=>{u(!0),p(null);try{const E=await hU();g||(r(E),E.length>0&&o(E[0].id))}catch(E){g||p(E instanceof Error?E.message:"加载失败")}finally{g||u(!1)}})(),()=>{g=!0}},[]),v.useEffect(()=>{if(!a){i([]);return}const g=n.find(b=>b.id===a);let E=!1;return(async()=>{f(!0),p(null);try{const b=await mU(a,g==null?void 0:g.region);E||i(b)}catch(b){E||p(b instanceof Error?b.message:"加载失败")}finally{E||f(!1)}})(),()=>{E=!0}},[a,n]);const m=n.find(g=>g.id===a),y=(g,E)=>e.some(b=>b.source==="skillspace"&&b.skillId===g&&(b.version||"")===E),w=g=>{if(m)if(y(g.skillId,g.version))t(e.filter(E=>!(E.source==="skillspace"&&E.skillId===g.skillId&&(E.version||"")===g.version)));else{const E=bU(m,g);t([...e,{source:"skillspace",folder:E.folder||g.skillName,name:E.name,description:E.description,skillSpaceId:E.skillSpaceId,skillSpaceName:E.skillSpaceName,skillSpaceRegion:E.skillSpaceRegion,skillId:E.skillId,version:E.version}])}};return c.jsx("div",{className:"cw-skillspace",children:l?c.jsxs("p",{className:"cw-empty-line",children:[c.jsx(bt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:h})]}):n.length===0?c.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"cw-skillspace-header",children:[c.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:g=>o(g.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(g=>c.jsxs("option",{value:g.id,children:[g.name||g.id,g.region?` [${g.region}]`:"",g.description?` — ${Zr(g.description)}`:""]},g.id))}),m&&c.jsx("a",{href:EU(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:c.jsx(kE,{className:"cw-i cw-i-sm"})})]}),d?c.jsxs("p",{className:"cw-empty-line",children:[c.jsx(bt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?c.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):c.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const E=y(g.skillId,g.version);return c.jsxs("button",{type:"button",className:`cw-skill-result ${E?"is-on":""}`,onClick:()=>w(g),"aria-pressed":E,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:E?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsxs("span",{className:"cw-skill-result-name",children:[g.skillName,g.version&&c.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",g.version]})]}),g.skillDescription&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(g.skillDescription)}),c.jsxs("span",{className:"cw-skill-result-repo",children:[c.jsx(dF,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${g.skillId}/${g.version}`)})})]})})}async function Hte(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ds(void 0,dd)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 AgentKit 智能体中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit 智能体中心");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function zte(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await Hte(`/web/a2a-spaces?${t.toString()}`)).items||[]}const Vte=v.lazy(()=>tl(()=>import("./MarkdownPromptEditor-CwT7JlSU.js"),__vite__mapDeps([0,1])));function Kte(e,t,n="text/plain"){const r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),s=document.createElement("a");s.href=r,s.download=e,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(r)}const lk=[{id:"type",label:"类型",hint:"选择 Agent 类型",icon:BF,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:Bl,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:NI},{id:"tools",label:"工具",hint:"可调用的能力",icon:CE},{id:"skills",label:"技能",hint:"声明式技能",icon:za},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:lh},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:OI},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:_I},{id:"review",label:"完成",hint:"预览并创建",icon:PF}];function Yte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m7.2 15.8 7.9-7.9a2 2 0 0 1 2.8 0l1.2 1.2a2 2 0 0 1 0 2.8l-7 7H8.7l-1.5-1.5a1.15 1.15 0 0 1 0-1.6Z"}),c.jsx("path",{d:"m12.7 10.3 4 4"}),c.jsx("path",{d:"M6.3 19h12.4"}),c.jsx("path",{d:"m5.5 8.2.5-1.4 1.4-.5L6 5.8l-.5-1.4L5 5.8l-1.4.5 1.4.5.5 1.4Z"})]})}function Wte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"3.25",y:"4.25",width:"17.5",height:"15.5",rx:"2.75"}),c.jsx("path",{d:"M3.75 8.75h16.5"}),c.jsx("circle",{cx:"6.35",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"8.85",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none",opacity:"0.45"}),c.jsx("path",{d:"M6 14h2.2l1.35-2.8 2.1 5.5 1.7-3.1H18"})]})}function qte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),c.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),c.jsx("path",{d:"M3 10v4",opacity:"0.45"}),c.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}const w0=4,Gte={llm:"LLM 智能体",sequential:"顺序型智能体",parallel:"并行型智能体",loop:"循环型智能体",a2a:"远程智能体"},ck={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},m3="REGISTRY_SPACE_ID",Xte=QM.filter(e=>e.key!==m3);function g3(e,t){var r,s,i;if(!(e!=null&&e.enabled))return{};const n={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(n.REGISTRY_TOP_K=((r=e.registryTopK)==null?void 0:r.trim())||hs.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||hs.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||hs.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function uk({items:e,selected:t,onToggle:n,scrollRows:r}){return c.jsx("div",{className:`cw-checklist ${r?"cw-checklist-tools":""}`,style:r?{"--cw-checklist-max-height":`${r*65+(r-1)*8}px`}:void 0,children:e.map(s=>{const i=t.includes(s.id);return c.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[c.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&c.jsx(Bs,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-check-text",children:[c.jsx("span",{className:"cw-check-title",children:s.label}),c.jsx("span",{className:"cw-check-desc",children:Zr(s.desc)})]})]},s.id)})})}function v0({options:e,value:t,onChange:n}){return c.jsx("div",{className:"cw-segmented",children:e.map(r=>{var i;const s=(t??((i=e[0])==null?void 0:i.id))===r.id;return c.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Zr(r.desc),children:[c.jsx("span",{className:"cw-seg-title",children:r.label}),c.jsx("span",{className:"cw-seg-desc",children:Zr(r.desc)})]},r.id)})})}function Qte(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function xc({env:e,values:t,onChange:n}){return e.length===0?c.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):c.jsx("div",{className:"cw-env-fields",children:e.map(r=>c.jsxs("label",{className:"cw-env-field",children:[c.jsxs("span",{className:"cw-env-field-head",children:[c.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&c.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&c.jsx("code",{title:r.key,children:r.key})]}),c.jsx("input",{className:"cw-input",type:Qte(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function dk(e){return e.name.trim()||"未命名智能体中心"}function Zte({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||hs.region,[i,a]=v.useState([]),[o,l]=v.useState(!1),[u,d]=v.useState(null),[f,h]=v.useState(0),[p,m]=v.useState(!1),y=v.useRef(null);v.useEffect(()=>{let N=!1;return l(!0),d(null),zte({region:s}).then(T=>{N||a(T)}).catch(T=>{N||(a([]),d(T instanceof Error?T.message:"加载失败"))}).finally(()=>{N||l(!1)}),()=>{N=!0}},[s,f]);const w=!e||i.some(N=>N.id===e.trim()),g=i.find(N=>N.id===e.trim()),E=g?dk(g):e&&!w?"已选择的智能体中心":"请选择智能体中心",b=o&&i.length===0;v.useEffect(()=>{if(!p)return;const N=A=>{const k=A.target;k instanceof Node&&y.current&&!y.current.contains(k)&&m(!1)},T=A=>{A.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",T)}},[p]);const _=N=>{r(N),m(!1)};return c.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[c.jsxs("div",{className:"cw-a2a-space-row",children:[c.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[c.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:b,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>m(N=>!N),children:[c.jsx("span",{children:E}),c.jsx(Xn,{className:"cw-a2a-space-trigger-icon","aria-hidden":!0})]}),p&&c.jsxs("div",{className:"cw-a2a-space-menu",role:"listbox","aria-label":"AgentKit 智能体中心",children:[c.jsx("button",{type:"button",role:"option","aria-selected":!e,className:`cw-a2a-space-option ${e?"":"is-selected"}`,onClick:()=>_(""),children:"请选择智能体中心"}),e&&!w&&c.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>_(e),children:"已选择的智能体中心"}),i.map(N=>{const T=dk(N),A=N.id===e;return c.jsx("button",{type:"button",role:"option","aria-selected":A,className:`cw-a2a-space-option ${A?"is-selected":""}`,title:T,onClick:()=>_(N.id),children:T},N.id)})]})]}),c.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:o,onClick:()=>h(N=>N+1),children:o?c.jsx(bt,{className:"cw-i cw-i-sm cw-spin"}):c.jsx(dm,{className:"cw-i cw-i-sm"})})]}),u?c.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:u})]}):o?c.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[c.jsx(bt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?c.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):c.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function Jte({tools:e,onChange:t}){const n=(i,a)=>t(e.map((o,l)=>l===i?{...o,...a}:o)),r=i=>t(e.filter((a,o)=>o!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return c.jsxs("div",{className:"cw-mcp",children:[e.length>0&&c.jsx("div",{className:"cw-mcp-list",children:c.jsx(Hi,{initial:!1,children:e.map((i,a)=>c.jsxs(Gt.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[c.jsxs("div",{className:"cw-mcp-rowhead",children:[c.jsxs("div",{className:"cw-mcp-transport",children:[c.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${i.transport==="http"?"is-on":""}`,onClick:()=>n(a,{transport:"http"}),"aria-pressed":i.transport==="http",children:c.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),c.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${i.transport==="stdio"?"is-on":""}`,onClick:()=>n(a,{transport:"stdio"}),"aria-pressed":i.transport==="stdio",children:c.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),c.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:c.jsx(Fl,{className:"cw-i cw-i-sm"})})]}),c.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:o=>n(a,{name:o.target.value})}),i.transport==="http"?c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:o=>n(a,{url:o.target.value})}),c.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:o=>n(a,{authToken:o.target.value})})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:o=>n(a,{command:o.target.value})}),c.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:o=>n(a,{args:o.target.value.split(/\s+/).filter(Boolean)})}),c.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),c.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[c.jsx(ms,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&c.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function y3({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),c.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),c.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),c.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function ene({s:e,onRemove:t}){let n=za,r="火山 Find Skill 技能广场";return e.source==="local"?(n=SE,r="本地"):e.source==="skillspace"&&(n=y3,r="AgentKit Skills 中心"),c.jsxs(Gt.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[c.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:c.jsx(n,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-selected-skill-meta",children:[c.jsx("span",{className:"cw-selected-skill-name",children:e.name}),c.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Zr(e.description)}`:""]})]}),c.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:c.jsx(Xr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const _0=[{id:"local",label:"本地文件",icon:SE},{id:"skillspace",label:"AgentKit Skills 中心",icon:y3},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:um}];function tne({selected:e,onChange:t}){const[n,r]=v.useState("local"),[s,i]=v.useState(!1),a=_0.findIndex(l=>l.id===n),o=l=>t(e.filter(u=>T0(u)!==l));return v.useEffect(()=>{if(!s)return;const l=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[s]),c.jsxs("div",{className:"cw-skillspane",children:[c.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[c.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:c.jsx(ms,{className:"cw-i"})}),c.jsx("span",{children:"添加 Skill"})]}),e.length>0&&c.jsxs("div",{className:"cw-skill-selected",children:[c.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),c.jsx("div",{className:"cw-selected-skill-list",children:c.jsx(Hi,{initial:!1,children:e.map(l=>c.jsx(ene,{s:l,onRemove:()=>o(T0(l))},T0(l)))})})]}),c.jsx(Hi,{children:s&&c.jsx(Gt.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:l=>{l.target===l.currentTarget&&i(!1)},children:c.jsxs(Gt.div,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"cw-skill-dialog-title",initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-skill-dialog-head",children:[c.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),c.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:c.jsx(Xr,{className:"cw-i"})})]}),c.jsxs("div",{className:"cw-skill-dialog-body",children:[c.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${_0.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[c.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),_0.map(({id:l,label:u,icon:d})=>c.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${l}`,"aria-controls":"cw-skill-tabpanel","aria-selected":n===l,className:`cw-skill-pickertab ${n===l?"is-on":""}`,onClick:()=>r(l),children:[c.jsx(d,{className:"cw-i cw-i-sm"}),u]},l))]}),c.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&c.jsx(Cte,{selected:e,onChange:t}),n==="local"&&c.jsx(Ute,{selected:e,onChange:t}),n==="skillspace"&&c.jsx($te,{selected:e,onChange:t})]})]})]})})})]})}function T0(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function wc({checked:e,onChange:t,title:n,desc:r,icon:s}){return c.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[c.jsx("span",{className:"cw-toggle-icon",children:c.jsx(s,{className:"cw-i"})}),c.jsxs("span",{className:"cw-toggle-text",children:[c.jsx("span",{className:"cw-toggle-title",children:n}),c.jsx("span",{className:"cw-toggle-desc",children:Zr(r)})]}),c.jsx("span",{className:"cw-switch","aria-hidden":!0,children:c.jsx(Gt.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}const fk=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]);function nne(e,t){var r;let n=e;for(const s of t)if(n=(r=n.subAgents)==null?void 0:r[s],!n)return!1;return!0}function wh(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Rd(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Rd(i[r],s,n),{...e,subAgents:i}}function rne(e,t){return Rd(e,t,n=>({...n,subAgents:[...n.subAgents,Xi()]}))}function sne(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Rd(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}function ine(e,t,n,r){return Rd(e,t,s=>{const i=s.subAgents.slice(),[a]=i.splice(n,1);return i.splice(r,0,a),{...s,subAgents:i}})}const ane=e=>e==="sequential"||e==="loop",b3=e=>!Id(e.agentType),one=3;function E3(e,t,n=!1){var s;if(Id(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const r=nl(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":a3(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function x3(e,t,n=[]){const r=[],s=Id(e.agentType),i=E3(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),b3(e)&&e.subAgents.forEach((a,o)=>r.push(...x3(a,t,[...n,o]))),r}function w3(e){return 1+e.subAgents.reduce((t,n)=>t+w3(n),0)}function lne(e){const t=[],n={},r=i=>{var a,o,l,u;for(const d of i.builtinTools??[]){const f=Ox.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:QM}),Object.assign(n,g3(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((o=kp.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:o.env)??[]}),i.memory.longTerm&&t.push({env:((l=Sp.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:l.env)??[]}),i.knowledgebase&&t.push({env:((u=Ap.find(d=>d.id===(i.knowledgebaseBackend??"local")))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=Cp.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=o3(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function v3({root:e,path:t,selectedPath:n,duplicateNames:r,showErrors:s,validationPulse:i,onSelect:a,onChange:o,onClearRoot:l}){const u=wh(e,t),d=Lx(u.agentType),f=d.icon,h=t.length===0,p=fk(t,n),m=b3(u),y=m&&t.length{const A=rne(e,t),k=wh(A,t).subAgents.length-1;o(A,[...t,k])},g=()=>o(sne(e,t),t.slice(0,-1)),E=t.slice(0,-1),b=!h&&ane(wh(e,E).agentType),[_,N]=v.useState(!1),T=A=>{A.preventDefault(),A.stopPropagation(),N(!1);const k=A.dataTransfer.getData("application/x-agent-path");if(!k)return;let R;try{R=JSON.parse(k)}catch{return}if(!fk(R.slice(0,-1),E))return;const I=R[R.length-1],M=t[t.length-1];I!==M&&o(ine(e,E,I,M),[...E,M])};return c.jsxs("div",{className:"cw-tree-branch",children:[c.jsxs("div",{className:`cw-tree-node cw-tree-type-${u.agentType??"llm"} ${p?"is-selected":""} ${b?"is-draggable":""} ${_?"is-dragover":""} ${s&&E3(u,r,h)?`is-invalid cw-error-shake-${i%2}`:""}`,role:"button",tabIndex:0,draggable:b,onDragStart:b?A=>{A.dataTransfer.setData("application/x-agent-path",JSON.stringify(t)),A.dataTransfer.effectAllowed="move",A.stopPropagation()}:void 0,onDragOver:b?A=>{A.preventDefault(),N(!0)}:void 0,onDragLeave:b?()=>N(!1):void 0,onDrop:b?T:void 0,onClick:()=>a(t),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),a(t))},children:[c.jsx(f,{className:"cw-tree-icon"}),c.jsxs("span",{className:"cw-tree-main",children:[c.jsx("span",{className:"cw-tree-name",children:Id(u.agentType)?"远程 Agent":u.name.trim()||"未命名"}),c.jsx("span",{className:"cw-tree-type",children:d.label})]}),c.jsxs("span",{className:"cw-tree-actions",children:[h&&c.jsx("button",{type:"button",className:"cw-icon-btn cw-tree-clear",title:"清空根 Agent","aria-label":"清空根 Agent",onClick:A=>{A.stopPropagation(),l()},children:c.jsx(Yte,{className:"cw-i cw-i-sm"})}),y&&c.jsx("button",{type:"button",className:"cw-icon-btn",title:"添加子 Agent",onClick:A=>{A.stopPropagation(),w()},children:c.jsx(ms,{className:"cw-i cw-i-sm"})}),!h&&c.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",title:"删除",onClick:A=>{A.stopPropagation(),g()},children:c.jsx(Fl,{className:"cw-i cw-i-sm"})})]})]}),m&&u.subAgents.length>0&&c.jsx("div",{className:"cw-tree-children",children:u.subAgents.map((A,k)=>c.jsx(v3,{root:e,path:[...t,k],selectedPath:n,duplicateNames:r,showErrors:s,validationPulse:i,onSelect:a,onChange:o,onClearRoot:l},k))})]})}function vh(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function hk(e){return JSON.stringify(vh(e))}function cne({enabled:e,disabledReason:t,phase:n,stale:r,run:s,projectName:i,logs:a,messages:o,input:l,error:u,deploying:d,deployError:f,onInput:h,onSend:p,onRestart:m,onIgnoreChanges:y,onDeploy:w}){const[g,E]=v.useState(!1),b=n==="ready"||n==="sending",_=n==="building"||n==="starting"||n==="sending",N=e&&!s&&n==="idle",T=e&&(n==="building"||n==="starting"),A=!!(s&&r&&!T);return g?c.jsx("aside",{className:"cw-debug is-collapsed","aria-label":"调试窗口(已收起)",children:c.jsx("button",{type:"button",className:"cw-debug-expand",onClick:()=>E(!1),"aria-label":"展开调试栏",title:"展开调试栏",children:c.jsx(Wte,{className:"cw-i"})})}):c.jsxs("aside",{className:"cw-debug","aria-label":"调试窗口",children:[c.jsxs("div",{className:"cw-debug-head",children:[c.jsxs("div",{className:"cw-debug-title",children:[c.jsx("button",{type:"button",className:"cw-debug-collapse",onClick:()=>E(!0),"aria-label":"收起调试栏",title:"收起调试栏",children:c.jsx(Xn,{className:"cw-i cw-i-sm"})}),c.jsx("span",{children:"调试"})]}),c.jsx("div",{className:"cw-debug-head-actions",children:c.jsxs("button",{type:"button",className:"cw-debug-deploy",disabled:d,onClick:w,title:"查看源码、填写环境变量并部署",children:["去部署",d?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(xI,{className:"cw-i"})]})})]}),!s&&n==="idle"&&!e&&c.jsx("div",{className:"cw-debug-sub",children:c.jsx("span",{children:t})}),f&&c.jsx("div",{className:"cw-debug-deploy-error",role:"alert",children:f}),c.jsxs("div",{className:"cw-debug-stage",children:[c.jsx("div",{className:"cw-debug-body",children:e?n==="error"?c.jsxs("div",{className:"cw-debug-error",children:[c.jsx(Ip,{message:u||"调试失败",className:"cw-debug-error-detail",onRetry:async()=>{await m()}}),a.length>0&&c.jsx("div",{className:"cw-debug-progress",children:a.map((k,R)=>c.jsx("div",{className:"cw-debug-logline",children:c.jsx("span",{children:k})},`${k}-${R}`))})]}):c.jsx("div",{className:"cw-debug-chat",children:o.length===0?c.jsx("div",{className:"cw-debug-chat-empty",children:"输入消息开始验证当前 Agent。"}):o.map((k,R)=>c.jsxs("div",{className:`cw-debug-msg cw-debug-msg-${k.role}`,children:[c.jsx("div",{className:"cw-debug-role",children:k.role==="user"?"你":i||"Agent"}),c.jsx("div",{className:"cw-debug-content",children:k.role==="user"?k.content:k.error?c.jsx(Ip,{message:k.error,className:"cw-debug-msg-error"}):k.blocks&&k.blocks.length>0?c.jsx(mx,{blocks:k.blocks,onAction:()=>{}}):k.content?k.content:R===o.length-1&&n==="sending"?c.jsx(dM,{}):null})]},R))}):c.jsx("div",{className:"cw-debug-empty",children:t})}),c.jsx("div",{className:"cw-debug-composer",children:c.jsxs("div",{className:"cw-debug-composerbox",children:[c.jsx("textarea",{className:"cw-debug-input",rows:1,value:l,placeholder:r?"更新 Agent 后可继续调试":b?"输入测试消息...":"调试环境启动后可输入",disabled:!b||_||r,onChange:k=>h(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),p())}}),c.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!b||_||r||!l.trim(),onClick:p,children:n==="sending"?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(wI,{className:"cw-i"})})]})}),(N||T||A)&&c.jsx("div",{className:"cw-debug-overlay",role:"status","aria-live":"polite",children:c.jsxs("div",{className:"cw-debug-overlay-content",children:[c.jsx("strong",{className:"cw-debug-overlay-title",children:T?"正在初始化调试环境":A?"Agent 配置已变更":"启动调试环境"}),T?c.jsx("div",{className:"cw-debug-overlay-progress",children:a.map((k,R)=>c.jsxs("div",{className:"cw-debug-logline",children:[R===a.length-1?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(Bs,{className:"cw-i"}),c.jsx("span",{children:k})]},`${k}-${R}`))}):A?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"cw-debug-overlay-copy",children:"当前对话仍在使用上一次配置。更新后,新配置才会生效。"}),c.jsxs("div",{className:"cw-debug-overlay-actions",children:[c.jsx("button",{type:"button",className:"cw-debug-ignore",disabled:_,onClick:y,children:"忽略"}),c.jsxs("button",{type:"button",className:"cw-debug-start",disabled:_,onClick:m,children:[c.jsx(dm,{className:"cw-i"}),"更新 Agent"]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"cw-debug-overlay-copy",children:"启动后会生成代码并创建临时运行环境。"}),c.jsxs("button",{type:"button",className:"cw-debug-start",onClick:m,children:[c.jsx(qte,{className:"cw-i cw-debug-run-icon"}),"启动调试环境"]})]})]})})]})]})}function une({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i}){var Pn,nr,zn,An,st,Cn,Bt,Jt,In,jn,wn,rr,Ot;const[a,o]=v.useState(()=>r??Xi()),[l,u]=v.useState(!1),[d,f]=v.useState(0),[h,p]=v.useState(null),[m,y]=v.useState(!1),[w,g]=v.useState("cn-beijing"),E=(s==null?void 0:s.generatedAgentTestRun)===!0,b=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[_,N]=v.useState("idle"),[T,A]=v.useState(null),k=v.useRef(null),[R,I]=v.useState(null),[M,B]=v.useState(""),[Y,P]=v.useState([]),[U,C]=v.useState([]),[L,O]=v.useState(""),[j,S]=v.useState(null),[H,V]=v.useState(""),[D,ne]=v.useState(""),[ee,re]=v.useState("basic"),[de,G]=v.useState(""),[W,oe]=v.useState(!1),[he,J]=v.useState(!1),[ce,Ce]=v.useState(!1),[Ee,ge]=v.useState([]),Le=v.useRef(null),ve=v.useRef({});v.useEffect(()=>()=>{const Z=k.current;Z&&s1(Z.runId).catch(ke=>console.warn("清理调试运行失败",ke))},[]);const Ue=v.useRef(null);Ue.current||(Ue.current=({meta:Z,children:ke})=>c.jsxs("section",{ref:Me=>{ve.current[Z.id]=Me},id:`cw-sec-${Z.id}`,"data-step-id":Z.id,className:"cw-section",children:[c.jsx("header",{className:"cw-sec-head",children:c.jsxs("h2",{className:"cw-sec-title",children:[Z.label,Z.required&&c.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),ke]}));const Ie=nne(a,Ee)?Ee:[],ae=wh(a,Ie),wt=Ie.length===0,we=`cw-model-advanced-${Ie.join("-")||"root"}`,vt=`cw-more-tool-types-${Ie.join("-")||"root"}`,ct=`cw-advanced-config-${Ie.join("-")||"root"}`,K=Math.max(0,Df.findIndex(Z=>Z.id===(ae.agentType??"llm"))),X=Z=>o(ke=>Rd(ke,Ie,Me=>({...Me,...Z}))),le=(Z,ke)=>o(Me=>{var He;return{...Me,deployment:{...Me.deployment??{feishuEnabled:!1},envValues:{...((He=Me.deployment)==null?void 0:He.envValues)??{},[Z]:ke}}}}),Ne=Z=>X({a2aRegistry:{...ae.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...Z}}),Re=(Z,ke)=>{if(!(Z in ck))return;const Me=ck[Z];Ne({[Me]:ke}),le(Z,ke)},ut=Z=>{if(!(wt&&Z==="a2a")){if(Z==="a2a"){X({agentType:Z,a2aRegistry:{...ae.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}X({agentType:Z,a2aRegistry:ae.a2aRegistry?{...ae.a2aRegistry,enabled:!1}:void 0})}},We=(Z,ke)=>{o(Z),ke&&ge(ke)},ot=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(o(Xi()),ge([]),u(!1),Ce(!1))},Zt=ae.builtinTools??[],Ct=ae.mcpTools??[],Ge=ae.tracingExporters??[],Et=ae.selectedSkills??[],Ht=[ae.memory.shortTerm,ae.memory.longTerm,ae.tracing].filter(Boolean).length,Nn=Z=>X({builtinTools:Zt.includes(Z)?Zt.filter(ke=>ke!==Z):[...Zt,Z]}),Fe=Z=>{const ke=Ge.includes(Z)?Ge.filter(Me=>Me!==Z):[...Ge,Z];X({tracingExporters:ke,tracing:ke.length>0?!0:ae.tracing})},rt=a3(ae.agentType),tt=Id(ae.agentType),mt=v.useMemo(()=>d3(a),[a]),ue=tt?null:nl(ae.name)??(mt.has(ae.name)?"Agent 名称在当前结构中必须唯一":null),Oe=ue!==null,Qe=!tt&&ae.description.trim().length===0,cn=ae.instruction.trim().length===0,an=tt&&!((Pn=ae.a2aRegistry)!=null&&Pn.registrySpaceId.trim()),ie=Z=>l&&Z?`is-error cw-error-shake-${d%2}`:"",_e=v.useMemo(()=>x3(a,mt),[a,mt]),ye=_e.length===0,Pe=v.useMemo(()=>hk(a),[a]),$e=v.useMemo(()=>lne(a),[a]),qe=!!(T&&H&&H!==Pe&&D!==Pe);v.useEffect(()=>{D&&D!==Pe&&ne("")},[Pe,D]);const gt=v.useMemo(()=>{var Z,ke,Me,He;return{type:!0,basic:tt?!an:!Oe&&(rt||!cn),model:!!((Z=ae.modelName)!=null&&Z.trim()||(ke=ae.modelProvider)!=null&&ke.trim()||(Me=ae.modelApiBase)!=null&&Me.trim()),tools:Zt.length>0||Ct.length>0,skills:Et.length>0,knowledge:ae.knowledgebase,advanced:ae.memory.shortTerm||ae.memory.longTerm||ae.tracing,subagents:(((He=ae.subAgents)==null?void 0:He.length)??0)>0,review:ye}},[ae,Oe,cn,rt,tt,ye,Zt,Ct,Et]),Rt=rt||tt?["basic"]:["basic","model","tools","skills","knowledge",...wt?["advanced"]:[]],gn=lk.filter(Z=>Rt.includes(Z.id)),yn=Rt.join("|"),zt=Ie.join("."),kn=gn.findIndex(Z=>Z.id===ee),er=Z=>{var ke;(ke=ve.current[Z])==null||ke.scrollIntoView({behavior:"smooth",block:"start"})};v.useEffect(()=>{if(h)return;const Z=Le.current;if(!Z)return;const ke=yn.split("|");let Me=0;const He=()=>{Me=0;const yt=ke[ke.length-1];let Kt=ke[0];if(Z.scrollTop+Z.clientHeight>=Z.scrollHeight-2)Kt=yt;else{const kt=Z.getBoundingClientRect().top+24;for(const fr of ke){const St=ve.current[fr];if(!St||St.getBoundingClientRect().top>kt)break;Kt=fr}}Kt&&re(kt=>kt===Kt?kt:Kt)},Lt=()=>{Me||(Me=window.requestAnimationFrame(He))};return He(),Z.addEventListener("scroll",Lt,{passive:!0}),window.addEventListener("resize",Lt),()=>{Z.removeEventListener("scroll",Lt),window.removeEventListener("resize",Lt),Me&&window.cancelAnimationFrame(Me)}},[h,yn,zt]);const _r=()=>ye?!0:(u(!0),f(Z=>Z+1),_e[0]&&(ge(_e[0].path),window.requestAnimationFrame(()=>er("basic"))),!1),Dn=async()=>{const Z=k.current;if(k.current=null,A(null),I(null),V(""),ne(""),Z)try{await s1(Z.runId)}catch(ke){console.warn("清理调试运行失败",ke)}},Hn=async()=>{if(G(""),!!_r()){y(!0);try{const Z=await fp(vh(a));await Dn(),N("idle"),B(""),P([]),C([]),O(""),S(null),p(Z)}catch(Z){G(`打开部署页失败:${Z instanceof Error?Z.message:String(Z)}`)}finally{y(!1)}}},tr=async()=>{if(!E||m||!_r())return;const Z=hk(a);ne(""),S(null),C([]),O(""),P([]),N("building");try{await Dn();const ke=[],Me=yt=>{ke.push(yt),P([...ke])};Me("提交 Agent 配置"),N("starting"),Me("初始化调试环境");const He=await rR(vh(a));k.current=He,A(He),B(He.appName),Me("创建调试会话");const Lt=await sR(He.runId,"test_user");I(Lt),V(Z),Me("调试环境就绪"),N("ready")}catch(ke){S(ke instanceof Error?ke.message:String(ke)),N("error")}},Tr=async()=>{const Z=k.current,ke=R,Me=L.trim();if(!(!Z||!ke||!Me||_==="sending")){O(""),N("sending"),C(He=>[...He,{role:"user",content:Me},{role:"assistant",content:"",blocks:[]}]);try{let He=Qs(),Lt="";for await(const yt of iR({runId:Z.runId,userId:"test_user",sessionId:ke,text:Me})){const Kt=yt.error||yt.errorMessage||yt.error_message;if(Kt){C(kt=>{const fr=[...kt],St=fr[fr.length-1];return(St==null?void 0:St.role)==="assistant"&&(St.error=String(Kt)),fr});break}He=ml(He,yt),Lt=He.blocks.filter(kt=>kt.kind==="text").map(kt=>kt.text).join(""),C(kt=>{const fr=[...kt],St=fr[fr.length-1];return(St==null?void 0:St.role)==="assistant"&&(St.content=Lt,St.blocks=He.blocks),fr})}N("ready")}catch(He){C(Lt=>{const yt=[...Lt],Kt=yt[yt.length-1];return(Kt==null?void 0:Kt.role)==="assistant"&&(Kt.error=He instanceof Error?He.message:String(He)),yt}),N("ready")}}};if(h){const Z=async(ke,Me,He)=>{var Kt;const Lt=(Kt=a.deployment)==null?void 0:Kt.network,yt=Lt&&Lt.mode&&Lt.mode!=="public"?{mode:Lt.mode,vpc_id:Lt.vpcId,subnet_ids:Lt.subnetIds,enable_shared_internet_access:Lt.enableSharedInternetAccess}:void 0;return LE(ke.name,ke.files,{region:w,projectName:"default",network:yt},{...He,onStage:Me})};return c.jsx("div",{className:"cw-root cw-root-preview",children:c.jsx("div",{className:"cw-preview-body",children:c.jsx(Mx,{project:h,agentDraft:a,agentName:a.name||"未命名 Agent",agentCount:w3(a),onChange:p,onDeploy:Z,onAgentAdded:n,onDeploymentTaskChange:i,feishuEnabled:!!((nr=a.deployment)!=null&&nr.feishuEnabled),onFeishuEnabledChange:async ke=>{const Me={...a,deployment:{...a.deployment??{feishuEnabled:!1},feishuEnabled:ke}},He=await fp(vh(Me));o(Me),p(He)},deploymentEnv:$e.specs,deploymentEnvValues:{...(zn=a.deployment)==null?void 0:zn.envValues,...$e.fixedValues},onDeploymentEnvChange:le,network:(An=a.deployment)==null?void 0:An.network,onNetworkChange:ke=>o(Me=>({...Me,deployment:{...Me.deployment??{feishuEnabled:!1},network:ke}})),deployRegion:w,onDeployRegionChange:g,onBack:()=>p(null),onExportYaml:()=>Kte(`${a.name||"agent"}.yaml`,Wee(a),"text/yaml")})})})}const Vt=Ue.current,Sn=Z=>lk.find(ke=>ke.id===Z);return c.jsx("div",{className:"cw-root",children:c.jsxs("div",{className:"cw-editor",children:[c.jsxs("aside",{className:"cw-tree","aria-label":"Agent 结构",children:[c.jsx("div",{className:"cw-tree-head",children:"Agent 结构"}),c.jsx(v3,{root:a,path:[],selectedPath:Ie,duplicateNames:mt,showErrors:l,validationPulse:d,onSelect:ge,onChange:We,onClearRoot:ot})]}),c.jsxs("div",{className:"cw-detail",children:[c.jsx("div",{className:"cw-typebar",children:c.jsx("div",{className:"cw-typebar-inner",children:c.jsxs("div",{className:"cw-typeradio cw-typeradio--row",role:"radiogroup","aria-label":"Agent 类型",style:{"--cw-agent-type-gap":`${w0}px`,"--cw-agent-type-slider-width":`calc((100% - ${8+w0*(Df.length-1)}px) / ${Df.length})`,"--cw-active-type-offset":`calc(${K*100}% + ${K*w0}px)`},children:[c.jsx("span",{className:"cw-typeradio-slider","aria-hidden":!0}),Df.map(Z=>{const ke=(ae.agentType??"llm")===Z.id,Me=wt&&Z.id==="a2a",He=Me?"cw-remote-agent-disabled-hint":void 0;return c.jsxs("label",{className:`cw-typeradio-item ${ke?"is-on":""} ${Me?"is-disabled":""}`,title:Me?void 0:Z.desc,tabIndex:Me?0:void 0,"aria-describedby":He,children:[c.jsx("input",{type:"radio",name:"agentType",className:"cw-typeradio-input",checked:ke,disabled:Me,onChange:()=>ut(Z.id)}),c.jsxs("span",{className:"cw-typeradio-title",children:[Gte[Z.id].replace("智能体",""),c.jsx("wbr",{}),"智能体"]}),Me&&c.jsx("span",{id:He,className:"cw-typeradio-disabled-hint",role:"tooltip",children:"远程 Agent 仅可作为子 Agent"})]},Z.id)})]})})}),c.jsx("div",{className:"cw-detail-scroll",ref:Le,children:c.jsx("div",{className:"cw-detail-inner",children:c.jsxs("div",{className:"cw-lower",children:[c.jsxs("div",{className:"cw-form-col",children:[c.jsx(Vt,{meta:Sn("basic"),children:c.jsxs("div",{className:"cw-form",children:[!tt&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["Agent 名称",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("input",{className:`cw-input ${ie(Oe)}`,value:ae.name,placeholder:"customer_service",onChange:Z=>X({name:Z.target.value})}),l&&ue?c.jsx("span",{className:"cw-error-text",children:ue}):c.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在 Agent 结构中保持唯一。"})]}),c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["描述",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${ie(Qe)}`,value:ae.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:Z=>X({description:Z.target.value})}),l&&Qe?c.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):c.jsx("span",{className:"cw-help",children:"描述会显示在 Agent 列表与选择器中。"})]})]}),rt?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"cw-section-desc",children:"编排型 Agent 只负责调度子 Agent,不需要模型或系统提示词。请在左侧 「Agent 结构」中为它添加、排序子 Agent。"}),ae.agentType==="loop"&&c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"最大轮次"}),c.jsx("input",{className:"cw-input",type:"number",min:1,value:ae.maxIterations??3,onChange:Z=>X({maxIterations:Math.max(1,Number(Z.target.value)||1)})}),c.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):tt?c.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[c.jsxs("div",{className:"cw-remote-center-head",children:[c.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),c.jsx(Zte,{value:((st=ae.a2aRegistry)==null?void 0:st.registrySpaceId)??"",region:((Cn=ae.a2aRegistry)==null?void 0:Cn.registryRegion)||hs.region,invalid:l&&an,onChange:Z=>Re(m3,Z)}),c.jsx(xc,{env:Xte,values:g3(ae.a2aRegistry,{includeDefaults:!1}),onChange:Re}),l&&an&&c.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["系统提示词",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:c.jsx(Vte,{value:ae.instruction,invalid:cn,onChange:Z=>X({instruction:Z})})}),l&&cn?c.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):c.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!rt&&!tt&&c.jsxs(c.Fragment,{children:[c.jsx(Vt,{meta:Sn("model"),children:c.jsxs("div",{className:"cw-form",children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"模型名称"}),c.jsx("input",{className:"cw-input",value:ae.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:Z=>X({modelName:Z.target.value})})]}),c.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":W,"aria-controls":we,onClick:()=>oe(Z=>!Z),children:[c.jsx("span",{children:"更多选项"}),c.jsx(Xn,{className:`cw-more-options-chevron ${W?"is-open":""}`,"aria-hidden":!0})]}),c.jsx(Hi,{initial:!1,children:W&&c.jsxs(Gt.div,{id:we,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"服务商 Provider"}),c.jsx("input",{className:"cw-input",value:ae.modelProvider??"",placeholder:"openai",onChange:Z=>X({modelProvider:Z.target.value})})]}),c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"API Base"}),c.jsx("input",{className:"cw-input",value:ae.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:Z=>X({modelApiBase:Z.target.value})}),c.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),c.jsx(Vt,{meta:Sn("tools"),children:c.jsxs("div",{className:"cw-form",children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"内置工具"}),c.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),c.jsx("div",{className:"cw-tools-list-shell",children:c.jsx(uk,{items:Ox,selected:Zt,onToggle:Nn,scrollRows:6})})]}),c.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":he,"aria-controls":vt,onClick:()=>J(Z=>!Z),children:[c.jsx("span",{children:"更多类型工具"}),Ct.length>0&&c.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",Ct.length]}),c.jsx(Xn,{className:`cw-more-options-chevron ${he?"is-open":""}`,"aria-hidden":!0})]}),c.jsx(Hi,{initial:!1,children:he&&c.jsx(Gt.div,{id:vt,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"MCP 工具"}),c.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),c.jsx(Jte,{tools:Ct,onChange:Z=>X({mcpTools:Z})})]})})})]})}),c.jsx(Vt,{meta:Sn("skills"),children:c.jsx("div",{className:"cw-form",children:c.jsx(tne,{selected:Et,onChange:Z=>X({selectedSkills:Z})})})}),c.jsx(Vt,{meta:Sn("knowledge"),children:c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.knowledgebase,onChange:Z=>X({knowledgebase:Z}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:lh}),ae.knowledgebase&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"知识库后端"}),c.jsx(v0,{options:Ap,value:ae.knowledgebaseBackend,onChange:Z=>X({knowledgebaseBackend:Z})}),c.jsx(xc,{env:((Bt=Ap.find(Z=>Z.id===(ae.knowledgebaseBackend??"local")))==null?void 0:Bt.env)??[],values:((Jt=a.deployment)==null?void 0:Jt.envValues)??{},onChange:le})]})]})}),wt&&c.jsxs("section",{ref:Z=>{ve.current.advanced=Z},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[c.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":ce,"aria-controls":ct,onClick:()=>Ce(Z=>!Z),children:[c.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),c.jsx(Xn,{className:`cw-advanced-disclosure-chevron ${ce?"is-open":""}`,"aria-hidden":!0}),Ht>0&&c.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",Ht]})]}),c.jsx(Hi,{initial:!1,children:ce&&c.jsxs(Gt.div,{id:ct,className:"cw-advanced-content",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-advanced-group",children:[c.jsx("div",{className:"cw-advanced-group-head",children:c.jsx("span",{children:"记忆"})}),c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.memory.shortTerm,onChange:Z=>X({memory:{...ae.memory,shortTerm:Z}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:OI}),ae.memory.shortTerm&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"短期记忆后端"}),c.jsx(v0,{options:kp,value:ae.shortTermBackend,onChange:Z=>X({shortTermBackend:Z})}),c.jsx(xc,{env:((In=kp.find(Z=>Z.id===(ae.shortTermBackend??"local")))==null?void 0:In.env)??[],values:((jn=a.deployment)==null?void 0:jn.envValues)??{},onChange:le})]}),c.jsx(wc,{checked:ae.memory.longTerm,onChange:Z=>X({memory:{...ae.memory,longTerm:Z}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:lh}),ae.memory.longTerm&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"长期记忆后端"}),c.jsx(v0,{options:Sp,value:ae.longTermBackend,onChange:Z=>X({longTermBackend:Z})}),c.jsx(xc,{env:((wn=Sp.find(Z=>Z.id===(ae.longTermBackend??"local")))==null?void 0:wn.env)??[],values:((rr=a.deployment)==null?void 0:rr.envValues)??{},onChange:le}),c.jsx(wc,{checked:!!ae.autoSaveSession,onChange:Z=>X({autoSaveSession:Z}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:lh})]})]})]}),c.jsxs("div",{className:"cw-advanced-group",children:[c.jsx("div",{className:"cw-advanced-group-head",children:c.jsx("span",{children:"观测"})}),c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.tracing,onChange:Z=>X({tracing:Z}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:kI}),ae.tracing&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),c.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),c.jsx(uk,{items:Cp,selected:Ge,onToggle:Fe}),c.jsx(xc,{env:Cp.filter(Z=>Ge.includes(Z.id)).flatMap(Z=>Z.env),values:((Ot=a.deployment)==null?void 0:Ot.envValues)??{},onChange:le})]})]})]})]})})]})]})]}),c.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:c.jsxs("ol",{className:"cw-steps",children:[c.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:c.jsx(Gt.div,{className:"cw-rail-fill",animate:{height:`${Math.max(kn,0)/Math.max(gn.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),gn.map(Z=>{const ke=Z.id===ee,Me=gt[Z.id];return c.jsx("li",{children:c.jsxs("button",{type:"button",className:`cw-step ${ke?"is-active":""} ${Me?"is-done":""}`,onClick:()=>er(Z.id),"aria-current":ke?"step":void 0,"aria-label":Z.label,children:[c.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:ke?c.jsx("span",{className:"cw-dot"}):Me?c.jsx(Bs,{className:"cw-step-check"}):c.jsx("span",{className:"cw-dot"})}),c.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:Z.label})]})},Z.id)})]})})]})})})]}),c.jsx(cne,{enabled:E,disabledReason:b,phase:_,stale:qe,run:T,projectName:M||a.name,logs:Y,messages:U,input:L,error:j,deploying:m,deployError:de,onInput:O,onSend:Tr,onRestart:tr,onIgnoreChanges:()=>ne(Pe),onDeploy:Hn})]})})}function Hs(e){return{...Xi(),...e}}const dne=[{id:"support",icon:wF,draft:Hs({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:oF,draft:Hs({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:vF,draft:Hs({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:_E,draft:Hs({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:IF,draft:Hs({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:$F,draft:Hs({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Hs({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Hs({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Hs({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function fne(e){const t=[];return e.tools.length&&t.push({icon:CE,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:aF,label:"记忆"}),e.knowledgebase&&t.push({icon:iF,label:"知识库"}),e.tracing&&t.push({icon:rF,label:"观测"}),e.subAgents.length&&t.push({icon:MI,label:`子Agent ${e.subAgents.length}`}),t}function hne({onBack:e,onCreate:t}){const[n,r]=v.useState(null);return c.jsx("div",{className:"tpl-root",children:n?c.jsx(mne,{template:n,onBack:()=>r(null),onCreate:t}):c.jsx(pne,{onPick:r})})}function pne({onPick:e}){return c.jsxs("div",{className:"tpl-scroll",children:[c.jsxs("div",{className:"tpl-head",children:[c.jsx("h1",{className:"tpl-title",children:"从模板新建"}),c.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),c.jsx("div",{className:"tpl-grid",children:dne.map((t,n)=>c.jsxs(Gt.button,{type:"button",className:"tpl-card",onClick:()=>e(t),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:n*.03,duration:.24,ease:[.22,1,.36,1]},children:[c.jsx("span",{className:"tpl-card-icon",children:c.jsx(t.icon,{className:"icon"})}),c.jsx("span",{className:"tpl-card-name",children:t.draft.name}),c.jsx("span",{className:"tpl-card-desc",children:Zr(t.draft.description)})]},t.id))})]})}function mne({template:e,onBack:t,onCreate:n}){const[r,s]=v.useState(e.draft.name),i=e.icon,a=fne(e.draft);function o(){const l=r.trim()||e.draft.name;n({...e.draft,name:l})}return c.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[c.jsxs("button",{className:"tpl-back",onClick:t,children:[c.jsx(EI,{className:"icon"})," 返回模板列表"]}),c.jsxs(Gt.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[c.jsxs("div",{className:"tpl-detail-head",children:[c.jsx("span",{className:"tpl-detail-icon",children:c.jsx(i,{className:"icon"})}),c.jsxs("div",{className:"tpl-detail-headtext",children:[c.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),c.jsx("div",{className:"tpl-detail-desc",children:Zr(e.draft.description)})]})]}),a.length>0&&c.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(l=>c.jsxs("span",{className:"tpl-tag",children:[c.jsx(l.icon,{className:"tpl-tag-icon"})," ",l.label]},l.label))}),c.jsxs("label",{className:"tpl-field",children:[c.jsx("span",{className:"tpl-field-label",children:"名称"}),c.jsx("input",{className:"tpl-input",value:r,onChange:l=>s(l.target.value),placeholder:e.draft.name})]}),c.jsxs("div",{className:"tpl-field",children:[c.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),c.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),c.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"模型"}),c.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"工具"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"记忆"}),c.jsx("span",{className:"tpl-meta-val",children:gne(e.draft)})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"知识库"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&c.jsxs("div",{className:"tpl-field",children:[c.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),c.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((l,u)=>c.jsxs("div",{className:"tpl-subagent",children:[c.jsxs("div",{className:"tpl-subagent-top",children:[c.jsx("span",{className:"tpl-subagent-name",children:l.name}),l.tools.length>0&&c.jsx("span",{className:"tpl-subagent-tools",children:l.tools.join("、")})]}),c.jsx("div",{className:"tpl-subagent-desc",children:Zr(l.description)})]},u))})]}),c.jsxs("button",{className:"tpl-create",onClick:o,children:["使用此模板创建 ",c.jsx(Xn,{className:"icon"})]})]})]})}function gne(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}function xn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Dm(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_h.prototype=Dm.prototype={constructor:_h,on:function(e,t){var n=this._,r=bne(e+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(s),r=0,s,i;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mk.hasOwnProperty(t)?{space:mk[t],local:e}:e}function xne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===D1&&t.documentElement.namespaceURI===D1?t.createElement(e):t.createElementNS(n,e)}}function wne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function _3(e){var t=Pm(e);return(t.local?wne:xne)(t)}function vne(){}function Dx(e){return e==null?vne:function(){return this.querySelector(e)}}function _ne(e){typeof e!="function"&&(e=Dx(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=b&&(b=E+1);!(N=w[b])&&++b=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function qne(e){e||(e=Gne);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,s=new Array(r),i=0;it?1:e>=t?0:NaN}function Xne(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Qne(){return Array.from(this)}function Zne(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?cre:typeof t=="function"?dre:ure)(e,t,n??"")):Tl(this.node(),e)}function Tl(e,t){return e.style.getPropertyValue(t)||A3(e).getComputedStyle(e,null).getPropertyValue(t)}function hre(e){return function(){delete this[e]}}function pre(e,t){return function(){this[e]=t}}function mre(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function gre(e,t){return arguments.length>1?this.each((t==null?hre:typeof t=="function"?mre:pre)(e,t)):this.node()[e]}function C3(e){return e.trim().split(/^|\s+/)}function Px(e){return e.classList||new I3(e)}function I3(e){this._node=e,this._names=C3(e.getAttribute("class")||"")}I3.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function R3(e,t){for(var n=Px(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Vre(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function P1(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}P1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ese(e){return!e.ctrlKey&&!e.button}function tse(){return this.parentNode}function nse(e,t){return t??{x:e.x,y:e.y}}function rse(){return navigator.maxTouchPoints||"ontouchstart"in this}function j3(){var e=ese,t=tse,n=nse,r=rse,s={},i=Dm("start","drag","end"),a=0,o,l,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",g,Jre).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,N){if(!(d||!e.call(this,_,N))){var T=b(this,t.call(this,_,N),_,N,"mouse");T&&(Ar(_.view).on("mousemove.drag",m,Ku).on("mouseup.drag",y,Ku),D3(_.view),N0(_),u=!1,o=_.clientX,l=_.clientY,T("start",_))}}function m(_){if(rl(_),!u){var N=_.clientX-o,T=_.clientY-l;u=N*N+T*T>f}s.mouse("drag",_)}function y(_){Ar(_.view).on("mousemove.drag mouseup.drag",null),P3(_.view,u),rl(_),s.mouse("end",_)}function w(_,N){if(e.call(this,_,N)){var T=_.changedTouches,A=t.call(this,_,N),k=T.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ise.exec(e))?new yr(t[1],t[2],t[3],1):(t=ase.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ose.exec(e))?Bf(t[1],t[2],t[3],t[4]):(t=lse.exec(e))?Bf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cse.exec(e))?vk(t[1],t[2]/100,t[3]/100,1):(t=use.exec(e))?vk(t[1],t[2]/100,t[3]/100,t[4]):gk.hasOwnProperty(e)?Ek(gk[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function Ek(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function Bf(e,t,n,r){return r<=0&&(e=t=n=NaN),new yr(e,t,n,r)}function hse(e){return e instanceof Ld||(e=Wa(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function j1(e,t,n,r){return arguments.length===1?hse(e):new yr(e,t,n,r??1)}function yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jx(yr,j1,B3(Ld,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Ma(this.r),Ma(this.g),Ma(this.b),Lp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xk,formatHex:xk,formatHex8:pse,formatRgb:wk,toString:wk}));function xk(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function pse(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function wk(){const e=Lp(this.opacity);return`${e===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${e===1?")":`, ${e})`}`}function Lp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ma(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sa(e){return e=Ma(e),(e<16?"0":"")+e.toString(16)}function vk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new os(e,t,n,r)}function F3(e){if(e instanceof os)return new os(e.h,e.s,e.l,e.opacity);if(e instanceof Ld||(e=Wa(e)),!e)return new os;if(e instanceof os)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,o=i-s,l=(i+s)/2;return o?(t===i?a=(n-r)/o+(n0&&l<1?0:a,new os(a,o,l,e.opacity)}function mse(e,t,n,r){return arguments.length===1?F3(e):new os(e,t,n,r??1)}function os(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jx(os,mse,B3(Ld,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new os(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new os(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new yr(k0(e>=240?e-240:e+120,s,r),k0(e,s,r),k0(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new os(_k(this.h),Ff(this.s),Ff(this.l),Lp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lp(this.opacity);return`${e===1?"hsl(":"hsla("}${_k(this.h)}, ${Ff(this.s)*100}%, ${Ff(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _k(e){return e=(e||0)%360,e<0?e+360:e}function Ff(e){return Math.max(0,Math.min(1,e||0))}function k0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Bx=e=>()=>e;function gse(e,t){return function(n){return e+n*t}}function yse(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function bse(e){return(e=+e)==1?U3:function(t,n){return n-t?yse(t,n,e):Bx(isNaN(t)?n:t)}}function U3(e,t){var n=t-e;return n?gse(e,n):Bx(isNaN(e)?t:e)}const Mp=function e(t){var n=bse(t);function r(s,i){var a=n((s=j1(s)).r,(i=j1(i)).r),o=n(s.g,i.g),l=n(s.b,i.b),u=U3(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=o(d),s.b=l(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Ese(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;sn&&(i=t.slice(n,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:As(r,s)})),n=S0.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:As(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function o(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:As(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function l(u,d,f,h,p,m){if(u!==f||d!==h){var y=p.push(s(p)+"scale(",null,",",null,")");m.push({i:y-4,x:As(u,f)},{i:y-2,x:As(d,h)})}else(f!==1||h!==1)&&p.push(s(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),o(u.skewX,d.skewX,f,h),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,y=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--Nl}function kk(){qa=(Pp=qu.now())+jm,Nl=Mc=0;try{Mse()}finally{Nl=0,Pse(),qa=0}}function Dse(){var e=qu.now(),t=e-Pp;t>V3&&(jm-=t,Pp=e)}function Pse(){for(var e,t=Dp,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Dp=n);Dc=e,U1(r)}function U1(e){if(!Nl){Mc&&(Mc=clearTimeout(Mc));var t=e-qa;t>24?(e<1/0&&(Mc=setTimeout(kk,e-qu.now()-jm)),vc&&(vc=clearInterval(vc))):(vc||(Pp=qu.now(),vc=setInterval(Dse,V3)),Nl=1,K3(kk))}}function Sk(e,t,n){var r=new jp;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var jse=Dm("start","end","cancel","interrupt"),Bse=[],W3=0,Ak=1,$1=2,Nh=3,Ck=4,H1=5,kh=6;function Bm(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Fse(e,n,{name:t,index:r,group:s,on:jse,tween:Bse,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:W3})}function Ux(e,t){var n=xs(e,t);if(n.state>W3)throw new Error("too late; already scheduled");return n}function $s(e,t){var n=xs(e,t);if(n.state>Nh)throw new Error("too late; already running");return n}function xs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Fse(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Y3(i,0,n.time);function i(u){n.state=Ak,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,p;if(n.state!==Ak)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===Nh)return Sk(a);p.state===Ck?(p.state=kh,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d$1&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function mie(e,t,n){var r,s,i=pie(t)?Ux:$s;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(t,n),a.on=s}}function gie(e,t){var n=this._id;return arguments.length<2?xs(this.node(),n).on.on(e):this.each(mie(n,e,t))}function yie(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function bie(){return this.on("end.remove",yie(this._id))}function Eie(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Dx(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function Vie(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function ei(e,t,n){this.k=e,this.x=t,this.y=n}ei.prototype={constructor:ei,scale:function(e){return e===1?this:new ei(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ei(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fm=new ei(1,0,0);Q3.prototype=ei.prototype;function Q3(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fm;return e.__zoom}function A0(e){e.stopImmediatePropagation()}function _c(e){e.preventDefault(),e.stopImmediatePropagation()}function Kie(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Yie(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ik(){return this.__zoom||Fm}function Wie(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qie(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gie(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Z3(){var e=Kie,t=Yie,n=Gie,r=Wie,s=qie,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=Th,u=Dm("start","zoom","end"),d,f,h,p=500,m=150,y=0,w=10;function g(P){P.property("__zoom",Ik).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(P,U,C,L){var O=P.selection?P.selection():P;O.property("__zoom",Ik),P!==O?N(P,U,C,L):O.interrupt().each(function(){T(this,arguments).event(L).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},g.scaleBy=function(P,U,C,L){g.scaleTo(P,function(){var O=this.__zoom.k,j=typeof U=="function"?U.apply(this,arguments):U;return O*j},C,L)},g.scaleTo=function(P,U,C,L){g.transform(P,function(){var O=t.apply(this,arguments),j=this.__zoom,S=C==null?_(O):typeof C=="function"?C.apply(this,arguments):C,H=j.invert(S),V=typeof U=="function"?U.apply(this,arguments):U;return n(b(E(j,V),S,H),O,a)},C,L)},g.translateBy=function(P,U,C,L){g.transform(P,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,L)},g.translateTo=function(P,U,C,L,O){g.transform(P,function(){var j=t.apply(this,arguments),S=this.__zoom,H=L==null?_(j):typeof L=="function"?L.apply(this,arguments):L;return n(Fm.translate(H[0],H[1]).scale(S.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof C=="function"?-C.apply(this,arguments):-C),j,a)},L,O)};function E(P,U){return U=Math.max(i[0],Math.min(i[1],U)),U===P.k?P:new ei(U,P.x,P.y)}function b(P,U,C){var L=U[0]-C[0]*P.k,O=U[1]-C[1]*P.k;return L===P.x&&O===P.y?P:new ei(P.k,L,O)}function _(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function N(P,U,C,L){P.on("start.zoom",function(){T(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(L).end()}).tween("zoom",function(){var O=this,j=arguments,S=T(O,j).event(L),H=t.apply(O,j),V=C==null?_(H):typeof C=="function"?C.apply(O,j):C,D=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),ne=O.__zoom,ee=typeof U=="function"?U.apply(O,j):U,re=l(ne.invert(V).concat(D/ne.k),ee.invert(V).concat(D/ee.k));return function(de){if(de===1)de=ee;else{var G=re(de),W=D/G[2];de=new ei(W,V[0]-G[0]*W,V[1]-G[1]*W)}S.zoom(null,de)}})}function T(P,U,C){return!C&&P.__zooming||new A(P,U)}function A(P,U){this.that=P,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,U),this.taps=0}A.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,U){return this.mouse&&P!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var U=Ar(this.that).datum();u.call(P,this.that,new Vie(P,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),U)}};function k(P,...U){if(!e.apply(this,arguments))return;var C=T(this,U).event(P),L=this.__zoom,O=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,r.apply(this,arguments)))),j=is(P);if(C.wheel)(C.mouse[0][0]!==j[0]||C.mouse[0][1]!==j[1])&&(C.mouse[1]=L.invert(C.mouse[0]=j)),clearTimeout(C.wheel);else{if(L.k===O)return;C.mouse=[j,L.invert(j)],Sh(this),C.start()}_c(P),C.wheel=setTimeout(S,m),C.zoom("mouse",n(b(E(L,O),C.mouse[0],C.mouse[1]),C.extent,a));function S(){C.wheel=null,C.end()}}function R(P,...U){if(h||!e.apply(this,arguments))return;var C=P.currentTarget,L=T(this,U,!0).event(P),O=Ar(P.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",D,!0),j=is(P,C),S=P.clientX,H=P.clientY;D3(P.view),A0(P),L.mouse=[j,this.__zoom.invert(j)],Sh(this),L.start();function V(ne){if(_c(ne),!L.moved){var ee=ne.clientX-S,re=ne.clientY-H;L.moved=ee*ee+re*re>y}L.event(ne).zoom("mouse",n(b(L.that.__zoom,L.mouse[0]=is(ne,C),L.mouse[1]),L.extent,a))}function D(ne){O.on("mousemove.zoom mouseup.zoom",null),P3(ne.view,L.moved),_c(ne),L.event(ne).end()}}function I(P,...U){if(e.apply(this,arguments)){var C=this.__zoom,L=is(P.changedTouches?P.changedTouches[0]:P,this),O=C.invert(L),j=C.k*(P.shiftKey?.5:2),S=n(b(E(C,j),L,O),t.apply(this,U),a);_c(P),o>0?Ar(this).transition().duration(o).call(N,S,L,P):Ar(this).call(g.transform,S,L,P)}}function M(P,...U){if(e.apply(this,arguments)){var C=P.touches,L=C.length,O=T(this,U,P.changedTouches.length===L).event(P),j,S,H,V;for(A0(P),S=0;S`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Gu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],J3=["Enter"," ","Escape"],eD={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var kl;(function(e){e.Strict="strict",e.Loose="loose"})(kl||(kl={}));var Da;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Da||(Da={}));var Xu;(function(e){e.Partial="partial",e.Full="full"})(Xu||(Xu={}));const tD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ci;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ci||(Ci={}));var Qu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Qu||(Qu={}));var De;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(De||(De={}));const Rk={[De.Left]:De.Right,[De.Right]:De.Left,[De.Top]:De.Bottom,[De.Bottom]:De.Top};function nD(e){return e===null?null:e?"valid":"invalid"}const rD=e=>"id"in e&&"source"in e&&"target"in e,Xie=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Hx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Md=(e,t=[0,0])=>{const{width:n,height:r}=hi(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Qie=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const i=typeof s=="string";let a=!t.nodeLookup&&!i?s:void 0;t.nodeLookup&&(a=i?t.nodeLookup.get(s):Hx(s)?s:t.nodeLookup.get(s.id));const o=a?Bp(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Um(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return $m(n)},Dd=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Um(n,Bp(s)),r=!0)}),r?$m(n):{x:0,y:0,width:0,height:0}},zx=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const o={...Zl(t,[n,r,s]),width:t.width/s,height:t.height/s},l=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(a&&!f||h)continue;const p=d.width??u.width??u.initialWidth??null,m=d.height??u.height??u.initialHeight??null,y=Zu(o,Al(u)),w=(p??0)*(m??0),g=i&&y>0;(!u.internals.handleBounds||g||y>=w||u.dragging)&&l.push(u)}return l},Zie=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Jie(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function eae({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=Jie(e,a),l=Dd(o),u=Kx(l,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function sD({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),o=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",gs.error005());else{const p=o.measured.width,m=o.measured.height;p&&m&&(f=[[l,u],[l+p,u+m]])}else o&&Xa(a.extent)&&(f=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const h=Xa(f)?Ga(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",gs.error015())),{position:{x:h.x-l+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function tae({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const i=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=i.has(h.id),m=!p&&h.parentId&&a.find(y=>y.id===h.parentId);(p||m)&&a.push(h)}const o=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=Zie(a,l);for(const h of l)o.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!s)return{edges:d,nodes:a};const f=await s({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Sl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ga=(e={x:0,y:0},t,n)=>({x:Sl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Sl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function iD(e,t,n){const{width:r,height:s}=hi(n),{x:i,y:a}=n.internals.positionAbsolute;return Ga(e,[[i,a],[i+r,a+s]],t)}const Ok=(e,t,n)=>en?-Sl(Math.abs(e-n),1,t)/t:0,Vx=(e,t,n=15,r=40)=>{const s=Ok(e.x,r,t.width-r)*n,i=Ok(e.y,r,t.height-r)*n;return[s,i]},Um=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),z1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),$m=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Al=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:Md(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Bp=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:Md(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},aD=(e,t)=>$m(Um(z1(e),z1(t))),Zu=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Lk=e=>ls(e.width)&&ls(e.height)&&ls(e.x)&&ls(e.y),ls=e=>!isNaN(e)&&isFinite(e),oD=(e,t)=>(n,r)=>{},Pd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zl=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const o={x:(e-n)/s,y:(t-r)/s};return i?Pd(o,a):o},Cl=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function go(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nae(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=go(e,n),s=go(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=go(e.top??e.y??0,n),s=go(e.bottom??e.y??0,n),i=go(e.left??e.x??0,t),a=go(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rae(e,t,n,r,s,i){const{x:a,y:o}=Cl(e,[t,n,r]),{x:l,y:u}=Cl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=s-l,f=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(d),bottom:Math.floor(f)}}const Kx=(e,t,n,r,s,i)=>{const a=nae(i,t,n),o=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(o,l),d=Sl(u,r,s),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,y=rae(e,p,m,d,t,n),w={left:Math.min(y.left-a.left,0),top:Math.min(y.top-a.top,0),right:Math.min(y.right-a.right,0),bottom:Math.min(y.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Ju=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Xa(e){return e!=null&&e!=="parent"}function hi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function lD(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function cD(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*o[1]}return i}function Mk(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function sae(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function iae(e){return{...eD,...e||{}}}function cu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=cs(e),o=Zl({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=n?Pd(o,t):o;return{xSnapped:l,ySnapped:u,...o}}const Yx=e=>({width:e.offsetWidth,height:e.offsetHeight}),uD=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aae=["INPUT","SELECT","TEXTAREA"];function dD(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:aae.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const fD=e=>"clientX"in e,cs=(e,t)=>{var i,a;const n=fD(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Dk=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Yx(a)}})};function hD({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+o*.375+r*.125,d=Math.abs(l-e),f=Math.abs(u-t);return[l,u,d,f]}function Hf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Pk({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case De.Left:return[t-Hf(t-r,i),n];case De.Right:return[t+Hf(r-t,i),n];case De.Top:return[t,n-Hf(n-s,i)];case De.Bottom:return[t,n+Hf(s-n,i)]}}function pD({sourceX:e,sourceY:t,sourcePosition:n=De.Bottom,targetX:r,targetY:s,targetPosition:i=De.Top,curvature:a=.25}){const[o,l]=Pk({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=Pk({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=hD({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${l} ${u},${d} ${r},${s}`,f,h,p,m]}function mD({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const cae=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,uae=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),dae=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",gs.error006()),t;const r=n.getEdgeId||cae;let s;return rD(e)?s={...e}:s={...e,id:r(e)},uae(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function gD({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,o]=mD({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,o]}const jk={[De.Left]:{x:-1,y:0},[De.Right]:{x:1,y:0},[De.Top]:{x:0,y:-1},[De.Bottom]:{x:0,y:1}},fae=({source:e,sourcePosition:t=De.Bottom,target:n})=>t===De.Left||t===De.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function hae({source:e,sourcePosition:t=De.Bottom,target:n,targetPosition:r=De.Top,center:s,offset:i,stepPosition:a}){const o=jk[t],l=jk[r],u={x:e.x+o.x*i,y:e.y+o.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},f=fae({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,w;const g={x:0,y:0},E={x:0,y:0},[,,b,_]=mD({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*l[h]===-1){h==="x"?(y=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(y=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const k=[{x:y,y:u.y},{x:y,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];o[h]===p?m=h==="x"?k:R:m=h==="x"?R:k}else{const k=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=o.x===p?R:k:m=o.y===p?k:R,t===r){const P=Math.abs(e[h]-n[h]);if(P<=i){const U=Math.min(i-1,i-P);o[h]===p?g[h]=(u[h]>e[h]?-1:1)*U:E[h]=(d[h]>n[h]?-1:1)*U}}if(t!==r){const P=h==="x"?"y":"x",U=o[h]===l[P],C=u[P]>d[P],L=u[P]=Y?(y=(I.x+M.x)/2,w=m[0].y):(y=m[0].x,w=(I.y+M.y)/2)}const N={x:u.x+g.x,y:u.y+g.y},T={x:d.x+E.x,y:d.y+E.y};return[[e,...N.x!==m[0].x||N.y!==m[0].y?[N]:[],...m,...T.x!==m[m.length-1].x||T.y!==m[m.length-1].y?[T]:[],n],y,w,b,_]}function pae(e,t,n,r){const s=Math.min(Bk(e,t)/2,Bk(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function K1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function gae(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=K1(l,t);i.has(u)||(a.push({id:u,color:l.color||n,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const yD=1e3,yae=10,Wx={nodeOrigin:[0,0],nodeExtent:Gu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},bae={...Wx,checkEquality:!0};function qx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Eae(e,t,n){const r=qx(Wx,n);for(const s of e.values())if(s.parentId)Xx(s,e,t,r);else{const i=Md(s,r.nodeOrigin),a=Xa(s.extent)?s.extent:r.nodeExtent,o=Ga(i,a,hi(s));s.internals.positionAbsolute=o}}function xae(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(i):s.type==="target"&&r.push(i)}return{source:n,target:r}}function Gx(e){return e==="manual"}function Y1(e,t,n,r={}){var d,f;const s=qx(bae,r),i={i:0},a=new Map(t),o=s!=null&&s.elevateNodesOnSelect&&!Gx(s.zIndexMode)?yD:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(s.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const m=Md(h,s.nodeOrigin),y=Xa(h.extent)?h.extent:s.nodeExtent,w=Ga(m,y,hi(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:xae(h,p),z:bD(h,o,s.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(l=!1),h.parentId&&Xx(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function wae(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Xx(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=qx(Wx,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}wae(e,n),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*yae),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!Gx(l)?yD:0,{x:h,y:p,z:m}=vae(e,d,a,o,f,l),{positionAbsolute:y}=e.internals,w=h!==y.x||p!==y.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:y,z:m}})}function bD(e,t,n){const r=ls(e.zIndex)?e.zIndex:0;return Gx(n)?r:r+(e.selected?t:0)}function vae(e,t,n,r,s,i){const{x:a,y:o}=t.internals.positionAbsolute,l=hi(e),u=Md(e,n),d=Xa(e.extent)?Ga(u,e.extent,l):u;let f=Ga({x:a+d.x,y:o+d.y},r,l);e.extent==="parent"&&(f=iD(f,l,t));const h=bD(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function Qx(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=t.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??Al(l),d=aD(u,o.rect);i.set(o.parentId,{expandedRect:d,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var b;const d=l.internals.positionAbsolute,f=hi(l),h=l.origin??r,p=o.x0||m>0||g||E)&&(s.push({id:u,type:"position",position:{x:l.position.x-p+g,y:l.position.y-m+E}}),(b=n.get(u))==null||b.forEach(_=>{e.some(N=>N.id===_.id)||s.push({id:_.id,type:"position",position:{x:_.position.x+p,y:_.position.y+m}})})),(f.width0){const p=Qx(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:l}}async function Tae({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:i}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function Hk(e,t,n,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(n,t)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(n,t))}}function ED(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,d=`${i}-${o}--${s}-${a}`;Hk("source",l,d,e,s,a),Hk("target",l,u,e,i,o),t.set(r.id,r)}}function xD(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:xD(n,t):!1}function zk(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Nae(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!xD(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function C0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,o,l;const s=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&s.push({...f,position:d.position,dragging:r})}if(!e)return[s[0],s];const i=(o=n.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=t.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function kae({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:n-s.distance.x,y:r-s.distance.y},a=Pd(i,t);return{x:a.x-i.x,y:a.y-i.y}}function Sae({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,y=null;function w({noDragClassName:E,handleSelector:b,domNode:_,isSelectable:N,nodeId:T,nodeClickDistance:A=0}){h=Ar(_);function k({x:B,y:Y}){const{nodeLookup:P,nodeExtent:U,snapGrid:C,snapToGrid:L,nodeOrigin:O,onNodeDrag:j,onSelectionDrag:S,onError:H,updateNodePositions:V}=t();i={x:B,y:Y};let D=!1;const ne=o.size>1,ee=ne&&U?z1(Dd(o)):null,re=ne&&L?kae({dragItems:o,snapGrid:C,x:B,y:Y}):null;for(const[de,G]of o){if(!P.has(de))continue;let W={x:B-G.distance.x,y:Y-G.distance.y};L&&(W=re?{x:Math.round(W.x+re.x),y:Math.round(W.y+re.y)}:Pd(W,C));let oe=null;if(ne&&U&&!G.extent&&ee){const{positionAbsolute:ce}=G.internals,Ce=ce.x-ee.x+U[0][0],Ee=ce.x+G.measured.width-ee.x2+U[1][0],ge=ce.y-ee.y+U[0][1],Le=ce.y+G.measured.height-ee.y2+U[1][1];oe=[[Ce,ge],[Ee,Le]]}const{position:he,positionAbsolute:J}=sD({nodeId:de,nextPosition:W,nodeLookup:P,nodeExtent:oe||U,nodeOrigin:O,onError:H});D=D||G.position.x!==he.x||G.position.y!==he.y,G.position=he,G.internals.positionAbsolute=J}if(m=m||D,!!D&&(V(o,!0),y&&(r||j||!T&&S))){const[de,G]=C0({nodeId:T,dragItems:o,nodeLookup:P});r==null||r(y,o,de,G),j==null||j(y,de,G),T||S==null||S(y,G)}}async function R(){if(!d)return;const{transform:B,panBy:Y,autoPanSpeed:P,autoPanOnNodeDrag:U}=t();if(!U){l=!1,cancelAnimationFrame(a);return}const[C,L]=Vx(u,d,P);(C!==0||L!==0)&&(i.x=(i.x??0)-C/B[2],i.y=(i.y??0)-L/B[2],await Y({x:C,y:L})&&k(i)),a=requestAnimationFrame(R)}function I(B){var ne;const{nodeLookup:Y,multiSelectionActive:P,nodesDraggable:U,transform:C,snapGrid:L,snapToGrid:O,selectNodesOnDrag:j,onNodeDragStart:S,onSelectionDragStart:H,unselectNodesAndEdges:V}=t();f=!0,(!j||!N)&&!P&&T&&((ne=Y.get(T))!=null&&ne.selected||V()),N&&j&&T&&(e==null||e(T));const D=cu(B.sourceEvent,{transform:C,snapGrid:L,snapToGrid:O,containerBounds:d});if(i=D,o=Nae(Y,U,D,T),o.size>0&&(n||S||!T&&H)){const[ee,re]=C0({nodeId:T,dragItems:o,nodeLookup:Y});n==null||n(B.sourceEvent,o,ee,re),S==null||S(B.sourceEvent,ee,re),T||H==null||H(B.sourceEvent,re)}}const M=j3().clickDistance(A).on("start",B=>{const{domNode:Y,nodeDragThreshold:P,transform:U,snapGrid:C,snapToGrid:L}=t();d=(Y==null?void 0:Y.getBoundingClientRect())||null,p=!1,m=!1,y=B.sourceEvent,P===0&&I(B),i=cu(B.sourceEvent,{transform:U,snapGrid:C,snapToGrid:L,containerBounds:d}),u=cs(B.sourceEvent,d)}).on("drag",B=>{const{autoPanOnNodeDrag:Y,transform:P,snapGrid:U,snapToGrid:C,nodeDragThreshold:L,nodeLookup:O}=t(),j=cu(B.sourceEvent,{transform:P,snapGrid:U,snapToGrid:C,containerBounds:d});if(y=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||T&&!O.has(T))&&(p=!0),!p){if(!l&&Y&&f&&(l=!0,R()),!f){const S=cs(B.sourceEvent,d),H=S.x-u.x,V=S.y-u.y;Math.sqrt(H*H+V*V)>L&&I(B)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&o&&f&&(u=cs(B.sourceEvent,d),k(j))}}).on("end",B=>{if(!f||p){p&&o.size>0&&t().updateNodePositions(o,!1);return}if(l=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:Y,updateNodePositions:P,onNodeDragStop:U,onSelectionDragStop:C}=t();if(m&&(P(o,!1),m=!1),s||U||!T&&C){const[L,O]=C0({nodeId:T,dragItems:o,nodeLookup:Y,dragging:!1});s==null||s(B.sourceEvent,o,L,O),U==null||U(B.sourceEvent,L,O),T||C==null||C(B.sourceEvent,O)}}}).filter(B=>{const Y=B.target;return!B.button&&(!E||!zk(Y,`.${E}`,_))&&(!b||zk(Y,b,_))});h.call(M)}function g(){h==null||h.on(".drag",null)}return{update:w,destroy:g}}function Aae(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Zu(s,Al(i))>0&&r.push(i);return r}const Cae=250;function Iae(e,t,n,r){var o,l;let s=[],i=1/0;const a=Aae(e,n,t+Cae);for(const u of a){const d=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const f of d){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:p}=Qa(u,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m1){const u=r.type==="source"?"target":"source";return s.find(d=>d.type===u)??s[0]}return s[0]}function wD(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],l=(n?o==null?void 0:o.find(h=>h.id===n):o==null?void 0:o[0])??null;return l&&i?{...l,...Qa(a,l,l.position,!0)}:l}function vD(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Rae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const _D=()=>!0;function Oae(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:y,onConnectEnd:w,isValidConnection:g=_D,onReconnectEnd:E,updateConnection:b,getTransform:_,getFromHandle:N,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:k}){const R=uD(e.target);let I=0,M;const{x:B,y:Y}=cs(e),P=vD(i,k),U=o==null?void 0:o.getBoundingClientRect();let C=!1;if(!U||!P)return;const L=wD(s,P,r,l,t);if(!L)return;let O=cs(e,U),j=!1,S=null,H=!1,V=null;function D(){if(!d||!U)return;const[he,J]=Vx(O,U,T);h({x:he,y:J}),I=requestAnimationFrame(D)}const ne={...L,nodeId:s,type:P,position:L.position},ee=l.get(s);let de={inProgress:!0,isValid:null,from:Qa(ee,ne,De.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:ee,to:O,toHandle:null,toPosition:Rk[ne.position],toNode:null,pointer:O};function G(){C=!0,b(de),m==null||m(e,{nodeId:s,handleId:r,handleType:P})}A===0&&G();function W(he){if(!C){const{x:Le,y:ve}=cs(he),Ue=Le-B,Ie=ve-Y;if(!(Ue*Ue+Ie*Ie>A*A))return;G()}if(!N()||!ne){oe(he);return}const J=_();O=cs(he,U),M=Iae(Zl(O,J,!1,[1,1]),n,l,ne),j||(D(),j=!0);const ce=TD(he,{handle:M,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:g,doc:R,lib:u,flowId:f,nodeLookup:l});V=ce.handleDomNode,S=ce.connection,H=Rae(!!M,ce.isValid);const Ce=l.get(s),Ee=Ce?Qa(Ce,ne,De.Left,!0):de.from,ge={...de,from:Ee,isValid:H,to:ce.toHandle&&H?Cl({x:ce.toHandle.x,y:ce.toHandle.y},J):O,toHandle:ce.toHandle,toPosition:H&&ce.toHandle?ce.toHandle.position:Rk[ne.position],toNode:ce.toHandle?l.get(ce.toHandle.nodeId):null,pointer:O};b(ge),de=ge}function oe(he){if(!("touches"in he&&he.touches.length>0)){if(C){(M||V)&&S&&H&&(y==null||y(S));const{inProgress:J,...ce}=de,Ce={...ce,toPosition:de.toHandle?de.toPosition:null};w==null||w(he,Ce),i&&(E==null||E(he,Ce))}p(),cancelAnimationFrame(I),j=!1,H=!1,S=null,V=null,R.removeEventListener("mousemove",W),R.removeEventListener("mouseup",oe),R.removeEventListener("touchmove",W),R.removeEventListener("touchend",oe)}}R.addEventListener("mousemove",W),R.addEventListener("mouseup",oe),R.addEventListener("touchmove",W),R.addEventListener("touchend",oe)}function TD(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=_D,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${o}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=cs(e),y=a.elementFromPoint(p,m),w=y!=null&&y.classList.contains(`${o}-flow__handle`)?y:h,g={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const E=vD(void 0,w),b=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),N=w.classList.contains("connectable"),T=w.classList.contains("connectableend");if(!b||!E)return g;const A={source:f?b:r,sourceHandle:f?_:s,target:f?r:b,targetHandle:f?s:_};g.connection=A;const R=N&&T&&(n===kl.Strict?f&&E==="source"||!f&&E==="target":b!==r||_!==s);g.isValid=R&&u(A),g.toHandle=wD(b,E,_,d,n,!0)}return g}const W1={onPointerDown:Oae,isValid:TD};function Lae({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Ar(e);function i({translateExtent:o,width:l,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const _=n(),N=b.sourceEvent.ctrlKey&&Ju()?10:1,T=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,A=_[2]*Math.pow(2,T*N);t.scaleTo(A)};let y=[0,0];const w=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(y=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},g=b=>{const _=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const N=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],T=[N[0]-y[0],N[1]-y[1]];y=N;const A=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),k={x:_[0]-T[0]*A,y:_[1]-T[1]*A},R=[[0,0],[l,u]];t.setViewportConstrained({x:k.x,y:k.y,zoom:_[2]},R,o)},E=Z3().on("start",w).on("zoom",f?g:null).on("zoom.wheel",h?m:null);s.call(E,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:is}}const Hm=e=>({x:e.x,y:e.y,zoom:e.k}),I0=({x:e,y:t,zoom:n})=>Fm.translate(e,t).scale(n),Vo=(e,t)=>e.target.closest(`.${t}`),ND=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Mae=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,R0=(e,t=0,n=Mae,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},kD=e=>{const t=e.ctrlKey&&Ju()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Dae({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Vo(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=is(d),g=kD(d),E=f*Math.pow(2,g);r.scaleTo(n,E,w,d);return}const h=d.deltaMode===1?20:1;let p=s===Da.Vertical?0:d.deltaX*h,m=s===Da.Horizontal?0:d.deltaY*h;!Ju()&&d.shiftKey&&s!==Da.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const y=Hm(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(d,y))}}function Pae({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,o=Vo(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,s)}}function jae({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Hm(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Bae({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(n&&ND(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,Hm(i.transform)))}}function Fae({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&ND(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=Hm(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},n?150:0)}}}function Uae({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Vo(f,`${u}-flow__node`)||Vo(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||Vo(f,o)&&m||Vo(f,l)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const y=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&y}}function $ae({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=Z3().scaleExtent([t,n]).translateExtent(r),h=Ar(e).call(f);E({x:s.x,y:s.y,zoom:Sl(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(kD);async function y(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).transform(R0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}function w({noWheelClassName:M,noPanClassName:B,onPaneContextMenu:Y,userSelectionActive:P,panOnScroll:U,panOnDrag:C,panOnScrollMode:L,panOnScrollSpeed:O,preventScrolling:j,zoomOnPinch:S,zoomOnScroll:H,zoomOnDoubleClick:V,zoomActivationKeyPressed:D,lib:ne,onTransformChange:ee,connectionInProgress:re,paneClickDistance:de,selectionOnDrag:G}){P&&!u.isZoomingOrPanning&&g();const W=U&&!D&&!P;f.clickDistance(G?1/0:!ls(de)||de<0?0:de);const oe=W?Dae({zoomPanValues:u,noWheelClassName:M,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:O,zoomOnPinch:S,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Pae({noWheelClassName:M,preventScrolling:j,d3ZoomHandler:p});h.on("wheel.zoom",oe,{passive:!1});const he=jae({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});f.on("start",he);const J=Bae({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:ee});f.on("zoom",J);const ce=Fae({zoomPanValues:u,panOnDrag:C,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:o,onDraggingChange:l});f.on("end",ce);const Ce=Uae({zoomActivationKeyPressed:D,panOnDrag:C,zoomOnScroll:H,panOnScroll:U,zoomOnDoubleClick:V,zoomOnPinch:S,userSelectionActive:P,noPanClassName:B,noWheelClassName:M,lib:ne,connectionInProgress:re});f.filter(Ce),V?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function E(M,B,Y){const P=I0(M),U=f==null?void 0:f.constrain()(P,B,Y);return U&&await y(U),U}async function b(M,B){const Y=I0(M);return await y(Y,B),Y}function _(M){if(h){const B=I0(M),Y=h.property("__zoom");(Y.k!==M.zoom||Y.x!==M.x||Y.y!==M.y)&&(f==null||f.transform(h,B,null,{sync:!0}))}}function N(){const M=h?Q3(h.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}async function T(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).scaleTo(R0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}async function A(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).scaleBy(R0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}function k(M){f==null||f.scaleExtent(M)}function R(M){f==null||f.translateExtent(M)}function I(M){const B=!ls(M)||M<0?0:M;f==null||f.clickDistance(B)}return{update:w,destroy:g,setViewport:b,setViewportConstrained:E,getViewport:N,scaleTo:T,scaleBy:A,setScaleExtent:k,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var Il;(function(e){e.Line="line",e.Handle="handle"})(Il||(Il={}));function Hae({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,o=n-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function Vk(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function bi(e,t){return Math.max(0,t-e)}function Ei(e,t){return Math.max(0,e-t)}function zf(e,t,n){return Math.max(0,t-e,e-n)}function Kk(e,t){return e?!t:t}function zae(e,t,n,r,s,i,a,o){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:y,maxWidth:w,minHeight:g,maxHeight:E}=r,{x:b,y:_,width:N,height:T,aspectRatio:A}=e;let k=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=N+(l?-k:k),M=T+(u?-R:R),B=-i[0]*N,Y=-i[1]*T;let P=zf(I,y,w),U=zf(M,g,E);if(a){let O=0,j=0;l&&k<0?O=bi(b+k+B,a[0][0]):!l&&k>0&&(O=Ei(b+I+B,a[1][0])),u&&R<0?j=bi(_+R+Y,a[0][1]):!u&&R>0&&(j=Ei(_+M+Y,a[1][1])),P=Math.max(P,O),U=Math.max(U,j)}if(o){let O=0,j=0;l&&k>0?O=Ei(b+k,o[0][0]):!l&&k<0&&(O=bi(b+I,o[1][0])),u&&R>0?j=Ei(_+R,o[0][1]):!u&&R<0&&(j=bi(_+M,o[1][1])),P=Math.max(P,O),U=Math.max(U,j)}if(s){if(d){const O=zf(I/A,g,E)*A;if(P=Math.max(P,O),a){let j=0;!l&&!u||l&&!u&&h?j=Ei(_+Y+I/A,a[1][1])*A:j=bi(_+Y+(l?k:-k)/A,a[0][1])*A,P=Math.max(P,j)}if(o){let j=0;!l&&!u||l&&!u&&h?j=bi(_+I/A,o[1][1])*A:j=Ei(_+(l?k:-k)/A,o[0][1])*A,P=Math.max(P,j)}}if(f){const O=zf(M*A,y,w)/A;if(U=Math.max(U,O),a){let j=0;!l&&!u||u&&!l&&h?j=Ei(b+M*A+B,a[1][0])/A:j=bi(b+(u?R:-R)*A+B,a[0][0])/A,U=Math.max(U,j)}if(o){let j=0;!l&&!u||u&&!l&&h?j=bi(b+M*A,o[1][0])/A:j=Ei(b+(u?R:-R)*A,o[0][0])/A,U=Math.max(U,j)}}}R=R+(R<0?U:-U),k=k+(k<0?P:-P),s&&(h?I>M*A?R=(Kk(l,u)?-k:k)/A:k=(Kk(l,u)?-R:R)*A:d?(R=k/A,u=l):(k=R*A,l=u));const C=l?b+k:b,L=u?_+R:_;return{width:N+(l?-k:k),height:T+(u?-R:R),x:i[0]*k*(l?-1:1)+C,y:i[1]*R*(u?-1:1)+L}}const SD={width:0,height:0,x:0,y:0},Vae={...SD,pointerX:0,pointerY:0,aspectRatio:1};function Kae(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=n[0]*i,l=n[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function Yae({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=Ar(e);let a={controlDirection:Vk("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:y,shouldResize:w}){let g={...SD},E={...Vae};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:Vk(u)};let b,_=null,N=[],T,A,k,R=!1;const I=j3().on("start",M=>{const{nodeLookup:B,transform:Y,snapGrid:P,snapToGrid:U,nodeOrigin:C,paneDomNode:L}=n();if(b=B.get(t),!b)return;_=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:j}=cu(M.sourceEvent,{transform:Y,snapGrid:P,snapToGrid:U,containerBounds:_});g={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},E={...g,pointerX:O,pointerY:j,aspectRatio:g.width/g.height},T=void 0,A=Xa(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(T=B.get(b.parentId)),T&&b.extent==="parent"&&(A=[[0,0],[T.measured.width,T.measured.height]]),N=[],k=void 0;for(const[S,H]of B)if(H.parentId===t&&(N.push({id:S,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const V=Kae(H,b,H.origin??C);k?k=[[Math.min(V[0][0],k[0][0]),Math.min(V[0][1],k[0][1])],[Math.max(V[1][0],k[1][0]),Math.max(V[1][1],k[1][1])]]:k=V}p==null||p(M,{...g})}).on("drag",M=>{const{transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U}=n(),C=cu(M.sourceEvent,{transform:B,snapGrid:Y,snapToGrid:P,containerBounds:_}),L=[];if(!b)return;const{x:O,y:j,width:S,height:H}=g,V={},D=b.origin??U,{width:ne,height:ee,x:re,y:de}=zae(E,a.controlDirection,C,a.boundaries,a.keepAspectRatio,D,A,k),G=ne!==S,W=ee!==H,oe=re!==O&&G,he=de!==j&&W;if(!oe&&!he&&!G&&!W)return;if((oe||he||D[0]===1||D[1]===1)&&(V.x=oe?re:g.x,V.y=he?de:g.y,g.x=V.x,g.y=V.y,N.length>0)){const Ee=re-O,ge=de-j;for(const Le of N)Le.position={x:Le.position.x-Ee+D[0]*(ne-S),y:Le.position.y-ge+D[1]*(ee-H)},L.push(Le)}if((G||W)&&(V.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:g.width,V.height=W&&(!a.resizeDirection||a.resizeDirection==="vertical")?ee:g.height,g.width=V.width,g.height=V.height),T&&b.expandParent){const Ee=D[0]*(V.width??0);V.x&&V.x{R&&(y==null||y(M,{...g}),s==null||s({...g}),R=!1)});i.call(I)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}var AD={exports:{}},CD={},ID={exports:{}},RD={};/** +`);if(!n.length||n[0].trim()!=="---")throw new Vi(`${t} 的 SKILL.md 必须以 YAML frontmatter (--- ... ---) 开头`);let r=-1;for(let o=1;o=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function Ote(e,t){if(!e)throw new Vi(`${t} 的 SKILL.md 缺少必填的 name frontmatter`);if(e.length>64)throw new Vi(`${t} 的 name 长度超过 64 个字符`);if(!/^[a-z0-9-]+$/.test(e))throw new Vi(`${t} 的 name 必须匹配 [a-z0-9-]+(小写字母、数字、短横线)`)}function Lte(e,t){if(!e)throw new Vi(`${t} 的 SKILL.md 缺少必填的 description frontmatter`);if(e.length>1024)throw new Vi(`${t} 的 description 长度超过 1024 个字符`);if(/<[^>]+>/.test(e))throw new Vi(`${t} 的 description 不能包含 XML 标签`)}function f3(e){const t=e.map(r=>({path:r.path.replace(/\\/g,"/").replace(/^\.\//,""),text:r.text})).filter(r=>r.path.length>0&&!r.path.endsWith("/")),n=new Set(t.map(r=>r.path.split("/")[0]));if(n.size===1&&t.every(r=>r.path.includes("/"))){const r=[...n][0]+"/";return t.map(s=>({path:s.path.slice(r.length),text:s.text}))}return t}function Mte(e){const t=new Map,n=new Set;for(const r of e)if(L1.test("/"+r.path)){const s=r.path.split("/");n.add(s.slice(0,-1).join("/"))}for(const r of e){const s=r.path.split("/");let i="";for(let u=s.length-1;u>=0;u--){const d=s.slice(0,u).join("/");if(n.has(d)){i=d;break}}const a=L1.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const o=i?r.path.slice(i.length+1):r.path,l=t.get(i)||[];l.push({path:o,text:r.text}),t.set(i,l)}return t}function Dte(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(l=>L1.test("/"+l.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};let i;try{i=Ite(s.text,r)}catch(l){return{hit:null,error:l instanceof Error?l.message:String(l)}}const a=i.name,o=[];for(const l of t){if(l.path.split("/").some(f=>f===".."))return{hit:null,error:`${r} 包含非法路径(..):${l.path}`};const d=`skills/${a}/${l.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${r} 包含非法路径:${l.path}`};o.push({path:d,content:l.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:i.name,description:i.description,folder:a,localFiles:o},error:null}}async function Pte(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await Nte(t)).map(s=>({path:s.name,text:s.text}));return h3(f3(r),e.name)}async function jte(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function Fte(e){const t=e.createReader(),n=[];for(;;){const r=await new Promise((s,i)=>t.readEntries(s,i));if(r.length===0)return n;n.push(...r)}}async function p3(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await Bte(e),path:n}];if(!e.isDirectory)return[];const r=await Fte(e);return(await Promise.all(r.map(s=>p3(s,n)))).flat()}function Ute({selected:e,onChange:t}){const[n,r]=v.useState([]),[s,i]=v.useState([]),[a,o]=v.useState(!1),[l,u]=v.useState(!1),d=v.useRef(0),f=b=>e.some(_=>_.source==="local"&&_.folder===b),h=b=>{b.localFiles&&(f(b.folder||b.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(b.folder||b.name)))):t([...e,{source:"local",folder:b.folder||b.name,name:b.name,description:b.description,localFiles:b.localFiles}]))},p=v.useRef([]),m=v.useRef(e);v.useEffect(()=>{p.current=s},[s]),v.useEffect(()=>{m.current=e},[e]);const y=b=>{const _=new Set([...p.current.map(N=>N.folder||N.name),...m.current.filter(N=>N.source==="local").map(N=>N.folder)]),k=[],T=[];for(const N of b.hits){const R=N.folder||N.name;if(_.has(R)){k.push(N.name);continue}_.add(R),T.push(N)}i(N=>[...N,...T]);const A=[...b.errors];if(k.length>0&&A.push(`已跳过重复技能:${k.join("、")}`),r(A),T.length===1&&b.errors.length===0&&k.length===0){const N=T[0];N.localFiles&&t([...m.current,{source:"local",folder:N.folder||N.name,name:N.name,description:N.description,localFiles:N.localFiles}])}},w=b=>{b.preventDefault(),d.current+=1,u(!0)},g=b=>{b.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},E=async b=>{if(b.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(b.dataTransfer.items).map(k=>{var T;return(T=k.webkitGetAsEntry)==null?void 0:T.call(k)}).filter(k=>k!==null);if(_.length===0){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}o(!0);try{const k=(await Promise.all(_.map(N=>p3(N)))).flat(),T=_.some(N=>N.isDirectory);if(!T&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){y(await Pte(k[0].file));return}if(!T){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const A=new Map(k.map(({file:N,path:R})=>[N,R]));y(await jte(k.map(({file:N})=>N),A))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{o(!1)}};return c.jsxs("div",{className:"cw-local",children:[c.jsxs("div",{className:`cw-local-dropzone ${l?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:b=>b.preventDefault(),onDragLeave:g,onDrop:b=>void E(b),children:[c.jsx(NE,{className:"cw-local-drop-icon","aria-hidden":!0}),c.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),c.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md(含 name / description frontmatter)。支持包含多个技能的目录。"}),a&&c.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:n.join(";")})]}),s.length>0&&c.jsx("div",{className:"cw-skill-results",children:s.map(b=>{var k;const _=f(b.folder||b.name);return c.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(b),"aria-pressed":_,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(b.description)}),c.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=b.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},b.id)})})]})}function $te({selected:e,onChange:t}){const[n,r]=v.useState([]),[s,i]=v.useState([]),[a,o]=v.useState(""),[l,u]=v.useState(!0),[d,f]=v.useState(!1),[h,p]=v.useState(null);v.useEffect(()=>{let g=!1;return(async()=>{u(!0),p(null);try{const E=await hU();g||(r(E),E.length>0&&o(E[0].id))}catch(E){g||p(E instanceof Error?E.message:"加载失败")}finally{g||u(!1)}})(),()=>{g=!0}},[]),v.useEffect(()=>{if(!a){i([]);return}const g=n.find(b=>b.id===a);let E=!1;return(async()=>{f(!0),p(null);try{const b=await mU(a,g==null?void 0:g.region);E||i(b)}catch(b){E||p(b instanceof Error?b.message:"加载失败")}finally{E||f(!1)}})(),()=>{E=!0}},[a,n]);const m=n.find(g=>g.id===a),y=(g,E)=>e.some(b=>b.source==="skillspace"&&b.skillId===g&&(b.version||"")===E),w=g=>{if(m)if(y(g.skillId,g.version))t(e.filter(E=>!(E.source==="skillspace"&&E.skillId===g.skillId&&(E.version||"")===g.version)));else{const E=bU(m,g);t([...e,{source:"skillspace",folder:E.folder||g.skillName,name:E.name,description:E.description,skillSpaceId:E.skillSpaceId,skillSpaceName:E.skillSpaceName,skillSpaceRegion:E.skillSpaceRegion,skillId:E.skillId,version:E.version}])}};return c.jsx("div",{className:"cw-skillspace",children:l?c.jsxs("p",{className:"cw-empty-line",children:[c.jsx(bt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?c.jsxs("div",{className:"cw-banner",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:h})]}):n.length===0?c.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"cw-skillspace-header",children:[c.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:g=>o(g.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(g=>c.jsxs("option",{value:g.id,children:[g.name||g.id,g.region?` [${g.region}]`:"",g.description?` — ${Zr(g.description)}`:""]},g.id))}),m&&c.jsx("a",{href:EU(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:c.jsx(kE,{className:"cw-i cw-i-sm"})})]}),d?c.jsxs("p",{className:"cw-empty-line",children:[c.jsx(bt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?c.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):c.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const E=y(g.skillId,g.version);return c.jsxs("button",{type:"button",className:`cw-skill-result ${E?"is-on":""}`,onClick:()=>w(g),"aria-pressed":E,children:[c.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:E?c.jsx(Bs,{className:"cw-i cw-i-sm"}):c.jsx(ms,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-skill-result-meta",children:[c.jsxs("span",{className:"cw-skill-result-name",children:[g.skillName,g.version&&c.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",g.version]})]}),g.skillDescription&&c.jsx("span",{className:"cw-skill-result-desc",children:Zr(g.skillDescription)}),c.jsxs("span",{className:"cw-skill-result-repo",children:[c.jsx(dF,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${g.skillId}/${g.version}`)})})]})})}async function Hte(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ds(void 0,dd)});if(t.status===409)throw new Error("服务端未配置 Volcengine AK/SK,无法访问 AgentKit 智能体中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit 智能体中心");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function zte(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await Hte(`/web/a2a-spaces?${t.toString()}`)).items||[]}const Vte=v.lazy(()=>tl(()=>import("./MarkdownPromptEditor-BBPnStN4.js"),__vite__mapDeps([0,1])));function Kte(e,t,n="text/plain"){const r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),s=document.createElement("a");s.href=r,s.download=e,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(r)}const lN=[{id:"type",label:"类型",hint:"选择 Agent 类型",icon:BF,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:Bl,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:kI},{id:"tools",label:"工具",hint:"可调用的能力",icon:CE},{id:"skills",label:"技能",hint:"声明式技能",icon:za},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:lh},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:OI},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:_I},{id:"review",label:"完成",hint:"预览并创建",icon:PF}];function Yte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"m7.2 15.8 7.9-7.9a2 2 0 0 1 2.8 0l1.2 1.2a2 2 0 0 1 0 2.8l-7 7H8.7l-1.5-1.5a1.15 1.15 0 0 1 0-1.6Z"}),c.jsx("path",{d:"m12.7 10.3 4 4"}),c.jsx("path",{d:"M6.3 19h12.4"}),c.jsx("path",{d:"m5.5 8.2.5-1.4 1.4-.5L6 5.8l-.5-1.4L5 5.8l-1.4.5 1.4.5.5 1.4Z"})]})}function Wte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"3.25",y:"4.25",width:"17.5",height:"15.5",rx:"2.75"}),c.jsx("path",{d:"M3.75 8.75h16.5"}),c.jsx("circle",{cx:"6.35",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"8.85",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none",opacity:"0.45"}),c.jsx("path",{d:"M6 14h2.2l1.35-2.8 2.1 5.5 1.7-3.1H18"})]})}function qte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),c.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),c.jsx("path",{d:"M3 10v4",opacity:"0.45"}),c.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function Gte({className:e}){return c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:"m8.75 9.5 3.25 3.25 3.25-3.25"})})}function Xte({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),c.jsx("path",{d:"M4.5 4.75v3.5H8"}),c.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),c.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const x0=4,Qte={llm:"LLM 智能体",sequential:"顺序型智能体",parallel:"并行型智能体",loop:"循环型智能体",a2a:"远程智能体"},cN={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},m3="REGISTRY_SPACE_ID",Zte=QM.filter(e=>e.key!==m3);function g3(e,t){var r,s,i;if(!(e!=null&&e.enabled))return{};const n={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(n.REGISTRY_TOP_K=((r=e.registryTopK)==null?void 0:r.trim())||hs.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||hs.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||hs.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function uN({items:e,selected:t,onToggle:n,scrollRows:r}){return c.jsx("div",{className:`cw-checklist ${r?"cw-checklist-tools":""}`,style:r?{"--cw-checklist-max-height":`${r*65+(r-1)*8}px`}:void 0,children:e.map(s=>{const i=t.includes(s.id);return c.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[c.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&c.jsx(Bs,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-check-text",children:[c.jsx("span",{className:"cw-check-title",children:s.label}),c.jsx("span",{className:"cw-check-desc",children:Zr(s.desc)})]})]},s.id)})})}function w0({options:e,value:t,onChange:n}){return c.jsx("div",{className:"cw-segmented",children:e.map(r=>{var i;const s=(t??((i=e[0])==null?void 0:i.id))===r.id;return c.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Zr(r.desc),children:[c.jsx("span",{className:"cw-seg-title",children:r.label}),c.jsx("span",{className:"cw-seg-desc",children:Zr(r.desc)})]},r.id)})})}function Jte(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function xc({env:e,values:t,onChange:n}){return e.length===0?c.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):c.jsx("div",{className:"cw-env-fields",children:e.map(r=>c.jsxs("label",{className:"cw-env-field",children:[c.jsxs("span",{className:"cw-env-field-head",children:[c.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&c.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&c.jsx("code",{title:r.key,children:r.key})]}),c.jsx("input",{className:"cw-input",type:Jte(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function dN(e){return e.name.trim()||"未命名智能体中心"}function ene({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||hs.region,[i,a]=v.useState([]),[o,l]=v.useState(!1),[u,d]=v.useState(null),[f,h]=v.useState(0),[p,m]=v.useState(!1),y=v.useRef(null);v.useEffect(()=>{let k=!1;return l(!0),d(null),zte({region:s}).then(T=>{k||a(T)}).catch(T=>{k||(a([]),d(T instanceof Error?T.message:"加载失败"))}).finally(()=>{k||l(!1)}),()=>{k=!0}},[s,f]);const w=!e||i.some(k=>k.id===e.trim()),g=i.find(k=>k.id===e.trim()),E=g?dN(g):e&&!w?"已选择的智能体中心":"请选择智能体中心",b=o&&i.length===0;v.useEffect(()=>{if(!p)return;const k=A=>{const N=A.target;N instanceof Node&&y.current&&!y.current.contains(N)&&m(!1)},T=A=>{A.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",k),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",k),window.removeEventListener("keydown",T)}},[p]);const _=k=>{r(k),m(!1)};return c.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[c.jsxs("div",{className:"cw-a2a-space-row",children:[c.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[c.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:b,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>m(k=>!k),children:[c.jsx("span",{children:E}),c.jsx(Gte,{className:"cw-a2a-space-trigger-icon"})]}),p&&c.jsxs("div",{className:"cw-a2a-space-menu",role:"listbox","aria-label":"AgentKit 智能体中心",children:[c.jsx("button",{type:"button",role:"option","aria-selected":!e,className:`cw-a2a-space-option ${e?"":"is-selected"}`,onClick:()=>_(""),children:"请选择智能体中心"}),e&&!w&&c.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>_(e),children:"已选择的智能体中心"}),i.map(k=>{const T=dN(k),A=k.id===e;return c.jsx("button",{type:"button",role:"option","aria-selected":A,className:`cw-a2a-space-option ${A?"is-selected":""}`,title:T,onClick:()=>_(k.id),children:T},k.id)})]})]}),c.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:o,onClick:()=>h(k=>k+1),children:o?c.jsx(bt,{className:"cw-i cw-i-sm cw-spin"}):c.jsx(Xte,{className:"cw-i cw-i-sm"})})]}),u?c.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[c.jsx(Bl,{className:"cw-i"}),c.jsx("span",{children:u})]}):o?c.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[c.jsx(bt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?c.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):c.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function tne({tools:e,onChange:t}){const n=(i,a)=>t(e.map((o,l)=>l===i?{...o,...a}:o)),r=i=>t(e.filter((a,o)=>o!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return c.jsxs("div",{className:"cw-mcp",children:[e.length>0&&c.jsx("div",{className:"cw-mcp-list",children:c.jsx(Hi,{initial:!1,children:e.map((i,a)=>c.jsxs(Gt.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[c.jsxs("div",{className:"cw-mcp-rowhead",children:[c.jsxs("div",{className:"cw-mcp-transport",children:[c.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${i.transport==="http"?"is-on":""}`,onClick:()=>n(a,{transport:"http"}),"aria-pressed":i.transport==="http",children:c.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),c.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${i.transport==="stdio"?"is-on":""}`,onClick:()=>n(a,{transport:"stdio"}),"aria-pressed":i.transport==="stdio",children:c.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),c.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:c.jsx(Fl,{className:"cw-i cw-i-sm"})})]}),c.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:o=>n(a,{name:o.target.value})}),i.transport==="http"?c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:o=>n(a,{url:o.target.value})}),c.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:o=>n(a,{authToken:o.target.value})})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:o=>n(a,{command:o.target.value})}),c.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:o=>n(a,{args:o.target.value.split(/\s+/).filter(Boolean)})}),c.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),c.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[c.jsx(ms,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&c.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function y3({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),c.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),c.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),c.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function nne({s:e,onRemove:t}){let n=za,r="火山 Find Skill 技能广场";return e.source==="local"?(n=NE,r="本地"):e.source==="skillspace"&&(n=y3,r="AgentKit Skills 中心"),c.jsxs(Gt.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[c.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:c.jsx(n,{className:"cw-i cw-i-sm"})}),c.jsxs("span",{className:"cw-selected-skill-meta",children:[c.jsx("span",{className:"cw-selected-skill-name",children:e.name}),c.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Zr(e.description)}`:""]})]}),c.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:c.jsx(Xr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const v0=[{id:"local",label:"本地文件",icon:NE},{id:"skillspace",label:"AgentKit Skills 中心",icon:y3},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:um}];function rne({selected:e,onChange:t}){const[n,r]=v.useState("local"),[s,i]=v.useState(!1),a=v0.findIndex(l=>l.id===n),o=l=>t(e.filter(u=>_0(u)!==l));return v.useEffect(()=>{if(!s)return;const l=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[s]),c.jsxs("div",{className:"cw-skillspane",children:[c.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[c.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:c.jsx(ms,{className:"cw-i"})}),c.jsx("span",{children:"添加 Skill"})]}),e.length>0&&c.jsxs("div",{className:"cw-skill-selected",children:[c.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),c.jsx("div",{className:"cw-selected-skill-list",children:c.jsx(Hi,{initial:!1,children:e.map(l=>c.jsx(nne,{s:l,onRemove:()=>o(_0(l))},_0(l)))})})]}),c.jsx(Hi,{children:s&&c.jsx(Gt.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:l=>{l.target===l.currentTarget&&i(!1)},children:c.jsxs(Gt.div,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"cw-skill-dialog-title",initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-skill-dialog-head",children:[c.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),c.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:c.jsx(Xr,{className:"cw-i"})})]}),c.jsxs("div",{className:"cw-skill-dialog-body",children:[c.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${v0.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[c.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),v0.map(({id:l,label:u,icon:d})=>c.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${l}`,"aria-controls":"cw-skill-tabpanel","aria-selected":n===l,className:`cw-skill-pickertab ${n===l?"is-on":""}`,onClick:()=>r(l),children:[c.jsx(d,{className:"cw-i cw-i-sm"}),u]},l))]}),c.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&c.jsx(Cte,{selected:e,onChange:t}),n==="local"&&c.jsx(Ute,{selected:e,onChange:t}),n==="skillspace"&&c.jsx($te,{selected:e,onChange:t})]})]})]})})})]})}function _0(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function wc({checked:e,onChange:t,title:n,desc:r,icon:s}){return c.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[c.jsx("span",{className:"cw-toggle-icon",children:c.jsx(s,{className:"cw-i"})}),c.jsxs("span",{className:"cw-toggle-text",children:[c.jsx("span",{className:"cw-toggle-title",children:n}),c.jsx("span",{className:"cw-toggle-desc",children:Zr(r)})]}),c.jsx("span",{className:"cw-switch","aria-hidden":!0,children:c.jsx(Gt.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}const fN=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]);function sne(e,t){var r;let n=e;for(const s of t)if(n=(r=n.subAgents)==null?void 0:r[s],!n)return!1;return!0}function wh(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Rd(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Rd(i[r],s,n),{...e,subAgents:i}}function ine(e,t){return Rd(e,t,n=>({...n,subAgents:[...n.subAgents,Xi()]}))}function ane(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Rd(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}function one(e,t,n,r){return Rd(e,t,s=>{const i=s.subAgents.slice(),[a]=i.splice(n,1);return i.splice(r,0,a),{...s,subAgents:i}})}const lne=e=>e==="sequential"||e==="loop",b3=e=>!Id(e.agentType),cne=3;function E3(e,t,n=!1){var s;if(Id(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const r=nl(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":a3(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function x3(e,t,n=[]){const r=[],s=Id(e.agentType),i=E3(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),b3(e)&&e.subAgents.forEach((a,o)=>r.push(...x3(a,t,[...n,o]))),r}function w3(e){return 1+e.subAgents.reduce((t,n)=>t+w3(n),0)}function une(e){const t=[],n={},r=i=>{var a,o,l,u;for(const d of i.builtinTools??[]){const f=Ox.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:QM}),Object.assign(n,g3(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((o=Np.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:o.env)??[]}),i.memory.longTerm&&t.push({env:((l=Sp.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:l.env)??[]}),i.knowledgebase&&t.push({env:((u=Ap.find(d=>d.id===(i.knowledgebaseBackend??"local")))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=Cp.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=o3(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function v3({root:e,path:t,selectedPath:n,duplicateNames:r,showErrors:s,validationPulse:i,onSelect:a,onChange:o,onClearRoot:l}){const u=wh(e,t),d=Lx(u.agentType),f=d.icon,h=t.length===0,p=fN(t,n),m=b3(u),y=m&&t.length{const A=ine(e,t),N=wh(A,t).subAgents.length-1;o(A,[...t,N])},g=()=>o(ane(e,t),t.slice(0,-1)),E=t.slice(0,-1),b=!h&&lne(wh(e,E).agentType),[_,k]=v.useState(!1),T=A=>{A.preventDefault(),A.stopPropagation(),k(!1);const N=A.dataTransfer.getData("application/x-agent-path");if(!N)return;let R;try{R=JSON.parse(N)}catch{return}if(!fN(R.slice(0,-1),E))return;const I=R[R.length-1],M=t[t.length-1];I!==M&&o(one(e,E,I,M),[...E,M])};return c.jsxs("div",{className:"cw-tree-branch",children:[c.jsxs("div",{className:`cw-tree-node cw-tree-type-${u.agentType??"llm"} ${p?"is-selected":""} ${b?"is-draggable":""} ${_?"is-dragover":""} ${s&&E3(u,r,h)?`is-invalid cw-error-shake-${i%2}`:""}`,role:"button",tabIndex:0,draggable:b,onDragStart:b?A=>{A.dataTransfer.setData("application/x-agent-path",JSON.stringify(t)),A.dataTransfer.effectAllowed="move",A.stopPropagation()}:void 0,onDragOver:b?A=>{A.preventDefault(),k(!0)}:void 0,onDragLeave:b?()=>k(!1):void 0,onDrop:b?T:void 0,onClick:()=>a(t),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),a(t))},children:[c.jsx(f,{className:"cw-tree-icon"}),c.jsxs("span",{className:"cw-tree-main",children:[c.jsx("span",{className:"cw-tree-name",children:Id(u.agentType)?"远程 Agent":u.name.trim()||"未命名"}),c.jsx("span",{className:"cw-tree-type",children:d.label})]}),c.jsxs("span",{className:"cw-tree-actions",children:[h&&c.jsx("button",{type:"button",className:"cw-icon-btn cw-tree-clear",title:"清空根 Agent","aria-label":"清空根 Agent",onClick:A=>{A.stopPropagation(),l()},children:c.jsx(Yte,{className:"cw-i cw-i-sm"})}),y&&c.jsx("button",{type:"button",className:"cw-icon-btn",title:"添加子 Agent",onClick:A=>{A.stopPropagation(),w()},children:c.jsx(ms,{className:"cw-i cw-i-sm"})}),!h&&c.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",title:"删除",onClick:A=>{A.stopPropagation(),g()},children:c.jsx(Fl,{className:"cw-i cw-i-sm"})})]})]}),m&&u.subAgents.length>0&&c.jsx("div",{className:"cw-tree-children",children:u.subAgents.map((A,N)=>c.jsx(v3,{root:e,path:[...t,N],selectedPath:n,duplicateNames:r,showErrors:s,validationPulse:i,onSelect:a,onChange:o,onClearRoot:l},N))})]})}function vh(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function hN(e){return JSON.stringify(vh(e))}function dne({enabled:e,disabledReason:t,phase:n,stale:r,run:s,projectName:i,logs:a,messages:o,input:l,error:u,deploying:d,deployError:f,onInput:h,onSend:p,onRestart:m,onIgnoreChanges:y,onDeploy:w}){const[g,E]=v.useState(!1),b=n==="ready"||n==="sending",_=n==="building"||n==="starting"||n==="sending",k=e&&!s&&n==="idle",T=e&&(n==="building"||n==="starting"),A=!!(s&&r&&!T);return g?c.jsx("aside",{className:"cw-debug is-collapsed","aria-label":"调试窗口(已收起)",children:c.jsx("button",{type:"button",className:"cw-debug-expand",onClick:()=>E(!1),"aria-label":"展开调试栏",title:"展开调试栏",children:c.jsx(Wte,{className:"cw-i"})})}):c.jsxs("aside",{className:"cw-debug","aria-label":"调试窗口",children:[c.jsxs("div",{className:"cw-debug-head",children:[c.jsxs("div",{className:"cw-debug-title",children:[c.jsx("button",{type:"button",className:"cw-debug-collapse",onClick:()=>E(!0),"aria-label":"收起调试栏",title:"收起调试栏",children:c.jsx(lr,{className:"cw-i cw-i-sm"})}),c.jsx("span",{children:"调试"})]}),c.jsx("div",{className:"cw-debug-head-actions",children:c.jsxs("button",{type:"button",className:"cw-debug-deploy",disabled:d,onClick:w,title:"查看源码、填写环境变量并部署",children:["去部署",d?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(xI,{className:"cw-i"})]})})]}),!s&&n==="idle"&&!e&&c.jsx("div",{className:"cw-debug-sub",children:c.jsx("span",{children:t})}),f&&c.jsx("div",{className:"cw-debug-deploy-error",role:"alert",children:f}),c.jsxs("div",{className:"cw-debug-stage",children:[c.jsx("div",{className:"cw-debug-body",children:e?n==="error"?c.jsxs("div",{className:"cw-debug-error",children:[c.jsx(Ip,{message:u||"调试失败",className:"cw-debug-error-detail",onRetry:async()=>{await m()}}),a.length>0&&c.jsx("div",{className:"cw-debug-progress",children:a.map((N,R)=>c.jsx("div",{className:"cw-debug-logline",children:c.jsx("span",{children:N})},`${N}-${R}`))})]}):c.jsx("div",{className:"cw-debug-chat",children:o.length===0?c.jsx("div",{className:"cw-debug-chat-empty",children:"输入消息开始验证当前 Agent。"}):o.map((N,R)=>c.jsxs("div",{className:`cw-debug-msg cw-debug-msg-${N.role}`,children:[c.jsx("div",{className:"cw-debug-role",children:N.role==="user"?"你":i||"Agent"}),c.jsx("div",{className:"cw-debug-content",children:N.role==="user"?N.content:N.error?c.jsx(Ip,{message:N.error,className:"cw-debug-msg-error"}):N.blocks&&N.blocks.length>0?c.jsx(mx,{blocks:N.blocks,onAction:()=>{}}):N.content?N.content:R===o.length-1&&n==="sending"?c.jsx(dM,{}):null})]},R))}):c.jsx("div",{className:"cw-debug-empty",children:t})}),c.jsx("div",{className:"cw-debug-composer",children:c.jsxs("div",{className:"cw-debug-composerbox",children:[c.jsx("textarea",{className:"cw-debug-input",rows:1,value:l,placeholder:r?"更新 Agent 后可继续调试":b?"输入测试消息...":"调试环境启动后可输入",disabled:!b||_||r,onChange:N=>h(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),p())}}),c.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!b||_||r||!l.trim(),onClick:p,children:n==="sending"?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(wI,{className:"cw-i"})})]})}),(k||T||A)&&c.jsx("div",{className:"cw-debug-overlay",role:"status","aria-live":"polite",children:c.jsxs("div",{className:"cw-debug-overlay-content",children:[c.jsx("strong",{className:"cw-debug-overlay-title",children:T?"正在初始化调试环境":A?"Agent 配置已变更":"启动调试环境"}),T?c.jsx("div",{className:"cw-debug-overlay-progress",children:a.map((N,R)=>c.jsxs("div",{className:"cw-debug-logline",children:[R===a.length-1?c.jsx(bt,{className:"cw-i cw-spin"}):c.jsx(Bs,{className:"cw-i"}),c.jsx("span",{children:N})]},`${N}-${R}`))}):A?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"cw-debug-overlay-copy",children:"当前对话仍在使用上一次配置。更新后,新配置才会生效。"}),c.jsxs("div",{className:"cw-debug-overlay-actions",children:[c.jsx("button",{type:"button",className:"cw-debug-ignore",disabled:_,onClick:y,children:"忽略"}),c.jsxs("button",{type:"button",className:"cw-debug-start",disabled:_,onClick:m,children:[c.jsx(SE,{className:"cw-i"}),"更新 Agent"]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"cw-debug-overlay-copy",children:"启动后会生成代码并创建临时运行环境。"}),c.jsxs("button",{type:"button",className:"cw-debug-start",onClick:m,children:[c.jsx(qte,{className:"cw-i cw-debug-run-icon"}),"启动调试环境"]})]})]})})]})]})}function fne({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i}){var Pn,tr,zn,An,st,Cn,Bt,Jt,In,jn,wn,nr,Ot;const[a,o]=v.useState(()=>r??Xi()),[l,u]=v.useState(!1),[d,f]=v.useState(0),[h,p]=v.useState(null),[m,y]=v.useState(!1),[w,g]=v.useState("cn-beijing"),E=(s==null?void 0:s.generatedAgentTestRun)===!0,b=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[_,k]=v.useState("idle"),[T,A]=v.useState(null),N=v.useRef(null),[R,I]=v.useState(null),[M,B]=v.useState(""),[Y,P]=v.useState([]),[U,C]=v.useState([]),[L,O]=v.useState(""),[j,S]=v.useState(null),[H,V]=v.useState(""),[D,ne]=v.useState(""),[ee,re]=v.useState("basic"),[de,G]=v.useState(""),[W,oe]=v.useState(!1),[he,J]=v.useState(!1),[ce,Ce]=v.useState(!1),[Ee,ge]=v.useState([]),Le=v.useRef(null),ve=v.useRef({});v.useEffect(()=>()=>{const Z=N.current;Z&&r1(Z.runId).catch(Ne=>console.warn("清理调试运行失败",Ne))},[]);const Ue=v.useRef(null);Ue.current||(Ue.current=({meta:Z,children:Ne})=>c.jsxs("section",{ref:Me=>{ve.current[Z.id]=Me},id:`cw-sec-${Z.id}`,"data-step-id":Z.id,className:"cw-section",children:[c.jsx("header",{className:"cw-sec-head",children:c.jsxs("h2",{className:"cw-sec-title",children:[Z.label,Z.required&&c.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),Ne]}));const Ie=sne(a,Ee)?Ee:[],ae=wh(a,Ie),wt=Ie.length===0,we=`cw-model-advanced-${Ie.join("-")||"root"}`,vt=`cw-more-tool-types-${Ie.join("-")||"root"}`,ct=`cw-advanced-config-${Ie.join("-")||"root"}`,K=Math.max(0,Df.findIndex(Z=>Z.id===(ae.agentType??"llm"))),X=Z=>o(Ne=>Rd(Ne,Ie,Me=>({...Me,...Z}))),le=(Z,Ne)=>o(Me=>{var He;return{...Me,deployment:{...Me.deployment??{feishuEnabled:!1},envValues:{...((He=Me.deployment)==null?void 0:He.envValues)??{},[Z]:Ne}}}}),ke=Z=>X({a2aRegistry:{...ae.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...Z}}),Re=(Z,Ne)=>{if(!(Z in cN))return;const Me=cN[Z];ke({[Me]:Ne}),le(Z,Ne)},ut=Z=>{if(!(wt&&Z==="a2a")){if(Z==="a2a"){X({agentType:Z,a2aRegistry:{...ae.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}X({agentType:Z,a2aRegistry:ae.a2aRegistry?{...ae.a2aRegistry,enabled:!1}:void 0})}},We=(Z,Ne)=>{o(Z),Ne&&ge(Ne)},ot=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(o(Xi()),ge([]),u(!1),Ce(!1))},Zt=ae.builtinTools??[],Ct=ae.mcpTools??[],Ge=ae.tracingExporters??[],Et=ae.selectedSkills??[],Ht=[ae.memory.shortTerm,ae.memory.longTerm,ae.tracing].filter(Boolean).length,kn=Z=>X({builtinTools:Zt.includes(Z)?Zt.filter(Ne=>Ne!==Z):[...Zt,Z]}),Fe=Z=>{const Ne=Ge.includes(Z)?Ge.filter(Me=>Me!==Z):[...Ge,Z];X({tracingExporters:Ne,tracing:Ne.length>0?!0:ae.tracing})},rt=a3(ae.agentType),tt=Id(ae.agentType),mt=v.useMemo(()=>d3(a),[a]),ue=tt?null:nl(ae.name)??(mt.has(ae.name)?"Agent 名称在当前结构中必须唯一":null),Oe=ue!==null,Qe=!tt&&ae.description.trim().length===0,cn=ae.instruction.trim().length===0,an=tt&&!((Pn=ae.a2aRegistry)!=null&&Pn.registrySpaceId.trim()),ie=Z=>l&&Z?`is-error cw-error-shake-${d%2}`:"",_e=v.useMemo(()=>x3(a,mt),[a,mt]),ye=_e.length===0,Pe=v.useMemo(()=>hN(a),[a]),$e=v.useMemo(()=>une(a),[a]),qe=!!(T&&H&&H!==Pe&&D!==Pe);v.useEffect(()=>{D&&D!==Pe&&ne("")},[Pe,D]);const gt=v.useMemo(()=>{var Z,Ne,Me,He;return{type:!0,basic:tt?!an:!Oe&&(rt||!cn),model:!!((Z=ae.modelName)!=null&&Z.trim()||(Ne=ae.modelProvider)!=null&&Ne.trim()||(Me=ae.modelApiBase)!=null&&Me.trim()),tools:Zt.length>0||Ct.length>0,skills:Et.length>0,knowledge:ae.knowledgebase,advanced:ae.memory.shortTerm||ae.memory.longTerm||ae.tracing,subagents:(((He=ae.subAgents)==null?void 0:He.length)??0)>0,review:ye}},[ae,Oe,cn,rt,tt,ye,Zt,Ct,Et]),Rt=rt||tt?["basic"]:["basic","model","tools","skills","knowledge",...wt?["advanced"]:[]],gn=lN.filter(Z=>Rt.includes(Z.id)),yn=Rt.join("|"),zt=Ie.join("."),Nn=gn.findIndex(Z=>Z.id===ee),Jn=Z=>{var Ne;(Ne=ve.current[Z])==null||Ne.scrollIntoView({behavior:"smooth",block:"start"})};v.useEffect(()=>{if(h)return;const Z=Le.current;if(!Z)return;const Ne=yn.split("|");let Me=0;const He=()=>{Me=0;const yt=Ne[Ne.length-1];let Kt=Ne[0];if(Z.scrollTop+Z.clientHeight>=Z.scrollHeight-2)Kt=yt;else{const Nt=Z.getBoundingClientRect().top+24;for(const fr of Ne){const St=ve.current[fr];if(!St||St.getBoundingClientRect().top>Nt)break;Kt=fr}}Kt&&re(Nt=>Nt===Kt?Nt:Kt)},Lt=()=>{Me||(Me=window.requestAnimationFrame(He))};return He(),Z.addEventListener("scroll",Lt,{passive:!0}),window.addEventListener("resize",Lt),()=>{Z.removeEventListener("scroll",Lt),window.removeEventListener("resize",Lt),Me&&window.cancelAnimationFrame(Me)}},[h,yn,zt]);const _r=()=>ye?!0:(u(!0),f(Z=>Z+1),_e[0]&&(ge(_e[0].path),window.requestAnimationFrame(()=>Jn("basic"))),!1),Dn=async()=>{const Z=N.current;if(N.current=null,A(null),I(null),V(""),ne(""),Z)try{await r1(Z.runId)}catch(Ne){console.warn("清理调试运行失败",Ne)}},Hn=async()=>{if(G(""),!!_r()){y(!0);try{const Z=await fp(vh(a));await Dn(),k("idle"),B(""),P([]),C([]),O(""),S(null),p(Z)}catch(Z){G(`打开部署页失败:${Z instanceof Error?Z.message:String(Z)}`)}finally{y(!1)}}},er=async()=>{if(!E||m||!_r())return;const Z=hN(a);ne(""),S(null),C([]),O(""),P([]),k("building");try{await Dn();const Ne=[],Me=yt=>{Ne.push(yt),P([...Ne])};Me("提交 Agent 配置"),k("starting"),Me("初始化调试环境");const He=await rR(vh(a));N.current=He,A(He),B(He.appName),Me("创建调试会话");const Lt=await sR(He.runId,"test_user");I(Lt),V(Z),Me("调试环境就绪"),k("ready")}catch(Ne){S(Ne instanceof Error?Ne.message:String(Ne)),k("error")}},Tr=async()=>{const Z=N.current,Ne=R,Me=L.trim();if(!(!Z||!Ne||!Me||_==="sending")){O(""),k("sending"),C(He=>[...He,{role:"user",content:Me},{role:"assistant",content:"",blocks:[]}]);try{let He=Qs(),Lt="";for await(const yt of iR({runId:Z.runId,userId:"test_user",sessionId:Ne,text:Me})){const Kt=yt.error||yt.errorMessage||yt.error_message;if(Kt){C(Nt=>{const fr=[...Nt],St=fr[fr.length-1];return(St==null?void 0:St.role)==="assistant"&&(St.error=String(Kt)),fr});break}He=ml(He,yt),Lt=He.blocks.filter(Nt=>Nt.kind==="text").map(Nt=>Nt.text).join(""),C(Nt=>{const fr=[...Nt],St=fr[fr.length-1];return(St==null?void 0:St.role)==="assistant"&&(St.content=Lt,St.blocks=He.blocks),fr})}k("ready")}catch(He){C(Lt=>{const yt=[...Lt],Kt=yt[yt.length-1];return(Kt==null?void 0:Kt.role)==="assistant"&&(Kt.error=He instanceof Error?He.message:String(He)),yt}),k("ready")}}};if(h){const Z=async(Ne,Me,He)=>{var Kt;const Lt=(Kt=a.deployment)==null?void 0:Kt.network,yt=Lt&&Lt.mode&&Lt.mode!=="public"?{mode:Lt.mode,vpc_id:Lt.vpcId,subnet_ids:Lt.subnetIds,enable_shared_internet_access:Lt.enableSharedInternetAccess}:void 0;return LE(Ne.name,Ne.files,{region:w,projectName:"default",network:yt},{...He,onStage:Me})};return c.jsx("div",{className:"cw-root cw-root-preview",children:c.jsx("div",{className:"cw-preview-body",children:c.jsx(Mx,{project:h,agentDraft:a,agentName:a.name||"未命名 Agent",agentCount:w3(a),onChange:p,onDeploy:Z,onAgentAdded:n,onDeploymentTaskChange:i,feishuEnabled:!!((tr=a.deployment)!=null&&tr.feishuEnabled),onFeishuEnabledChange:async Ne=>{const Me={...a,deployment:{...a.deployment??{feishuEnabled:!1},feishuEnabled:Ne}},He=await fp(vh(Me));o(Me),p(He)},deploymentEnv:$e.specs,deploymentEnvValues:{...(zn=a.deployment)==null?void 0:zn.envValues,...$e.fixedValues},onDeploymentEnvChange:le,network:(An=a.deployment)==null?void 0:An.network,onNetworkChange:Ne=>o(Me=>({...Me,deployment:{...Me.deployment??{feishuEnabled:!1},network:Ne}})),deployRegion:w,onDeployRegionChange:g,onBack:()=>p(null),onExportYaml:()=>Kte(`${a.name||"agent"}.yaml`,Wee(a),"text/yaml")})})})}const Vt=Ue.current,Sn=Z=>lN.find(Ne=>Ne.id===Z);return c.jsx("div",{className:"cw-root",children:c.jsxs("div",{className:"cw-editor",children:[c.jsxs("aside",{className:"cw-tree","aria-label":"Agent 结构",children:[c.jsx("div",{className:"cw-tree-head",children:"Agent 结构"}),c.jsx(v3,{root:a,path:[],selectedPath:Ie,duplicateNames:mt,showErrors:l,validationPulse:d,onSelect:ge,onChange:We,onClearRoot:ot})]}),c.jsxs("div",{className:"cw-detail",children:[c.jsx("div",{className:"cw-typebar",children:c.jsx("div",{className:"cw-typebar-inner",children:c.jsxs("div",{className:"cw-typeradio cw-typeradio--row",role:"radiogroup","aria-label":"Agent 类型",style:{"--cw-agent-type-gap":`${x0}px`,"--cw-agent-type-slider-width":`calc((100% - ${8+x0*(Df.length-1)}px) / ${Df.length})`,"--cw-active-type-offset":`calc(${K*100}% + ${K*x0}px)`},children:[c.jsx("span",{className:"cw-typeradio-slider","aria-hidden":!0}),Df.map(Z=>{const Ne=(ae.agentType??"llm")===Z.id,Me=wt&&Z.id==="a2a",He=Me?"cw-remote-agent-disabled-hint":void 0;return c.jsxs("label",{className:`cw-typeradio-item ${Ne?"is-on":""} ${Me?"is-disabled":""}`,title:Me?void 0:Z.desc,tabIndex:Me?0:void 0,"aria-describedby":He,children:[c.jsx("input",{type:"radio",name:"agentType",className:"cw-typeradio-input",checked:Ne,disabled:Me,onChange:()=>ut(Z.id)}),c.jsxs("span",{className:"cw-typeradio-title",children:[Qte[Z.id].replace("智能体",""),c.jsx("wbr",{}),"智能体"]}),Me&&c.jsx("span",{id:He,className:"cw-typeradio-disabled-hint",role:"tooltip",children:"远程 Agent 仅可作为子 Agent"})]},Z.id)})]})})}),c.jsx("div",{className:"cw-detail-scroll",ref:Le,children:c.jsx("div",{className:"cw-detail-inner",children:c.jsxs("div",{className:"cw-lower",children:[c.jsxs("div",{className:"cw-form-col",children:[c.jsx(Vt,{meta:Sn("basic"),children:c.jsxs("div",{className:"cw-form",children:[!tt&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["Agent 名称",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("input",{className:`cw-input ${ie(Oe)}`,value:ae.name,placeholder:"customer_service",onChange:Z=>X({name:Z.target.value})}),l&&ue?c.jsx("span",{className:"cw-error-text",children:ue}):c.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在 Agent 结构中保持唯一。"})]}),c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["描述",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${ie(Qe)}`,value:ae.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:Z=>X({description:Z.target.value})}),l&&Qe?c.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):c.jsx("span",{className:"cw-help",children:"描述会显示在 Agent 列表与选择器中。"})]})]}),rt?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"cw-section-desc",children:"编排型 Agent 只负责调度子 Agent,不需要模型或系统提示词。请在左侧 「Agent 结构」中为它添加、排序子 Agent。"}),ae.agentType==="loop"&&c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"最大轮次"}),c.jsx("input",{className:"cw-input",type:"number",min:1,value:ae.maxIterations??3,onChange:Z=>X({maxIterations:Math.max(1,Number(Z.target.value)||1)})}),c.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):tt?c.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[c.jsxs("div",{className:"cw-remote-center-head",children:[c.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),c.jsx(ene,{value:((st=ae.a2aRegistry)==null?void 0:st.registrySpaceId)??"",region:((Cn=ae.a2aRegistry)==null?void 0:Cn.registryRegion)||hs.region,invalid:l&&an,onChange:Z=>Re(m3,Z)}),c.jsx(xc,{env:Zte,values:g3(ae.a2aRegistry,{includeDefaults:!1}),onChange:Re}),l&&an&&c.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):c.jsxs("div",{className:"cw-field",children:[c.jsxs("label",{className:"cw-label",children:["系统提示词",c.jsx("span",{className:"cw-req",children:"*"})]}),c.jsx(v.Suspense,{fallback:c.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:c.jsx(Vte,{value:ae.instruction,invalid:cn,onChange:Z=>X({instruction:Z})})}),l&&cn?c.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):c.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!rt&&!tt&&c.jsxs(c.Fragment,{children:[c.jsx(Vt,{meta:Sn("model"),children:c.jsxs("div",{className:"cw-form",children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"模型名称"}),c.jsx("input",{className:"cw-input",value:ae.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:Z=>X({modelName:Z.target.value})})]}),c.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":W,"aria-controls":we,onClick:()=>oe(Z=>!Z),children:[c.jsx("span",{children:"更多选项"}),c.jsx(lr,{className:`cw-more-options-chevron ${W?"is-open":""}`,"aria-hidden":!0})]}),c.jsx(Hi,{initial:!1,children:W&&c.jsxs(Gt.div,{id:we,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"服务商 Provider"}),c.jsx("input",{className:"cw-input",value:ae.modelProvider??"",placeholder:"openai",onChange:Z=>X({modelProvider:Z.target.value})})]}),c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"API Base"}),c.jsx("input",{className:"cw-input",value:ae.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:Z=>X({modelApiBase:Z.target.value})}),c.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),c.jsx(Vt,{meta:Sn("tools"),children:c.jsxs("div",{className:"cw-form",children:[c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"内置工具"}),c.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),c.jsx("div",{className:"cw-tools-list-shell",children:c.jsx(uN,{items:Ox,selected:Zt,onToggle:kn,scrollRows:6})})]}),c.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":he,"aria-controls":vt,onClick:()=>J(Z=>!Z),children:[c.jsx("span",{children:"更多类型工具"}),Ct.length>0&&c.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",Ct.length]}),c.jsx(lr,{className:`cw-more-options-chevron ${he?"is-open":""}`,"aria-hidden":!0})]}),c.jsx(Hi,{initial:!1,children:he&&c.jsx(Gt.div,{id:vt,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:c.jsxs("div",{className:"cw-field",children:[c.jsx("label",{className:"cw-label",children:"MCP 工具"}),c.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),c.jsx(tne,{tools:Ct,onChange:Z=>X({mcpTools:Z})})]})})})]})}),c.jsx(Vt,{meta:Sn("skills"),children:c.jsx("div",{className:"cw-form",children:c.jsx(rne,{selected:Et,onChange:Z=>X({selectedSkills:Z})})})}),c.jsx(Vt,{meta:Sn("knowledge"),children:c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.knowledgebase,onChange:Z=>X({knowledgebase:Z}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:lh}),ae.knowledgebase&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"知识库后端"}),c.jsx(w0,{options:Ap,value:ae.knowledgebaseBackend,onChange:Z=>X({knowledgebaseBackend:Z})}),c.jsx(xc,{env:((Bt=Ap.find(Z=>Z.id===(ae.knowledgebaseBackend??"local")))==null?void 0:Bt.env)??[],values:((Jt=a.deployment)==null?void 0:Jt.envValues)??{},onChange:le})]})]})}),wt&&c.jsxs("section",{ref:Z=>{ve.current.advanced=Z},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[c.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":ce,"aria-controls":ct,onClick:()=>Ce(Z=>!Z),children:[c.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),c.jsx(lr,{className:`cw-advanced-disclosure-chevron ${ce?"is-open":""}`,"aria-hidden":!0}),Ht>0&&c.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",Ht]})]}),c.jsx(Hi,{initial:!1,children:ce&&c.jsxs(Gt.div,{id:ct,className:"cw-advanced-content",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},children:[c.jsxs("div",{className:"cw-advanced-group",children:[c.jsx("div",{className:"cw-advanced-group-head",children:c.jsx("span",{children:"记忆"})}),c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.memory.shortTerm,onChange:Z=>X({memory:{...ae.memory,shortTerm:Z}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:OI}),ae.memory.shortTerm&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"短期记忆后端"}),c.jsx(w0,{options:Np,value:ae.shortTermBackend,onChange:Z=>X({shortTermBackend:Z})}),c.jsx(xc,{env:((In=Np.find(Z=>Z.id===(ae.shortTermBackend??"local")))==null?void 0:In.env)??[],values:((jn=a.deployment)==null?void 0:jn.envValues)??{},onChange:le})]}),c.jsx(wc,{checked:ae.memory.longTerm,onChange:Z=>X({memory:{...ae.memory,longTerm:Z}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:lh}),ae.memory.longTerm&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"长期记忆后端"}),c.jsx(w0,{options:Sp,value:ae.longTermBackend,onChange:Z=>X({longTermBackend:Z})}),c.jsx(xc,{env:((wn=Sp.find(Z=>Z.id===(ae.longTermBackend??"local")))==null?void 0:wn.env)??[],values:((nr=a.deployment)==null?void 0:nr.envValues)??{},onChange:le}),c.jsx(wc,{checked:!!ae.autoSaveSession,onChange:Z=>X({autoSaveSession:Z}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:lh})]})]})]}),c.jsxs("div",{className:"cw-advanced-group",children:[c.jsx("div",{className:"cw-advanced-group-head",children:c.jsx("span",{children:"观测"})}),c.jsxs("div",{className:"cw-form cw-toggle-stack",children:[c.jsx(wc,{checked:ae.tracing,onChange:Z=>X({tracing:Z}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:NI}),ae.tracing&&c.jsxs("div",{className:"cw-field cw-subfield",children:[c.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),c.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),c.jsx(uN,{items:Cp,selected:Ge,onToggle:Fe}),c.jsx(xc,{env:Cp.filter(Z=>Ge.includes(Z.id)).flatMap(Z=>Z.env),values:((Ot=a.deployment)==null?void 0:Ot.envValues)??{},onChange:le})]})]})]})]})})]})]})]}),c.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:c.jsxs("ol",{className:"cw-steps",children:[c.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:c.jsx(Gt.div,{className:"cw-rail-fill",animate:{height:`${Math.max(Nn,0)/Math.max(gn.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),gn.map(Z=>{const Ne=Z.id===ee,Me=gt[Z.id];return c.jsx("li",{children:c.jsxs("button",{type:"button",className:`cw-step ${Ne?"is-active":""} ${Me?"is-done":""}`,onClick:()=>Jn(Z.id),"aria-current":Ne?"step":void 0,"aria-label":Z.label,children:[c.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:Ne?c.jsx("span",{className:"cw-dot"}):Me?c.jsx(Bs,{className:"cw-step-check"}):c.jsx("span",{className:"cw-dot"})}),c.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:Z.label})]})},Z.id)})]})})]})})})]}),c.jsx(dne,{enabled:E,disabledReason:b,phase:_,stale:qe,run:T,projectName:M||a.name,logs:Y,messages:U,input:L,error:j,deploying:m,deployError:de,onInput:O,onSend:Tr,onRestart:er,onIgnoreChanges:()=>ne(Pe),onDeploy:Hn})]})})}function Hs(e){return{...Xi(),...e}}const hne=[{id:"support",icon:wF,draft:Hs({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:oF,draft:Hs({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:vF,draft:Hs({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:vE,draft:Hs({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:IF,draft:Hs({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:$F,draft:Hs({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Hs({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Hs({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Hs({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function pne(e){const t=[];return e.tools.length&&t.push({icon:CE,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:aF,label:"记忆"}),e.knowledgebase&&t.push({icon:iF,label:"知识库"}),e.tracing&&t.push({icon:rF,label:"观测"}),e.subAgents.length&&t.push({icon:MI,label:`子Agent ${e.subAgents.length}`}),t}function mne({onBack:e,onCreate:t}){const[n,r]=v.useState(null);return c.jsx("div",{className:"tpl-root",children:n?c.jsx(yne,{template:n,onBack:()=>r(null),onCreate:t}):c.jsx(gne,{onPick:r})})}function gne({onPick:e}){return c.jsxs("div",{className:"tpl-scroll",children:[c.jsxs("div",{className:"tpl-head",children:[c.jsx("h1",{className:"tpl-title",children:"从模板新建"}),c.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),c.jsx("div",{className:"tpl-grid",children:hne.map((t,n)=>c.jsxs(Gt.button,{type:"button",className:"tpl-card",onClick:()=>e(t),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:n*.03,duration:.24,ease:[.22,1,.36,1]},children:[c.jsx("span",{className:"tpl-card-icon",children:c.jsx(t.icon,{className:"icon"})}),c.jsx("span",{className:"tpl-card-name",children:t.draft.name}),c.jsx("span",{className:"tpl-card-desc",children:Zr(t.draft.description)})]},t.id))})]})}function yne({template:e,onBack:t,onCreate:n}){const[r,s]=v.useState(e.draft.name),i=e.icon,a=pne(e.draft);function o(){const l=r.trim()||e.draft.name;n({...e.draft,name:l})}return c.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[c.jsxs("button",{className:"tpl-back",onClick:t,children:[c.jsx(EI,{className:"icon"})," 返回模板列表"]}),c.jsxs(Gt.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[c.jsxs("div",{className:"tpl-detail-head",children:[c.jsx("span",{className:"tpl-detail-icon",children:c.jsx(i,{className:"icon"})}),c.jsxs("div",{className:"tpl-detail-headtext",children:[c.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),c.jsx("div",{className:"tpl-detail-desc",children:Zr(e.draft.description)})]})]}),a.length>0&&c.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(l=>c.jsxs("span",{className:"tpl-tag",children:[c.jsx(l.icon,{className:"tpl-tag-icon"})," ",l.label]},l.label))}),c.jsxs("label",{className:"tpl-field",children:[c.jsx("span",{className:"tpl-field-label",children:"名称"}),c.jsx("input",{className:"tpl-input",value:r,onChange:l=>s(l.target.value),placeholder:e.draft.name})]}),c.jsxs("div",{className:"tpl-field",children:[c.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),c.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),c.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"模型"}),c.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"工具"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"记忆"}),c.jsx("span",{className:"tpl-meta-val",children:bne(e.draft)})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"知识库"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),c.jsxs("div",{className:"tpl-meta",children:[c.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),c.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&c.jsxs("div",{className:"tpl-field",children:[c.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),c.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((l,u)=>c.jsxs("div",{className:"tpl-subagent",children:[c.jsxs("div",{className:"tpl-subagent-top",children:[c.jsx("span",{className:"tpl-subagent-name",children:l.name}),l.tools.length>0&&c.jsx("span",{className:"tpl-subagent-tools",children:l.tools.join("、")})]}),c.jsx("div",{className:"tpl-subagent-desc",children:Zr(l.description)})]},u))})]}),c.jsxs("button",{className:"tpl-create",onClick:o,children:["使用此模板创建 ",c.jsx(lr,{className:"icon"})]})]})]})}function bne(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}function xn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Mm(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_h.prototype=Mm.prototype={constructor:_h,on:function(e,t){var n=this._,r=xne(e+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(s),r=0,s,i;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mN.hasOwnProperty(t)?{space:mN[t],local:e}:e}function vne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===M1&&t.documentElement.namespaceURI===M1?t.createElement(e):t.createElementNS(n,e)}}function _ne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function _3(e){var t=Dm(e);return(t.local?_ne:vne)(t)}function Tne(){}function Dx(e){return e==null?Tne:function(){return this.querySelector(e)}}function kne(e){typeof e!="function"&&(e=Dx(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=b&&(b=E+1);!(k=w[b])&&++b=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Xne(e){e||(e=Qne);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,s=new Array(r),i=0;it?1:e>=t?0:NaN}function Zne(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Jne(){return Array.from(this)}function ere(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?dre:typeof t=="function"?hre:fre)(e,t,n??"")):Tl(this.node(),e)}function Tl(e,t){return e.style.getPropertyValue(t)||A3(e).getComputedStyle(e,null).getPropertyValue(t)}function mre(e){return function(){delete this[e]}}function gre(e,t){return function(){this[e]=t}}function yre(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function bre(e,t){return arguments.length>1?this.each((t==null?mre:typeof t=="function"?yre:gre)(e,t)):this.node()[e]}function C3(e){return e.trim().split(/^|\s+/)}function Px(e){return e.classList||new I3(e)}function I3(e){this._node=e,this._names=C3(e.getAttribute("class")||"")}I3.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function R3(e,t){for(var n=Px(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Yre(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function D1(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}D1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nse(e){return!e.ctrlKey&&!e.button}function rse(){return this.parentNode}function sse(e,t){return t??{x:e.x,y:e.y}}function ise(){return navigator.maxTouchPoints||"ontouchstart"in this}function j3(){var e=nse,t=rse,n=sse,r=ise,s={},i=Mm("start","drag","end"),a=0,o,l,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",g,tse).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,k){if(!(d||!e.call(this,_,k))){var T=b(this,t.call(this,_,k),_,k,"mouse");T&&(Ar(_.view).on("mousemove.drag",m,Ku).on("mouseup.drag",y,Ku),D3(_.view),T0(_),u=!1,o=_.clientX,l=_.clientY,T("start",_))}}function m(_){if(rl(_),!u){var k=_.clientX-o,T=_.clientY-l;u=k*k+T*T>f}s.mouse("drag",_)}function y(_){Ar(_.view).on("mousemove.drag mouseup.drag",null),P3(_.view,u),rl(_),s.mouse("end",_)}function w(_,k){if(e.call(this,_,k)){var T=_.changedTouches,A=t.call(this,_,k),N=T.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ose.exec(e))?new yr(t[1],t[2],t[3],1):(t=lse.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cse.exec(e))?Bf(t[1],t[2],t[3],t[4]):(t=use.exec(e))?Bf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dse.exec(e))?vN(t[1],t[2]/100,t[3]/100,1):(t=fse.exec(e))?vN(t[1],t[2]/100,t[3]/100,t[4]):gN.hasOwnProperty(e)?EN(gN[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function EN(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function Bf(e,t,n,r){return r<=0&&(e=t=n=NaN),new yr(e,t,n,r)}function mse(e){return e instanceof Ld||(e=Wa(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function P1(e,t,n,r){return arguments.length===1?mse(e):new yr(e,t,n,r??1)}function yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jx(yr,P1,B3(Ld,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Ma(this.r),Ma(this.g),Ma(this.b),Lp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xN,formatHex:xN,formatHex8:gse,formatRgb:wN,toString:wN}));function xN(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function gse(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function wN(){const e=Lp(this.opacity);return`${e===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${e===1?")":`, ${e})`}`}function Lp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ma(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sa(e){return e=Ma(e),(e<16?"0":"")+e.toString(16)}function vN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new os(e,t,n,r)}function F3(e){if(e instanceof os)return new os(e.h,e.s,e.l,e.opacity);if(e instanceof Ld||(e=Wa(e)),!e)return new os;if(e instanceof os)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,o=i-s,l=(i+s)/2;return o?(t===i?a=(n-r)/o+(n0&&l<1?0:a,new os(a,o,l,e.opacity)}function yse(e,t,n,r){return arguments.length===1?F3(e):new os(e,t,n,r??1)}function os(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jx(os,yse,B3(Ld,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new os(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new os(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new yr(k0(e>=240?e-240:e+120,s,r),k0(e,s,r),k0(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new os(_N(this.h),Ff(this.s),Ff(this.l),Lp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lp(this.opacity);return`${e===1?"hsl(":"hsla("}${_N(this.h)}, ${Ff(this.s)*100}%, ${Ff(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _N(e){return e=(e||0)%360,e<0?e+360:e}function Ff(e){return Math.max(0,Math.min(1,e||0))}function k0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Bx=e=>()=>e;function bse(e,t){return function(n){return e+n*t}}function Ese(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function xse(e){return(e=+e)==1?U3:function(t,n){return n-t?Ese(t,n,e):Bx(isNaN(t)?n:t)}}function U3(e,t){var n=t-e;return n?bse(e,n):Bx(isNaN(e)?t:e)}const Mp=function e(t){var n=xse(t);function r(s,i){var a=n((s=P1(s)).r,(i=P1(i)).r),o=n(s.g,i.g),l=n(s.b,i.b),u=U3(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=o(d),s.b=l(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function wse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;sn&&(i=t.slice(n,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:As(r,s)})),n=N0.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:As(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function o(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:As(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function l(u,d,f,h,p,m){if(u!==f||d!==h){var y=p.push(s(p)+"scale(",null,",",null,")");m.push({i:y-4,x:As(u,f)},{i:y-2,x:As(d,h)})}else(f!==1||h!==1)&&p.push(s(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),o(u.skewX,d.skewX,f,h),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,y=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--kl}function NN(){qa=(Pp=qu.now())+Pm,kl=Mc=0;try{Pse()}finally{kl=0,Bse(),qa=0}}function jse(){var e=qu.now(),t=e-Pp;t>V3&&(Pm-=t,Pp=e)}function Bse(){for(var e,t=Dp,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Dp=n);Dc=e,F1(r)}function F1(e){if(!kl){Mc&&(Mc=clearTimeout(Mc));var t=e-qa;t>24?(e<1/0&&(Mc=setTimeout(NN,e-qu.now()-Pm)),vc&&(vc=clearInterval(vc))):(vc||(Pp=qu.now(),vc=setInterval(jse,V3)),kl=1,K3(NN))}}function SN(e,t,n){var r=new jp;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var Fse=Mm("start","end","cancel","interrupt"),Use=[],W3=0,AN=1,U1=2,kh=3,CN=4,$1=5,Nh=6;function jm(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;$se(e,n,{name:t,index:r,group:s,on:Fse,tween:Use,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:W3})}function Ux(e,t){var n=xs(e,t);if(n.state>W3)throw new Error("too late; already scheduled");return n}function $s(e,t){var n=xs(e,t);if(n.state>kh)throw new Error("too late; already running");return n}function xs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function $se(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Y3(i,0,n.time);function i(u){n.state=AN,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,p;if(n.state!==AN)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===kh)return SN(a);p.state===CN?(p.state=Nh,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dU1&&r.state<$1,r.state=Nh,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}i&&delete e.__transition}}function Hse(e){return this.each(function(){Sh(this,e)})}function zse(e,t){var n,r;return function(){var s=$s(this,e),i=s.tween;if(i!==n){r=n=i;for(var a=0,o=r.length;a=0&&(t=t.slice(0,n)),!t||t==="start"})}function yie(e,t,n){var r,s,i=gie(t)?Ux:$s;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(t,n),a.on=s}}function bie(e,t){var n=this._id;return arguments.length<2?xs(this.node(),n).on.on(e):this.each(yie(n,e,t))}function Eie(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xie(){return this.on("end.remove",Eie(this._id))}function wie(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Dx(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function Yie(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function ei(e,t,n){this.k=e,this.x=t,this.y=n}ei.prototype={constructor:ei,scale:function(e){return e===1?this:new ei(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ei(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Bm=new ei(1,0,0);Q3.prototype=ei.prototype;function Q3(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Bm;return e.__zoom}function S0(e){e.stopImmediatePropagation()}function _c(e){e.preventDefault(),e.stopImmediatePropagation()}function Wie(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function qie(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function IN(){return this.__zoom||Bm}function Gie(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Xie(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qie(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Z3(){var e=Wie,t=qie,n=Qie,r=Gie,s=Xie,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=Th,u=Mm("start","zoom","end"),d,f,h,p=500,m=150,y=0,w=10;function g(P){P.property("__zoom",IN).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(P,U,C,L){var O=P.selection?P.selection():P;O.property("__zoom",IN),P!==O?k(P,U,C,L):O.interrupt().each(function(){T(this,arguments).event(L).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},g.scaleBy=function(P,U,C,L){g.scaleTo(P,function(){var O=this.__zoom.k,j=typeof U=="function"?U.apply(this,arguments):U;return O*j},C,L)},g.scaleTo=function(P,U,C,L){g.transform(P,function(){var O=t.apply(this,arguments),j=this.__zoom,S=C==null?_(O):typeof C=="function"?C.apply(this,arguments):C,H=j.invert(S),V=typeof U=="function"?U.apply(this,arguments):U;return n(b(E(j,V),S,H),O,a)},C,L)},g.translateBy=function(P,U,C,L){g.transform(P,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,L)},g.translateTo=function(P,U,C,L,O){g.transform(P,function(){var j=t.apply(this,arguments),S=this.__zoom,H=L==null?_(j):typeof L=="function"?L.apply(this,arguments):L;return n(Bm.translate(H[0],H[1]).scale(S.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof C=="function"?-C.apply(this,arguments):-C),j,a)},L,O)};function E(P,U){return U=Math.max(i[0],Math.min(i[1],U)),U===P.k?P:new ei(U,P.x,P.y)}function b(P,U,C){var L=U[0]-C[0]*P.k,O=U[1]-C[1]*P.k;return L===P.x&&O===P.y?P:new ei(P.k,L,O)}function _(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function k(P,U,C,L){P.on("start.zoom",function(){T(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(L).end()}).tween("zoom",function(){var O=this,j=arguments,S=T(O,j).event(L),H=t.apply(O,j),V=C==null?_(H):typeof C=="function"?C.apply(O,j):C,D=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),ne=O.__zoom,ee=typeof U=="function"?U.apply(O,j):U,re=l(ne.invert(V).concat(D/ne.k),ee.invert(V).concat(D/ee.k));return function(de){if(de===1)de=ee;else{var G=re(de),W=D/G[2];de=new ei(W,V[0]-G[0]*W,V[1]-G[1]*W)}S.zoom(null,de)}})}function T(P,U,C){return!C&&P.__zooming||new A(P,U)}function A(P,U){this.that=P,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,U),this.taps=0}A.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,U){return this.mouse&&P!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var U=Ar(this.that).datum();u.call(P,this.that,new Yie(P,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),U)}};function N(P,...U){if(!e.apply(this,arguments))return;var C=T(this,U).event(P),L=this.__zoom,O=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,r.apply(this,arguments)))),j=is(P);if(C.wheel)(C.mouse[0][0]!==j[0]||C.mouse[0][1]!==j[1])&&(C.mouse[1]=L.invert(C.mouse[0]=j)),clearTimeout(C.wheel);else{if(L.k===O)return;C.mouse=[j,L.invert(j)],Sh(this),C.start()}_c(P),C.wheel=setTimeout(S,m),C.zoom("mouse",n(b(E(L,O),C.mouse[0],C.mouse[1]),C.extent,a));function S(){C.wheel=null,C.end()}}function R(P,...U){if(h||!e.apply(this,arguments))return;var C=P.currentTarget,L=T(this,U,!0).event(P),O=Ar(P.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",D,!0),j=is(P,C),S=P.clientX,H=P.clientY;D3(P.view),S0(P),L.mouse=[j,this.__zoom.invert(j)],Sh(this),L.start();function V(ne){if(_c(ne),!L.moved){var ee=ne.clientX-S,re=ne.clientY-H;L.moved=ee*ee+re*re>y}L.event(ne).zoom("mouse",n(b(L.that.__zoom,L.mouse[0]=is(ne,C),L.mouse[1]),L.extent,a))}function D(ne){O.on("mousemove.zoom mouseup.zoom",null),P3(ne.view,L.moved),_c(ne),L.event(ne).end()}}function I(P,...U){if(e.apply(this,arguments)){var C=this.__zoom,L=is(P.changedTouches?P.changedTouches[0]:P,this),O=C.invert(L),j=C.k*(P.shiftKey?.5:2),S=n(b(E(C,j),L,O),t.apply(this,U),a);_c(P),o>0?Ar(this).transition().duration(o).call(k,S,L,P):Ar(this).call(g.transform,S,L,P)}}function M(P,...U){if(e.apply(this,arguments)){var C=P.touches,L=C.length,O=T(this,U,P.changedTouches.length===L).event(P),j,S,H,V;for(S0(P),S=0;S`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Gu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],J3=["Enter"," ","Escape"],eD={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Nl;(function(e){e.Strict="strict",e.Loose="loose"})(Nl||(Nl={}));var Da;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Da||(Da={}));var Xu;(function(e){e.Partial="partial",e.Full="full"})(Xu||(Xu={}));const tD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ci;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ci||(Ci={}));var Qu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Qu||(Qu={}));var De;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(De||(De={}));const RN={[De.Left]:De.Right,[De.Right]:De.Left,[De.Top]:De.Bottom,[De.Bottom]:De.Top};function nD(e){return e===null?null:e?"valid":"invalid"}const rD=e=>"id"in e&&"source"in e&&"target"in e,Zie=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Hx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Md=(e,t=[0,0])=>{const{width:n,height:r}=hi(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Jie=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const i=typeof s=="string";let a=!t.nodeLookup&&!i?s:void 0;t.nodeLookup&&(a=i?t.nodeLookup.get(s):Hx(s)?s:t.nodeLookup.get(s.id));const o=a?Bp(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Fm(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Um(n)},Dd=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Fm(n,Bp(s)),r=!0)}),r?Um(n):{x:0,y:0,width:0,height:0}},zx=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const o={...Zl(t,[n,r,s]),width:t.width/s,height:t.height/s},l=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(a&&!f||h)continue;const p=d.width??u.width??u.initialWidth??null,m=d.height??u.height??u.initialHeight??null,y=Zu(o,Al(u)),w=(p??0)*(m??0),g=i&&y>0;(!u.internals.handleBounds||g||y>=w||u.dragging)&&l.push(u)}return l},eae=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function tae(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function nae({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=tae(e,a),l=Dd(o),u=Kx(l,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function sD({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),o=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",gs.error005());else{const p=o.measured.width,m=o.measured.height;p&&m&&(f=[[l,u],[l+p,u+m]])}else o&&Xa(a.extent)&&(f=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const h=Xa(f)?Ga(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",gs.error015())),{position:{x:h.x-l+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function rae({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const i=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=i.has(h.id),m=!p&&h.parentId&&a.find(y=>y.id===h.parentId);(p||m)&&a.push(h)}const o=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=eae(a,l);for(const h of l)o.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!s)return{edges:d,nodes:a};const f=await s({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Sl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ga=(e={x:0,y:0},t,n)=>({x:Sl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Sl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function iD(e,t,n){const{width:r,height:s}=hi(n),{x:i,y:a}=n.internals.positionAbsolute;return Ga(e,[[i,a],[i+r,a+s]],t)}const ON=(e,t,n)=>en?-Sl(Math.abs(e-n),1,t)/t:0,Vx=(e,t,n=15,r=40)=>{const s=ON(e.x,r,t.width-r)*n,i=ON(e.y,r,t.height-r)*n;return[s,i]},Fm=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),H1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Um=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Al=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:Md(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Bp=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:Md(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},aD=(e,t)=>Um(Fm(H1(e),H1(t))),Zu=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},LN=e=>ls(e.width)&&ls(e.height)&&ls(e.x)&&ls(e.y),ls=e=>!isNaN(e)&&isFinite(e),oD=(e,t)=>(n,r)=>{},Pd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zl=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const o={x:(e-n)/s,y:(t-r)/s};return i?Pd(o,a):o},Cl=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function go(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function sae(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=go(e,n),s=go(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=go(e.top??e.y??0,n),s=go(e.bottom??e.y??0,n),i=go(e.left??e.x??0,t),a=go(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function iae(e,t,n,r,s,i){const{x:a,y:o}=Cl(e,[t,n,r]),{x:l,y:u}=Cl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=s-l,f=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(d),bottom:Math.floor(f)}}const Kx=(e,t,n,r,s,i)=>{const a=sae(i,t,n),o=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(o,l),d=Sl(u,r,s),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,y=iae(e,p,m,d,t,n),w={left:Math.min(y.left-a.left,0),top:Math.min(y.top-a.top,0),right:Math.min(y.right-a.right,0),bottom:Math.min(y.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Ju=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Xa(e){return e!=null&&e!=="parent"}function hi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function lD(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function cD(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*o[1]}return i}function MN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function aae(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function oae(e){return{...eD,...e||{}}}function cu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=cs(e),o=Zl({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=n?Pd(o,t):o;return{xSnapped:l,ySnapped:u,...o}}const Yx=e=>({width:e.offsetWidth,height:e.offsetHeight}),uD=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},lae=["INPUT","SELECT","TEXTAREA"];function dD(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:lae.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const fD=e=>"clientX"in e,cs=(e,t)=>{var i,a;const n=fD(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},DN=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Yx(a)}})};function hD({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+o*.375+r*.125,d=Math.abs(l-e),f=Math.abs(u-t);return[l,u,d,f]}function Hf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function PN({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case De.Left:return[t-Hf(t-r,i),n];case De.Right:return[t+Hf(r-t,i),n];case De.Top:return[t,n-Hf(n-s,i)];case De.Bottom:return[t,n+Hf(s-n,i)]}}function pD({sourceX:e,sourceY:t,sourcePosition:n=De.Bottom,targetX:r,targetY:s,targetPosition:i=De.Top,curvature:a=.25}){const[o,l]=PN({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=PN({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=hD({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${l} ${u},${d} ${r},${s}`,f,h,p,m]}function mD({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const dae=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,fae=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),hae=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",gs.error006()),t;const r=n.getEdgeId||dae;let s;return rD(e)?s={...e}:s={...e,id:r(e)},fae(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function gD({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,o]=mD({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,o]}const jN={[De.Left]:{x:-1,y:0},[De.Right]:{x:1,y:0},[De.Top]:{x:0,y:-1},[De.Bottom]:{x:0,y:1}},pae=({source:e,sourcePosition:t=De.Bottom,target:n})=>t===De.Left||t===De.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function mae({source:e,sourcePosition:t=De.Bottom,target:n,targetPosition:r=De.Top,center:s,offset:i,stepPosition:a}){const o=jN[t],l=jN[r],u={x:e.x+o.x*i,y:e.y+o.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},f=pae({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,w;const g={x:0,y:0},E={x:0,y:0},[,,b,_]=mD({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*l[h]===-1){h==="x"?(y=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(y=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const N=[{x:y,y:u.y},{x:y,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];o[h]===p?m=h==="x"?N:R:m=h==="x"?R:N}else{const N=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=o.x===p?R:N:m=o.y===p?N:R,t===r){const P=Math.abs(e[h]-n[h]);if(P<=i){const U=Math.min(i-1,i-P);o[h]===p?g[h]=(u[h]>e[h]?-1:1)*U:E[h]=(d[h]>n[h]?-1:1)*U}}if(t!==r){const P=h==="x"?"y":"x",U=o[h]===l[P],C=u[P]>d[P],L=u[P]=Y?(y=(I.x+M.x)/2,w=m[0].y):(y=m[0].x,w=(I.y+M.y)/2)}const k={x:u.x+g.x,y:u.y+g.y},T={x:d.x+E.x,y:d.y+E.y};return[[e,...k.x!==m[0].x||k.y!==m[0].y?[k]:[],...m,...T.x!==m[m.length-1].x||T.y!==m[m.length-1].y?[T]:[],n],y,w,b,_]}function gae(e,t,n,r){const s=Math.min(BN(e,t)/2,BN(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function V1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function bae(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=V1(l,t);i.has(u)||(a.push({id:u,color:l.color||n,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const yD=1e3,Eae=10,Wx={nodeOrigin:[0,0],nodeExtent:Gu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xae={...Wx,checkEquality:!0};function qx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function wae(e,t,n){const r=qx(Wx,n);for(const s of e.values())if(s.parentId)Xx(s,e,t,r);else{const i=Md(s,r.nodeOrigin),a=Xa(s.extent)?s.extent:r.nodeExtent,o=Ga(i,a,hi(s));s.internals.positionAbsolute=o}}function vae(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(i):s.type==="target"&&r.push(i)}return{source:n,target:r}}function Gx(e){return e==="manual"}function K1(e,t,n,r={}){var d,f;const s=qx(xae,r),i={i:0},a=new Map(t),o=s!=null&&s.elevateNodesOnSelect&&!Gx(s.zIndexMode)?yD:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(s.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const m=Md(h,s.nodeOrigin),y=Xa(h.extent)?h.extent:s.nodeExtent,w=Ga(m,y,hi(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:vae(h,p),z:bD(h,o,s.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(l=!1),h.parentId&&Xx(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function _ae(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Xx(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=qx(Wx,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}_ae(e,n),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*Eae),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!Gx(l)?yD:0,{x:h,y:p,z:m}=Tae(e,d,a,o,f,l),{positionAbsolute:y}=e.internals,w=h!==y.x||p!==y.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:y,z:m}})}function bD(e,t,n){const r=ls(e.zIndex)?e.zIndex:0;return Gx(n)?r:r+(e.selected?t:0)}function Tae(e,t,n,r,s,i){const{x:a,y:o}=t.internals.positionAbsolute,l=hi(e),u=Md(e,n),d=Xa(e.extent)?Ga(u,e.extent,l):u;let f=Ga({x:a+d.x,y:o+d.y},r,l);e.extent==="parent"&&(f=iD(f,l,t));const h=bD(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function Qx(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=t.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??Al(l),d=aD(u,o.rect);i.set(o.parentId,{expandedRect:d,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var b;const d=l.internals.positionAbsolute,f=hi(l),h=l.origin??r,p=o.x0||m>0||g||E)&&(s.push({id:u,type:"position",position:{x:l.position.x-p+g,y:l.position.y-m+E}}),(b=n.get(u))==null||b.forEach(_=>{e.some(k=>k.id===_.id)||s.push({id:_.id,type:"position",position:{x:_.position.x+p,y:_.position.y+m}})})),(f.width0){const p=Qx(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:l}}async function Nae({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:i}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function HN(e,t,n,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(n,t)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(n,t))}}function ED(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,d=`${i}-${o}--${s}-${a}`;HN("source",l,d,e,s,a),HN("target",l,u,e,i,o),t.set(r.id,r)}}function xD(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:xD(n,t):!1}function zN(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Sae(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!xD(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function A0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,o,l;const s=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&s.push({...f,position:d.position,dragging:r})}if(!e)return[s[0],s];const i=(o=n.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=t.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function Aae({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:n-s.distance.x,y:r-s.distance.y},a=Pd(i,t);return{x:a.x-i.x,y:a.y-i.y}}function Cae({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,y=null;function w({noDragClassName:E,handleSelector:b,domNode:_,isSelectable:k,nodeId:T,nodeClickDistance:A=0}){h=Ar(_);function N({x:B,y:Y}){const{nodeLookup:P,nodeExtent:U,snapGrid:C,snapToGrid:L,nodeOrigin:O,onNodeDrag:j,onSelectionDrag:S,onError:H,updateNodePositions:V}=t();i={x:B,y:Y};let D=!1;const ne=o.size>1,ee=ne&&U?H1(Dd(o)):null,re=ne&&L?Aae({dragItems:o,snapGrid:C,x:B,y:Y}):null;for(const[de,G]of o){if(!P.has(de))continue;let W={x:B-G.distance.x,y:Y-G.distance.y};L&&(W=re?{x:Math.round(W.x+re.x),y:Math.round(W.y+re.y)}:Pd(W,C));let oe=null;if(ne&&U&&!G.extent&&ee){const{positionAbsolute:ce}=G.internals,Ce=ce.x-ee.x+U[0][0],Ee=ce.x+G.measured.width-ee.x2+U[1][0],ge=ce.y-ee.y+U[0][1],Le=ce.y+G.measured.height-ee.y2+U[1][1];oe=[[Ce,ge],[Ee,Le]]}const{position:he,positionAbsolute:J}=sD({nodeId:de,nextPosition:W,nodeLookup:P,nodeExtent:oe||U,nodeOrigin:O,onError:H});D=D||G.position.x!==he.x||G.position.y!==he.y,G.position=he,G.internals.positionAbsolute=J}if(m=m||D,!!D&&(V(o,!0),y&&(r||j||!T&&S))){const[de,G]=A0({nodeId:T,dragItems:o,nodeLookup:P});r==null||r(y,o,de,G),j==null||j(y,de,G),T||S==null||S(y,G)}}async function R(){if(!d)return;const{transform:B,panBy:Y,autoPanSpeed:P,autoPanOnNodeDrag:U}=t();if(!U){l=!1,cancelAnimationFrame(a);return}const[C,L]=Vx(u,d,P);(C!==0||L!==0)&&(i.x=(i.x??0)-C/B[2],i.y=(i.y??0)-L/B[2],await Y({x:C,y:L})&&N(i)),a=requestAnimationFrame(R)}function I(B){var ne;const{nodeLookup:Y,multiSelectionActive:P,nodesDraggable:U,transform:C,snapGrid:L,snapToGrid:O,selectNodesOnDrag:j,onNodeDragStart:S,onSelectionDragStart:H,unselectNodesAndEdges:V}=t();f=!0,(!j||!k)&&!P&&T&&((ne=Y.get(T))!=null&&ne.selected||V()),k&&j&&T&&(e==null||e(T));const D=cu(B.sourceEvent,{transform:C,snapGrid:L,snapToGrid:O,containerBounds:d});if(i=D,o=Sae(Y,U,D,T),o.size>0&&(n||S||!T&&H)){const[ee,re]=A0({nodeId:T,dragItems:o,nodeLookup:Y});n==null||n(B.sourceEvent,o,ee,re),S==null||S(B.sourceEvent,ee,re),T||H==null||H(B.sourceEvent,re)}}const M=j3().clickDistance(A).on("start",B=>{const{domNode:Y,nodeDragThreshold:P,transform:U,snapGrid:C,snapToGrid:L}=t();d=(Y==null?void 0:Y.getBoundingClientRect())||null,p=!1,m=!1,y=B.sourceEvent,P===0&&I(B),i=cu(B.sourceEvent,{transform:U,snapGrid:C,snapToGrid:L,containerBounds:d}),u=cs(B.sourceEvent,d)}).on("drag",B=>{const{autoPanOnNodeDrag:Y,transform:P,snapGrid:U,snapToGrid:C,nodeDragThreshold:L,nodeLookup:O}=t(),j=cu(B.sourceEvent,{transform:P,snapGrid:U,snapToGrid:C,containerBounds:d});if(y=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||T&&!O.has(T))&&(p=!0),!p){if(!l&&Y&&f&&(l=!0,R()),!f){const S=cs(B.sourceEvent,d),H=S.x-u.x,V=S.y-u.y;Math.sqrt(H*H+V*V)>L&&I(B)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&o&&f&&(u=cs(B.sourceEvent,d),N(j))}}).on("end",B=>{if(!f||p){p&&o.size>0&&t().updateNodePositions(o,!1);return}if(l=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:Y,updateNodePositions:P,onNodeDragStop:U,onSelectionDragStop:C}=t();if(m&&(P(o,!1),m=!1),s||U||!T&&C){const[L,O]=A0({nodeId:T,dragItems:o,nodeLookup:Y,dragging:!1});s==null||s(B.sourceEvent,o,L,O),U==null||U(B.sourceEvent,L,O),T||C==null||C(B.sourceEvent,O)}}}).filter(B=>{const Y=B.target;return!B.button&&(!E||!zN(Y,`.${E}`,_))&&(!b||zN(Y,b,_))});h.call(M)}function g(){h==null||h.on(".drag",null)}return{update:w,destroy:g}}function Iae(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Zu(s,Al(i))>0&&r.push(i);return r}const Rae=250;function Oae(e,t,n,r){var o,l;let s=[],i=1/0;const a=Iae(e,n,t+Rae);for(const u of a){const d=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const f of d){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:p}=Qa(u,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m1){const u=r.type==="source"?"target":"source";return s.find(d=>d.type===u)??s[0]}return s[0]}function wD(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],l=(n?o==null?void 0:o.find(h=>h.id===n):o==null?void 0:o[0])??null;return l&&i?{...l,...Qa(a,l,l.position,!0)}:l}function vD(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Lae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const _D=()=>!0;function Mae(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:y,onConnectEnd:w,isValidConnection:g=_D,onReconnectEnd:E,updateConnection:b,getTransform:_,getFromHandle:k,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:N}){const R=uD(e.target);let I=0,M;const{x:B,y:Y}=cs(e),P=vD(i,N),U=o==null?void 0:o.getBoundingClientRect();let C=!1;if(!U||!P)return;const L=wD(s,P,r,l,t);if(!L)return;let O=cs(e,U),j=!1,S=null,H=!1,V=null;function D(){if(!d||!U)return;const[he,J]=Vx(O,U,T);h({x:he,y:J}),I=requestAnimationFrame(D)}const ne={...L,nodeId:s,type:P,position:L.position},ee=l.get(s);let de={inProgress:!0,isValid:null,from:Qa(ee,ne,De.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:ee,to:O,toHandle:null,toPosition:RN[ne.position],toNode:null,pointer:O};function G(){C=!0,b(de),m==null||m(e,{nodeId:s,handleId:r,handleType:P})}A===0&&G();function W(he){if(!C){const{x:Le,y:ve}=cs(he),Ue=Le-B,Ie=ve-Y;if(!(Ue*Ue+Ie*Ie>A*A))return;G()}if(!k()||!ne){oe(he);return}const J=_();O=cs(he,U),M=Oae(Zl(O,J,!1,[1,1]),n,l,ne),j||(D(),j=!0);const ce=TD(he,{handle:M,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:g,doc:R,lib:u,flowId:f,nodeLookup:l});V=ce.handleDomNode,S=ce.connection,H=Lae(!!M,ce.isValid);const Ce=l.get(s),Ee=Ce?Qa(Ce,ne,De.Left,!0):de.from,ge={...de,from:Ee,isValid:H,to:ce.toHandle&&H?Cl({x:ce.toHandle.x,y:ce.toHandle.y},J):O,toHandle:ce.toHandle,toPosition:H&&ce.toHandle?ce.toHandle.position:RN[ne.position],toNode:ce.toHandle?l.get(ce.toHandle.nodeId):null,pointer:O};b(ge),de=ge}function oe(he){if(!("touches"in he&&he.touches.length>0)){if(C){(M||V)&&S&&H&&(y==null||y(S));const{inProgress:J,...ce}=de,Ce={...ce,toPosition:de.toHandle?de.toPosition:null};w==null||w(he,Ce),i&&(E==null||E(he,Ce))}p(),cancelAnimationFrame(I),j=!1,H=!1,S=null,V=null,R.removeEventListener("mousemove",W),R.removeEventListener("mouseup",oe),R.removeEventListener("touchmove",W),R.removeEventListener("touchend",oe)}}R.addEventListener("mousemove",W),R.addEventListener("mouseup",oe),R.addEventListener("touchmove",W),R.addEventListener("touchend",oe)}function TD(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=_D,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${o}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=cs(e),y=a.elementFromPoint(p,m),w=y!=null&&y.classList.contains(`${o}-flow__handle`)?y:h,g={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const E=vD(void 0,w),b=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),k=w.classList.contains("connectable"),T=w.classList.contains("connectableend");if(!b||!E)return g;const A={source:f?b:r,sourceHandle:f?_:s,target:f?r:b,targetHandle:f?s:_};g.connection=A;const R=k&&T&&(n===Nl.Strict?f&&E==="source"||!f&&E==="target":b!==r||_!==s);g.isValid=R&&u(A),g.toHandle=wD(b,E,_,d,n,!0)}return g}const Y1={onPointerDown:Mae,isValid:TD};function Dae({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Ar(e);function i({translateExtent:o,width:l,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const _=n(),k=b.sourceEvent.ctrlKey&&Ju()?10:1,T=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,A=_[2]*Math.pow(2,T*k);t.scaleTo(A)};let y=[0,0];const w=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(y=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},g=b=>{const _=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const k=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],T=[k[0]-y[0],k[1]-y[1]];y=k;const A=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),N={x:_[0]-T[0]*A,y:_[1]-T[1]*A},R=[[0,0],[l,u]];t.setViewportConstrained({x:N.x,y:N.y,zoom:_[2]},R,o)},E=Z3().on("start",w).on("zoom",f?g:null).on("zoom.wheel",h?m:null);s.call(E,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:is}}const $m=e=>({x:e.x,y:e.y,zoom:e.k}),C0=({x:e,y:t,zoom:n})=>Bm.translate(e,t).scale(n),Vo=(e,t)=>e.target.closest(`.${t}`),kD=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Pae=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,I0=(e,t=0,n=Pae,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},ND=e=>{const t=e.ctrlKey&&Ju()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function jae({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Vo(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=is(d),g=ND(d),E=f*Math.pow(2,g);r.scaleTo(n,E,w,d);return}const h=d.deltaMode===1?20:1;let p=s===Da.Vertical?0:d.deltaX*h,m=s===Da.Horizontal?0:d.deltaY*h;!Ju()&&d.shiftKey&&s!==Da.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const y=$m(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(d,y))}}function Bae({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,o=Vo(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,s)}}function Fae({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=$m(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Uae({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(n&&kD(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,$m(i.transform)))}}function $ae({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&kD(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=$m(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},n?150:0)}}}function Hae({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Vo(f,`${u}-flow__node`)||Vo(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||Vo(f,o)&&m||Vo(f,l)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const y=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&y}}function zae({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=Z3().scaleExtent([t,n]).translateExtent(r),h=Ar(e).call(f);E({x:s.x,y:s.y,zoom:Sl(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(ND);async function y(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).transform(I0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}function w({noWheelClassName:M,noPanClassName:B,onPaneContextMenu:Y,userSelectionActive:P,panOnScroll:U,panOnDrag:C,panOnScrollMode:L,panOnScrollSpeed:O,preventScrolling:j,zoomOnPinch:S,zoomOnScroll:H,zoomOnDoubleClick:V,zoomActivationKeyPressed:D,lib:ne,onTransformChange:ee,connectionInProgress:re,paneClickDistance:de,selectionOnDrag:G}){P&&!u.isZoomingOrPanning&&g();const W=U&&!D&&!P;f.clickDistance(G?1/0:!ls(de)||de<0?0:de);const oe=W?jae({zoomPanValues:u,noWheelClassName:M,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:O,zoomOnPinch:S,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Bae({noWheelClassName:M,preventScrolling:j,d3ZoomHandler:p});h.on("wheel.zoom",oe,{passive:!1});const he=Fae({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});f.on("start",he);const J=Uae({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:ee});f.on("zoom",J);const ce=$ae({zoomPanValues:u,panOnDrag:C,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:o,onDraggingChange:l});f.on("end",ce);const Ce=Hae({zoomActivationKeyPressed:D,panOnDrag:C,zoomOnScroll:H,panOnScroll:U,zoomOnDoubleClick:V,zoomOnPinch:S,userSelectionActive:P,noPanClassName:B,noWheelClassName:M,lib:ne,connectionInProgress:re});f.filter(Ce),V?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function E(M,B,Y){const P=C0(M),U=f==null?void 0:f.constrain()(P,B,Y);return U&&await y(U),U}async function b(M,B){const Y=C0(M);return await y(Y,B),Y}function _(M){if(h){const B=C0(M),Y=h.property("__zoom");(Y.k!==M.zoom||Y.x!==M.x||Y.y!==M.y)&&(f==null||f.transform(h,B,null,{sync:!0}))}}function k(){const M=h?Q3(h.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}async function T(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).scaleTo(I0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}async function A(M,B){return h?new Promise(Y=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?lu:Th).scaleBy(I0(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>Y(!0)),M)}):!1}function N(M){f==null||f.scaleExtent(M)}function R(M){f==null||f.translateExtent(M)}function I(M){const B=!ls(M)||M<0?0:M;f==null||f.clickDistance(B)}return{update:w,destroy:g,setViewport:b,setViewportConstrained:E,getViewport:k,scaleTo:T,scaleBy:A,setScaleExtent:N,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var Il;(function(e){e.Line="line",e.Handle="handle"})(Il||(Il={}));function Vae({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,o=n-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function VN(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function bi(e,t){return Math.max(0,t-e)}function Ei(e,t){return Math.max(0,e-t)}function zf(e,t,n){return Math.max(0,t-e,e-n)}function KN(e,t){return e?!t:t}function Kae(e,t,n,r,s,i,a,o){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:y,maxWidth:w,minHeight:g,maxHeight:E}=r,{x:b,y:_,width:k,height:T,aspectRatio:A}=e;let N=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=k+(l?-N:N),M=T+(u?-R:R),B=-i[0]*k,Y=-i[1]*T;let P=zf(I,y,w),U=zf(M,g,E);if(a){let O=0,j=0;l&&N<0?O=bi(b+N+B,a[0][0]):!l&&N>0&&(O=Ei(b+I+B,a[1][0])),u&&R<0?j=bi(_+R+Y,a[0][1]):!u&&R>0&&(j=Ei(_+M+Y,a[1][1])),P=Math.max(P,O),U=Math.max(U,j)}if(o){let O=0,j=0;l&&N>0?O=Ei(b+N,o[0][0]):!l&&N<0&&(O=bi(b+I,o[1][0])),u&&R>0?j=Ei(_+R,o[0][1]):!u&&R<0&&(j=bi(_+M,o[1][1])),P=Math.max(P,O),U=Math.max(U,j)}if(s){if(d){const O=zf(I/A,g,E)*A;if(P=Math.max(P,O),a){let j=0;!l&&!u||l&&!u&&h?j=Ei(_+Y+I/A,a[1][1])*A:j=bi(_+Y+(l?N:-N)/A,a[0][1])*A,P=Math.max(P,j)}if(o){let j=0;!l&&!u||l&&!u&&h?j=bi(_+I/A,o[1][1])*A:j=Ei(_+(l?N:-N)/A,o[0][1])*A,P=Math.max(P,j)}}if(f){const O=zf(M*A,y,w)/A;if(U=Math.max(U,O),a){let j=0;!l&&!u||u&&!l&&h?j=Ei(b+M*A+B,a[1][0])/A:j=bi(b+(u?R:-R)*A+B,a[0][0])/A,U=Math.max(U,j)}if(o){let j=0;!l&&!u||u&&!l&&h?j=bi(b+M*A,o[1][0])/A:j=Ei(b+(u?R:-R)*A,o[0][0])/A,U=Math.max(U,j)}}}R=R+(R<0?U:-U),N=N+(N<0?P:-P),s&&(h?I>M*A?R=(KN(l,u)?-N:N)/A:N=(KN(l,u)?-R:R)*A:d?(R=N/A,u=l):(N=R*A,l=u));const C=l?b+N:b,L=u?_+R:_;return{width:k+(l?-N:N),height:T+(u?-R:R),x:i[0]*N*(l?-1:1)+C,y:i[1]*R*(u?-1:1)+L}}const SD={width:0,height:0,x:0,y:0},Yae={...SD,pointerX:0,pointerY:0,aspectRatio:1};function Wae(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=n[0]*i,l=n[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function qae({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=Ar(e);let a={controlDirection:VN("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:y,shouldResize:w}){let g={...SD},E={...Yae};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:VN(u)};let b,_=null,k=[],T,A,N,R=!1;const I=j3().on("start",M=>{const{nodeLookup:B,transform:Y,snapGrid:P,snapToGrid:U,nodeOrigin:C,paneDomNode:L}=n();if(b=B.get(t),!b)return;_=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:j}=cu(M.sourceEvent,{transform:Y,snapGrid:P,snapToGrid:U,containerBounds:_});g={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},E={...g,pointerX:O,pointerY:j,aspectRatio:g.width/g.height},T=void 0,A=Xa(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(T=B.get(b.parentId)),T&&b.extent==="parent"&&(A=[[0,0],[T.measured.width,T.measured.height]]),k=[],N=void 0;for(const[S,H]of B)if(H.parentId===t&&(k.push({id:S,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const V=Wae(H,b,H.origin??C);N?N=[[Math.min(V[0][0],N[0][0]),Math.min(V[0][1],N[0][1])],[Math.max(V[1][0],N[1][0]),Math.max(V[1][1],N[1][1])]]:N=V}p==null||p(M,{...g})}).on("drag",M=>{const{transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U}=n(),C=cu(M.sourceEvent,{transform:B,snapGrid:Y,snapToGrid:P,containerBounds:_}),L=[];if(!b)return;const{x:O,y:j,width:S,height:H}=g,V={},D=b.origin??U,{width:ne,height:ee,x:re,y:de}=Kae(E,a.controlDirection,C,a.boundaries,a.keepAspectRatio,D,A,N),G=ne!==S,W=ee!==H,oe=re!==O&&G,he=de!==j&&W;if(!oe&&!he&&!G&&!W)return;if((oe||he||D[0]===1||D[1]===1)&&(V.x=oe?re:g.x,V.y=he?de:g.y,g.x=V.x,g.y=V.y,k.length>0)){const Ee=re-O,ge=de-j;for(const Le of k)Le.position={x:Le.position.x-Ee+D[0]*(ne-S),y:Le.position.y-ge+D[1]*(ee-H)},L.push(Le)}if((G||W)&&(V.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:g.width,V.height=W&&(!a.resizeDirection||a.resizeDirection==="vertical")?ee:g.height,g.width=V.width,g.height=V.height),T&&b.expandParent){const Ee=D[0]*(V.width??0);V.x&&V.x{R&&(y==null||y(M,{...g}),s==null||s({...g}),R=!1)});i.call(I)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}var AD={exports:{}},CD={},ID={exports:{}},RD={};/** * @license React * use-sync-external-store-shim.production.js * @@ -675,7 +675,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Rl=v;function Wae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qae=typeof Object.is=="function"?Object.is:Wae,Gae=Rl.useState,Xae=Rl.useEffect,Qae=Rl.useLayoutEffect,Zae=Rl.useDebugValue;function Jae(e,t){var n=t(),r=Gae({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Qae(function(){s.value=n,s.getSnapshot=t,O0(s)&&i({inst:s})},[e,n,t]),Xae(function(){return O0(s)&&i({inst:s}),e(function(){O0(s)&&i({inst:s})})},[e]),Zae(n),n}function O0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qae(e,n)}catch{return!0}}function eoe(e,t){return t()}var toe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?eoe:Jae;RD.useSyncExternalStore=Rl.useSyncExternalStore!==void 0?Rl.useSyncExternalStore:toe;ID.exports=RD;var noe=ID.exports;/** + */var Rl=v;function Gae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xae=typeof Object.is=="function"?Object.is:Gae,Qae=Rl.useState,Zae=Rl.useEffect,Jae=Rl.useLayoutEffect,eoe=Rl.useDebugValue;function toe(e,t){var n=t(),r=Qae({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Jae(function(){s.value=n,s.getSnapshot=t,R0(s)&&i({inst:s})},[e,n,t]),Zae(function(){return R0(s)&&i({inst:s}),e(function(){R0(s)&&i({inst:s})})},[e]),eoe(n),n}function R0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Xae(e,n)}catch{return!0}}function noe(e,t){return t()}var roe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?noe:toe;RD.useSyncExternalStore=Rl.useSyncExternalStore!==void 0?Rl.useSyncExternalStore:roe;ID.exports=RD;var soe=ID.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -683,13 +683,13 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zm=v,roe=noe;function soe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ioe=typeof Object.is=="function"?Object.is:soe,aoe=roe.useSyncExternalStore,ooe=zm.useRef,loe=zm.useEffect,coe=zm.useMemo,uoe=zm.useDebugValue;CD.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=ooe(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=coe(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),s!==void 0&&a.hasValue){var m=a.value;if(s(m,p))return f=m}return f=p}if(m=f,ioe(d,p))return m;var y=r(p);return s!==void 0&&s(m,y)?(d=p,m):(d=p,f=y)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var o=aoe(e,i[0],i[1]);return loe(function(){a.hasValue=!0,a.value=o},[o]),uoe(o),o};AD.exports=CD;var doe=AD.exports;const foe=td(doe),hoe={},Yk=e=>{let t;const n=new Set,r=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(hoe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,s,l);return l},poe=e=>e?Yk(e):Yk,{useDebugValue:moe}=et,{useSyncExternalStoreWithSelector:goe}=foe,yoe=e=>e;function OD(e,t=yoe,n){const r=goe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return moe(r),r}const Wk=(e,t)=>{const n=poe(e),r=(s,i=t)=>OD(n,s,i);return Object.assign(r,n),r},boe=(e,t)=>e?Wk(e,t):Wk;function Xt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Vm=v.createContext(null),Eoe=Vm.Provider,LD=gs.error001("react");function ft(e,t){const n=v.useContext(Vm);if(n===null)throw new Error(LD);return OD(n,e,t)}function Qt(){const e=v.useContext(Vm);if(e===null)throw new Error(LD);return v.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const qk={display:"none"},xoe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},MD="react-flow__node-desc",DD="react-flow__edge-desc",woe="react-flow__aria-live",voe=e=>e.ariaLiveMessage,_oe=e=>e.ariaLabelConfig;function Toe({rfId:e}){const t=ft(voe);return c.jsx("div",{id:`${woe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:xoe,children:t})}function Noe({rfId:e,disableKeyboardA11y:t}){const n=ft(_oe);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${MD}-${e}`,style:qk,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${DD}-${e}`,style:qk,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(Toe,{rfId:e})]})}const Km=v.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return c.jsx("div",{className:xn(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});Km.displayName="Panel";function koe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(Km,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:c.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Soe=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Vf=e=>e.id;function Aoe(e,t){return Xt(e.selectedNodes.map(Vf),t.selectedNodes.map(Vf))&&Xt(e.selectedEdges.map(Vf),t.selectedEdges.map(Vf))}function Coe({onSelectionChange:e}){const t=Qt(),{selectedNodes:n,selectedEdges:r}=ft(Soe,Aoe);return v.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const Ioe=e=>!!e.onSelectionChangeHandlers;function Roe({onSelectionChange:e}){const t=ft(Ioe);return e||t?c.jsx(Coe,{onSelectionChange:e}):null}const PD=[0,0],Ooe={x:0,y:0,zoom:1},Loe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Gk=[...Loe,"rfId"],Moe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Xk={translateExtent:Gu,nodeOrigin:PD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Doe(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=ft(Moe,Xt),u=Qt();v.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Xk,o()}),[]);const d=v.useRef(Xk);return v.useEffect(()=>{for(const f of Gk){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?s(h):f==="translateExtent"?i(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:iae(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Gk.map(f=>e[f])),null}function Qk(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Poe(e){var r;const[t,n]=v.useState(e==="system"?null:e);return v.useEffect(()=>{if(e!=="system"){n(e);return}const s=Qk(),i=()=>n(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),t!==null?t:(r=Qk())!=null&&r.matches?"dark":"light"}const Zk=typeof document<"u"?document:null;function ed(e=null,t={target:Zk,actInsideInputWithModifier:!0}){const[n,r]=v.useState(!1),s=v.useRef(!1),i=v.useRef(new Set([])),[a,o]=v.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` + */var Hm=v,ioe=soe;function aoe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ooe=typeof Object.is=="function"?Object.is:aoe,loe=ioe.useSyncExternalStore,coe=Hm.useRef,uoe=Hm.useEffect,doe=Hm.useMemo,foe=Hm.useDebugValue;CD.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=coe(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=doe(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),s!==void 0&&a.hasValue){var m=a.value;if(s(m,p))return f=m}return f=p}if(m=f,ooe(d,p))return m;var y=r(p);return s!==void 0&&s(m,y)?(d=p,m):(d=p,f=y)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var o=loe(e,i[0],i[1]);return uoe(function(){a.hasValue=!0,a.value=o},[o]),foe(o),o};AD.exports=CD;var hoe=AD.exports;const poe=td(hoe),moe={},YN=e=>{let t;const n=new Set,r=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(moe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,s,l);return l},goe=e=>e?YN(e):YN,{useDebugValue:yoe}=et,{useSyncExternalStoreWithSelector:boe}=poe,Eoe=e=>e;function OD(e,t=Eoe,n){const r=boe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return yoe(r),r}const WN=(e,t)=>{const n=goe(e),r=(s,i=t)=>OD(n,s,i);return Object.assign(r,n),r},xoe=(e,t)=>e?WN(e,t):WN;function Xt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const zm=v.createContext(null),woe=zm.Provider,LD=gs.error001("react");function ft(e,t){const n=v.useContext(zm);if(n===null)throw new Error(LD);return OD(n,e,t)}function Qt(){const e=v.useContext(zm);if(e===null)throw new Error(LD);return v.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const qN={display:"none"},voe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},MD="react-flow__node-desc",DD="react-flow__edge-desc",_oe="react-flow__aria-live",Toe=e=>e.ariaLiveMessage,koe=e=>e.ariaLabelConfig;function Noe({rfId:e}){const t=ft(Toe);return c.jsx("div",{id:`${_oe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:voe,children:t})}function Soe({rfId:e,disableKeyboardA11y:t}){const n=ft(koe);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${MD}-${e}`,style:qN,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${DD}-${e}`,style:qN,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(Noe,{rfId:e})]})}const Vm=v.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return c.jsx("div",{className:xn(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});Vm.displayName="Panel";function Aoe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(Vm,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:c.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Coe=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Vf=e=>e.id;function Ioe(e,t){return Xt(e.selectedNodes.map(Vf),t.selectedNodes.map(Vf))&&Xt(e.selectedEdges.map(Vf),t.selectedEdges.map(Vf))}function Roe({onSelectionChange:e}){const t=Qt(),{selectedNodes:n,selectedEdges:r}=ft(Coe,Ioe);return v.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const Ooe=e=>!!e.onSelectionChangeHandlers;function Loe({onSelectionChange:e}){const t=ft(Ooe);return e||t?c.jsx(Roe,{onSelectionChange:e}):null}const PD=[0,0],Moe={x:0,y:0,zoom:1},Doe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],GN=[...Doe,"rfId"],Poe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),XN={translateExtent:Gu,nodeOrigin:PD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function joe(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=ft(Poe,Xt),u=Qt();v.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=XN,o()}),[]);const d=v.useRef(XN);return v.useEffect(()=>{for(const f of GN){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?s(h):f==="translateExtent"?i(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:oae(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},GN.map(f=>e[f])),null}function QN(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Boe(e){var r;const[t,n]=v.useState(e==="system"?null:e);return v.useEffect(()=>{if(e!=="system"){n(e);return}const s=QN(),i=()=>n(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),t!==null?t:(r=QN())!=null&&r.matches?"dark":"light"}const ZN=typeof document<"u"?document:null;function ed(e=null,t={target:ZN,actInsideInputWithModifier:!0}){const[n,r]=v.useState(!1),s=v.useRef(!1),i=v.useRef(new Set([])),[a,o]=v.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return v.useEffect(()=>{const l=(t==null?void 0:t.target)??Zk,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,g;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&dD(p))return!1;const y=eS(p.code,o);if(i.current.add(p[y]),Jk(a,i.current,!1)){const E=((g=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:g[0])||p.target,b=(E==null?void 0:E.nodeName)==="BUTTON"||(E==null?void 0:E.nodeName)==="A";t.preventDefault!==!1&&(s.current||!b)&&p.preventDefault(),r(!0)}},f=p=>{const m=eS(p.code,o);Jk(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[m]),p.key==="Meta"&&i.current.clear(),s.current=!1},h=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function Jk(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function eS(e,t){return t.includes(e)?"code":"key"}const joe=()=>{const e=Qt();return v.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Kx(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:o,y:l}=a.getBoundingClientRect(),u={x:t.x-o,y:t.y-l},d=n.snapGrid??s,f=n.snapToGrid??i;return Zl(u,r,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:i}=r.getBoundingClientRect(),a=Cl(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function jD(e,t){const n=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of t){const a=r.get(i.id);if(!a){n.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const o={...i};for(const l of a)Boe(l,o);n.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Boe(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function BD(e,t){return jD(e,t)}function FD(e,t){return jD(e,t)}function ya(e,t){return{id:e,type:"select",selected:t}}function Ko(e,t=new Set,n=!1){const r=[];for(const[s,i]of e){const a=t.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(n&&(i.selected=a),r.push(ya(i.id,a)))}return r}function tS({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=t.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&n.push({id:a.id,item:a,type:"replace"}),l===void 0&&n.push({item:a,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function nS(e){return{id:e.id,type:"remove"}}const Foe=oD();function UD(e,t,n={}){return dae(e,t,{...n,onError:n.onError??Foe})}const rS=e=>Xie(e),Uoe=e=>rD(e);function $D(e){return v.forwardRef(e)}const $oe=typeof window<"u"?v.useLayoutEffect:v.useEffect;function sS(e){const[t,n]=v.useState(BigInt(0)),[r]=v.useState(()=>Hoe(()=>n(s=>s+BigInt(1))));return $oe(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function Hoe(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const HD=v.createContext(null);function zoe({children:e}){const t=Qt(),n=v.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let y=l;for(const g of o)y=typeof g=="function"?g(y):g;let w=tS({items:y,lookup:h});for(const g of m.values())w=g(w);d&&u(y),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:E,setNodes:b}=t.getState();g&&b(E)})},[]),r=sS(n),s=v.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=l;for(const m of o)p=typeof m=="function"?m(p):m;d?u(p):f&&f(tS({items:p,lookup:h}))},[]),i=sS(s),a=v.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return c.jsx(HD.Provider,{value:a,children:e})}function Voe(){const e=v.useContext(HD);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Koe=e=>!!e.panZoom;function Zx(){const e=joe(),t=Qt(),n=Voe(),r=ft(Koe),s=v.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},o=f=>{n.edgeQueue.push(f)},l=f=>{var g,E;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=rS(f)?f:h.get(f.id),y=m.parentId?cD(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:y,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((E=m.measured)==null?void 0:E.height)??m.height};return Al(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(y=>{if(y.id===f){const w=typeof h=="function"?h(y):h;return p.replace&&rS(w)?w:{...y,...w}}return y}))},d=(f,h,p={replace:!1})=>{o(m=>m.map(y=>{if(y.id===f){const w=typeof h=="function"?h(y):h;return p.replace&&Uoe(w)?w:{...y,...w}}return y}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=i(f))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:o,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,y,w]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:y,onEdgesDelete:w,triggerNodeChanges:g,triggerEdgeChanges:E,onDelete:b,onBeforeDelete:_}=t.getState(),{nodes:N,edges:T}=await tae({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),A=T.length>0,k=N.length>0;if(A){const R=T.map(nS);w==null||w(T),E(R)}if(k){const R=N.map(nS);y==null||y(N),g(R)}return(k||A)&&(b==null||b({nodes:N,edges:T})),{deletedNodes:N,deletedEdges:T}},getIntersectingNodes:(f,h=!0,p)=>{const m=Lk(f),y=m?f:l(f),w=p!==void 0;return y?(p||t.getState().nodes).filter(g=>{const E=t.getState().nodeLookup.get(g.id);if(E&&!m&&(g.id===f.id||!E.internals.positionAbsolute))return!1;const b=Al(w?g:E),_=Zu(b,y);return h&&_>0||_>=b.width*b.height||_>=y.width*y.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const y=Lk(f)?f:l(f);if(!y)return!1;const w=Zu(y,h);return p&&w>0||w>=h.width*h.height||w>=y.width*y.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Qie(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??sae();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return v.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const iS=e=>e.selected,Yoe=typeof window<"u"?window:void 0;function Woe({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Qt(),{deleteElements:r}=Zx(),s=ed(e,{actInsideInputWithModifier:!1}),i=ed(t,{target:Yoe});v.useEffect(()=>{if(s){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(iS),edges:a.filter(iS)}),n.setState({nodesSelectionActive:!1})}},[s]),v.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function qoe(e){const t=Qt();v.useEffect(()=>{const n=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Yx(e.current);(r.height===0||r.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",gs.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Ym={position:"absolute",width:"100%",height:"100%",top:0,left:0},Goe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Xoe({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Da.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:y,noPanClassName:w,onViewportChange:g,isControlledViewport:E,paneClickDistance:b,selectionOnDrag:_}){const N=Qt(),T=v.useRef(null),{userSelectionActive:A,lib:k,connectionInProgress:R}=ft(Goe,Xt),I=ed(h),M=v.useRef();qoe(T);const B=v.useCallback(Y=>{g==null||g({x:Y[0],y:Y[1],zoom:Y[2]}),E||N.setState({transform:Y})},[g,E]);return v.useEffect(()=>{if(T.current){M.current=$ae({domNode:T.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:C=>N.setState(L=>L.paneDragging===C?L:{paneDragging:C}),onPanZoomStart:(C,L)=>{const{onViewportChangeStart:O,onMoveStart:j}=N.getState();j==null||j(C,L),O==null||O(L)},onPanZoom:(C,L)=>{const{onViewportChange:O,onMove:j}=N.getState();j==null||j(C,L),O==null||O(L)},onPanZoomEnd:(C,L)=>{const{onViewportChangeEnd:O,onMoveEnd:j}=N.getState();j==null||j(C,L),O==null||O(L)}});const{x:Y,y:P,zoom:U}=M.current.getViewport();return N.setState({panZoom:M.current,transform:[Y,P,U],domNode:T.current.closest(".react-flow")}),()=>{var C;(C=M.current)==null||C.destroy()}}},[]),v.useEffect(()=>{var Y;(Y=M.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:A,noWheelClassName:y,lib:k,onTransformChange:B,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:b})},[e,t,n,r,s,i,a,o,I,p,w,A,y,k,B,R,_,b]),c.jsx("div",{className:"react-flow__renderer",ref:T,style:Ym,children:m})}const Qoe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Zoe(){const{userSelectionActive:e,userSelectionRect:t}=ft(Qoe,Xt);return e&&t?c.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const L0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Joe=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ele({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xu.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:y}){const w=v.useRef(0),g=Qt(),{userSelectionActive:E,elementsSelectable:b,dragging:_,connectionInProgress:N,panBy:T,autoPanSpeed:A}=ft(Joe,Xt),k=b&&(e||E),R=v.useRef(null),I=v.useRef(),M=v.useRef(new Set),B=v.useRef(new Set),Y=v.useRef(!1),P=v.useRef({x:0,y:0}),U=v.useRef(!1),C=G=>{if(Y.current||N){Y.current=!1;return}u==null||u(G),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},L=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}d==null||d(G)},O=f?G=>f(G):void 0,j=G=>{Y.current&&(G.stopPropagation(),Y.current=!1)},S=G=>{var Le,ve;const{domNode:W,transform:oe}=g.getState();if(I.current=W==null?void 0:W.getBoundingClientRect(),!I.current)return;const he=G.target===R.current;if(!he&&!!G.target.closest(".nokey")||!e||!(a&&he||t)||G.button!==0||!G.isPrimary)return;(ve=(Le=G.target)==null?void 0:Le.setPointerCapture)==null||ve.call(Le,G.pointerId),Y.current=!1;const{x:Ce,y:Ee}=cs(G.nativeEvent,I.current),ge=Zl({x:Ce,y:Ee},oe);g.setState({userSelectionRect:{width:0,height:0,startX:ge.x,startY:ge.y,x:Ce,y:Ee}}),he||(G.stopPropagation(),G.preventDefault())};function H(G,W){const{userSelectionRect:oe}=g.getState();if(!oe)return;const{transform:he,nodeLookup:J,edgeLookup:ce,connectionLookup:Ce,triggerNodeChanges:Ee,triggerEdgeChanges:ge,defaultEdgeOptions:Le}=g.getState(),ve={x:oe.startX,y:oe.startY},{x:Ue,y:Ie}=Cl(ve,he),ae={startX:ve.x,startY:ve.y,x:Gct.id)),B.current=new Set;const vt=(Le==null?void 0:Le.selectable)??!0;for(const ct of M.current){const K=Ce.get(ct);if(K)for(const{edgeId:X}of K.values()){const le=ce.get(X);le&&(le.selectable??vt)&&B.current.add(X)}}if(!Mk(wt,M.current)){const ct=Ko(J,M.current,!0);Ee(ct)}if(!Mk(we,B.current)){const ct=Ko(ce,B.current);ge(ct)}g.setState({userSelectionRect:ae,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!s||!I.current)return;const[G,W]=Vx(P.current,I.current,A);T({x:G,y:W}).then(oe=>{if(!Y.current||!oe){w.current=requestAnimationFrame(V);return}const{x:he,y:J}=P.current;H(he,J),w.current=requestAnimationFrame(V)})}const D=()=>{cancelAnimationFrame(w.current),w.current=0,U.current=!1};v.useEffect(()=>()=>D(),[]);const ne=G=>{const{userSelectionRect:W,transform:oe,resetSelectedElements:he}=g.getState();if(!I.current||!W)return;const{x:J,y:ce}=cs(G.nativeEvent,I.current);P.current={x:J,y:ce};const Ce=Cl({x:W.startX,y:W.startY},oe);if(!Y.current){const Ee=t?0:i;if(Math.hypot(J-Ce.x,ce-Ce.y)<=Ee)return;he(),o==null||o(G)}Y.current=!0,U.current||(V(),U.current=!0),H(J,ce)},ee=G=>{var W,oe;G.button===0&&((oe=(W=G.target)==null?void 0:W.releasePointerCapture)==null||oe.call(W,G.pointerId),!E&&G.target===R.current&&g.getState().userSelectionRect&&(C==null||C(G)),g.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(l==null||l(G),g.setState({nodesSelectionActive:M.current.size>0})),D())},re=G=>{var W,oe;(oe=(W=G.target)==null?void 0:W.releasePointerCapture)==null||oe.call(W,G.pointerId),D()},de=r===!0||Array.isArray(r)&&r.includes(0);return c.jsxs("div",{className:xn(["react-flow__pane",{draggable:de,dragging:_,selection:e}]),onClick:k?void 0:L0(C,R),onContextMenu:L0(L,R),onWheel:L0(O,R),onPointerEnter:k?void 0:h,onPointerMove:k?ne:p,onPointerUp:k?ee:void 0,onPointerCancel:k?re:void 0,onPointerDownCapture:k?S:void 0,onClickCapture:k?j:void 0,onPointerLeave:m,ref:R,style:Ym,children:[y,c.jsx(Zoe,{})]})}function q1({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=t.getState(),u=o.get(e);if(!u){l==null||l("012",gs.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):s([e])}function zD({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Qt(),[l,u]=v.useState(!1),d=v.useRef();return v.useEffect(()=>{d.current=Sae({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{q1({id:f,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),v.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,r,t,i,e,s,a]),l}const tle=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function VD(){const e=Qt();return v.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=tle(a),p=s?i[0]:5,m=s?i[1]:5,y=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,g]of u){if(!h(g))continue;let E={x:g.internals.positionAbsolute.x+y,y:g.internals.positionAbsolute.y+w};s&&(E=Pd(E,i));const{position:b,positionAbsolute:_}=sD({nodeId:g.id,nextPosition:E,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:o});g.position=b,g.internals.positionAbsolute=_,f.set(g.id,g)}l(f)},[])}const Jx=v.createContext(null),nle=Jx.Provider;Jx.Consumer;const KD=()=>v.useContext(Jx),rle=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),sle=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:d,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:i===kl.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:d&&u}};function ile({type:e="source",position:t=De.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:d,onTouchStart:f,...h},p){var U,C;const m=a||null,y=e==="target",w=Qt(),g=KD(),{connectOnClick:E,noPanClassName:b,rfId:_}=ft(rle,Xt),{connectingFrom:N,connectingTo:T,clickConnecting:A,isPossibleEndHandle:k,connectionInProcess:R,clickConnectionInProcess:I,valid:M}=ft(sle(g,m,e),Xt);g||(C=(U=w.getState()).onError)==null||C.call(U,"010",gs.error010());const B=L=>{const{defaultEdgeOptions:O,onConnect:j,hasDefaultEdges:S}=w.getState(),H={...O,...L};if(S){const{edges:V,setEdges:D,onError:ne}=w.getState();D(UD(H,V,{onError:ne}))}j==null||j(H),o==null||o(H)},Y=L=>{if(!g)return;const O=fD(L.nativeEvent);if(s&&(O&&L.button===0||!O)){const j=w.getState();W1.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:y,handleId:m,nodeId:g,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...S)=>{var H,V;return(V=(H=w.getState()).onConnectEnd)==null?void 0:V.call(H,...S)},updateConnection:j.updateConnection,onConnect:B,isValidConnection:n||((...S)=>{var H,V;return((V=(H=w.getState()).isValidConnection)==null?void 0:V.call(H,...S))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}O?d==null||d(L):f==null||f(L)},P=L=>{const{onClickConnectStart:O,onClickConnectEnd:j,connectionClickStartHandle:S,connectionMode:H,isValidConnection:V,lib:D,rfId:ne,nodeLookup:ee,connection:re}=w.getState();if(!g||!S&&!s)return;if(!S){O==null||O(L.nativeEvent,{nodeId:g,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const de=uD(L.target),G=n||V,{connection:W,isValid:oe}=W1.isValid(L.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:H,fromNodeId:S.nodeId,fromHandleId:S.id||null,fromType:S.type,isValidConnection:G,flowId:ne,doc:de,lib:D,nodeLookup:ee});oe&&W&&B(W);const he=structuredClone(re);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,j==null||j(L,he),w.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${_}-${g}-${m}-${e}`,className:xn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!y,target:y,connectable:r,connectablestart:s,connectableend:i,clickconnecting:A,connectingfrom:N,connectingto:T,valid:M,connectionindicator:r&&(!R||k)&&(R||I?i:s)}]),onMouseDown:Y,onTouchStart:Y,onClick:E?P:void 0,ref:p,...h,children:l})}const Ol=v.memo($D(ile));function ale({data:e,isConnectable:t,sourcePosition:n=De.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Ol,{type:"source",position:n,isConnectable:t})]})}function ole({data:e,isConnectable:t,targetPosition:n=De.Top,sourcePosition:r=De.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Ol,{type:"source",position:r,isConnectable:t})]})}function lle(){return null}function cle({data:e,isConnectable:t,targetPosition:n=De.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Fp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},aS={input:ale,default:ole,output:cle,group:lle};function ule(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const dle=e=>{const{width:t,height:n,x:r,y:s}=Dd(e.nodeLookup,{filter:i=>!!i.selected});return{width:ls(t)?t:null,height:ls(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function fle({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Qt(),{width:s,height:i,transformString:a,userSelectionActive:o}=ft(dle,Xt),l=VD(),u=v.useRef(null);v.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!o&&s!==null&&i!==null;if(zD({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(y=>y.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Fp,p.key)&&(p.preventDefault(),l({direction:Fp[p.key],factor:p.shiftKey?4:1}))};return c.jsx("div",{className:xn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:c.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:s,height:i}})})}const oS=typeof window<"u"?window:void 0,hle=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function YD({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:y,zoomActivationKeyCode:w,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:_,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:k,autoPanOnSelection:R,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:Y,preventScrolling:P,onSelectionContextMenu:U,noWheelClassName:C,noPanClassName:L,disableKeyboardA11y:O,onViewportChange:j,isControlledViewport:S}){const{nodesSelectionActive:H,userSelectionActive:V}=ft(hle,Xt),D=ed(u,{target:oS}),ne=ed(y,{target:oS}),ee=ne||k,re=ne||_,de=d&&ee!==!0,G=D||V||de;return Woe({deleteKeyCode:l,multiSelectionKeyCode:m}),c.jsx(Xoe,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:re,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!D&&ee,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:Y,zoomActivationKeyCode:w,preventScrolling:P,noWheelClassName:C,noPanClassName:L,onViewportChange:j,isControlledViewport:S,paneClickDistance:o,selectionOnDrag:de,children:c.jsxs(ele,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ee,autoPanOnSelection:R,isSelecting:!!G,selectionMode:f,selectionKeyPressed:D,paneClickDistance:o,selectionOnDrag:de,children:[e,H&&c.jsx(fle,{onSelectionContextMenu:U,noPanClassName:L,disableKeyboardA11y:O})]})})}YD.displayName="FlowRenderer";const ple=v.memo(YD),mle=e=>t=>e?zx(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function gle(e){return ft(v.useCallback(mle(e),[e]),Xt)}const yle=e=>e.updateNodeInternals;function ble(){const e=ft(yle),[t]=v.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return v.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Ele({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Qt(),i=v.useRef(null),a=v.useRef(null),o=v.useRef(e.sourcePosition),l=v.useRef(e.targetPosition),u=v.useRef(t),d=n&&!!e.internals.handleBounds;return v.useEffect(()=>{i.current&&!e.hidden&&(!d||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[d,e.hidden]),v.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),v.useEffect(()=>{if(i.current){const f=u.current!==t,h=o.current!==e.sourcePosition,p=l.current!==e.targetPosition;(f||h||p)&&(u.current=t,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function xle({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:y,nodeTypes:w,nodeClickDistance:g,onError:E}){const{node:b,internals:_,isParent:N}=ft(G=>{const W=G.nodeLookup.get(e),oe=G.parentLookup.has(e);return{node:W,internals:W.internals,isParent:oe}},Xt);let T=b.type||"default",A=(w==null?void 0:w[T])||aS[T];A===void 0&&(E==null||E("003",gs.error003(T)),T="default",A=(w==null?void 0:w.default)||aS.default);const k=!!(b.draggable||o&&typeof b.draggable>"u"),R=!!(b.selectable||l&&typeof b.selectable>"u"),I=!!(b.connectable||u&&typeof b.connectable>"u"),M=!!(b.focusable||d&&typeof b.focusable>"u"),B=Qt(),Y=lD(b),P=Ele({node:b,nodeType:T,hasDimensions:Y,resizeObserver:f}),U=zD({nodeRef:P,disabled:b.hidden||!k,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:g}),C=VD();if(b.hidden)return null;const L=hi(b),O=ule(b),j=R||k||t||n||r||s,S=n?G=>n(G,{..._.userNode}):void 0,H=r?G=>r(G,{..._.userNode}):void 0,V=s?G=>s(G,{..._.userNode}):void 0,D=i?G=>i(G,{..._.userNode}):void 0,ne=a?G=>a(G,{..._.userNode}):void 0,ee=G=>{const{selectNodesOnDrag:W,nodeDragThreshold:oe}=B.getState();R&&(!W||!k||oe>0)&&q1({id:e,store:B,nodeRef:P}),t&&t(G,{..._.userNode})},re=G=>{if(!(dD(G.nativeEvent)||m)){if(J3.includes(G.key)&&R){const W=G.key==="Escape";q1({id:e,store:B,unselect:W,nodeRef:P})}else if(k&&b.selected&&Object.prototype.hasOwnProperty.call(Fp,G.key)){G.preventDefault();const{ariaLabelConfig:W}=B.getState();B.setState({ariaLiveMessage:W["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:Fp[G.key],factor:G.shiftKey?4:1})}}},de=()=>{var Ce;if(m||!((Ce=P.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:G,width:W,height:oe,autoPanOnNodeFocus:he,setCenter:J}=B.getState();if(!he)return;zx(new Map([[e,b]]),{x:0,y:0,width:W,height:oe},G,!0).length>0||J(b.position.x+L.width/2,b.position.y+L.height/2,{zoom:G[2]})};return c.jsx("div",{className:xn(["react-flow__node",`react-flow__node-${T}`,{[p]:k},b.className,{selected:b.selected,selectable:R,parent:N,draggable:k,dragging:U}]),ref:P,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:Y?"visible":"hidden",...b.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:S,onMouseMove:H,onMouseLeave:V,onContextMenu:D,onClick:ee,onDoubleClick:ne,onKeyDown:M?re:void 0,tabIndex:M?0:void 0,onFocus:M?de:void 0,role:b.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${MD}-${y}`,"aria-label":b.ariaLabel,...b.domAttributes,children:c.jsx(nle,{value:e,children:c.jsx(A,{id:e,data:b.data,type:T,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:b.selected??!1,selectable:R,draggable:k,deletable:b.deletable??!0,isConnectable:I,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:U,dragHandle:b.dragHandle,zIndex:_.z,parentId:b.parentId,...L})})})}var wle=v.memo(xle);const vle=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function WD(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=ft(vle,Xt),a=gle(e.onlyRenderVisibleElements),o=ble();return c.jsx("div",{className:"react-flow__nodes",style:Ym,children:a.map(l=>c.jsx(wle,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}WD.displayName="NodeRenderer";const _le=v.memo(WD);function Tle(e){return ft(v.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const i=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);i&&a&&lae({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Xt)}const Nle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},kle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},lS={[Qu.Arrow]:Nle,[Qu.ArrowClosed]:kle};function Sle(e){const t=Qt();return v.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(lS,e)?lS[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",gs.error009(e)),null)},[e])}const Ale=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=Sle(t);return l?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:c.jsx(l,{color:n,strokeWidth:a})}):null},qD=({defaultColor:e,rfId:t})=>{const n=ft(i=>i.edges),r=ft(i=>i.defaultEdgeOptions),s=v.useMemo(()=>gae(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:s.map(i=>c.jsx(Ale,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};qD.displayName="MarkerDefinitions";var Cle=v.memo(qD);function GD({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,...d}){const[f,h]=v.useState({x:1,y:0,width:0,height:0}),p=xn(["react-flow__edge-textwrapper",u]),m=v.useRef(null);return v.useEffect(()=>{if(m.current){const y=m.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&c.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),c.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),l]}):null}GD.displayName="EdgeText";const Ile=v.memo(GD);function Wm({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...d,d:e,fill:"none",className:xn(["react-flow__edge-path",d.className])}),u?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ls(t)&&ls(n)?c.jsx(Ile,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function cS({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===De.Left||e===De.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function XD({sourceX:e,sourceY:t,sourcePosition:n=De.Bottom,targetX:r,targetY:s,targetPosition:i=De.Top}){const[a,o]=cS({pos:n,x1:e,y1:t,x2:r,y2:s}),[l,u]=cS({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=hD({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${o} ${l},${u} ${r},${s}`,d,f,h,p]}function QD(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:g})=>{const[E,b,_]=XD({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),N=e.isInternal?void 0:t;return c.jsx(Wm,{id:N,path:E,labelX:b,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:g})})}const Rle=QD({isInternal:!1}),ZD=QD({isInternal:!0});Rle.displayName="SimpleBezierEdge";ZD.displayName="SimpleBezierEdgeInternal";function JD(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=De.Bottom,targetPosition:m=De.Top,markerEnd:y,markerStart:w,pathOptions:g,interactionWidth:E})=>{const[b,_,N]=V1({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),T=e.isInternal?void 0:t;return c.jsx(Wm,{id:T,path:b,labelX:_,labelY:N,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:w,interactionWidth:E})})}const eP=JD({isInternal:!1}),tP=JD({isInternal:!0});eP.displayName="SmoothStepEdge";tP.displayName="SmoothStepEdgeInternal";function nP(e){return v.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return c.jsx(eP,{...n,id:r,pathOptions:v.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Ole=nP({isInternal:!1}),rP=nP({isInternal:!0});Ole.displayName="StepEdge";rP.displayName="StepEdgeInternal";function sP(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})=>{const[w,g,E]=gD({sourceX:n,sourceY:r,targetX:s,targetY:i}),b=e.isInternal?void 0:t;return c.jsx(Wm,{id:b,path:w,labelX:g,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})})}const Lle=sP({isInternal:!1}),iP=sP({isInternal:!0});Lle.displayName="StraightEdge";iP.displayName="StraightEdgeInternal";function aP(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=De.Bottom,targetPosition:o=De.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,pathOptions:g,interactionWidth:E})=>{const[b,_,N]=pD({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:g==null?void 0:g.curvature}),T=e.isInternal?void 0:t;return c.jsx(Wm,{id:T,path:b,labelX:_,labelY:N,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:E})})}const Mle=aP({isInternal:!1}),oP=aP({isInternal:!0});Mle.displayName="BezierEdge";oP.displayName="BezierEdgeInternal";const uS={default:oP,straight:iP,step:rP,smoothstep:tP,simplebezier:ZD},dS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Dle=(e,t,n)=>n===De.Left?e-t:n===De.Right?e+t:e,Ple=(e,t,n)=>n===De.Top?e-t:n===De.Bottom?e+t:e,fS="react-flow__edgeupdater";function hS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return c.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:xn([fS,`${fS}-${o}`]),cx:Dle(t,r,e),cy:Ple(n,r,e),r,stroke:"transparent",fill:"transparent"})}function jle({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Qt(),y=(_,N)=>{if(_.button!==0)return;const{autoPanOnConnect:T,domNode:A,connectionMode:k,connectionRadius:R,lib:I,onConnectStart:M,cancelConnection:B,nodeLookup:Y,rfId:P,panBy:U,updateConnection:C}=m.getState(),L=N.type==="target",O=(H,V)=>{h(!1),f==null||f(H,n,N.type,V)},j=H=>u==null?void 0:u(n,H),S=(H,V)=>{h(!0),d==null||d(_,n,N.type),M==null||M(H,V)};W1.onPointerDown(_.nativeEvent,{autoPanOnConnect:T,connectionMode:k,connectionRadius:R,domNode:A,handleId:N.id,nodeId:N.nodeId,nodeLookup:Y,isTarget:L,edgeUpdaterType:N.type,lib:I,flowId:P,cancelConnection:B,panBy:U,isValidConnection:(...H)=>{var V,D;return((D=(V=m.getState()).isValidConnection)==null?void 0:D.call(V,...H))??!0},onConnect:j,onConnectStart:S,onConnectEnd:(...H)=>{var V,D;return(D=(V=m.getState()).onConnectEnd)==null?void 0:D.call(V,...H)},onReconnectEnd:O,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>y(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=_=>y(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>p(!0),b=()=>p(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(hS,{position:o,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:E,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&c.jsx(hS,{position:l,centerX:i,centerY:a,radius:t,onMouseDown:g,onMouseEnter:E,onMouseOut:b,type:"target"})]})}function Ble({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:y,noPanClassName:w,onError:g,disableKeyboardA11y:E}){let b=ft(J=>J.edgeLookup.get(e));const _=ft(J=>J.defaultEdgeOptions);b=_?{..._,...b}:b;let N=b.type||"default",T=(y==null?void 0:y[N])||uS[N];T===void 0&&(g==null||g("011",gs.error011(N)),N="default",T=(y==null?void 0:y.default)||uS.default);const A=!!(b.focusable||t&&typeof b.focusable>"u"),k=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),R=!!(b.selectable||r&&typeof b.selectable>"u"),I=v.useRef(null),[M,B]=v.useState(!1),[Y,P]=v.useState(!1),U=Qt(),{zIndex:C,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V}=ft(v.useCallback(J=>{const ce=J.nodeLookup.get(b.source),Ce=J.nodeLookup.get(b.target);if(!ce||!Ce)return{zIndex:b.zIndex,...dS};const Ee=mae({id:e,sourceNode:ce,targetNode:Ce,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:J.connectionMode,onError:g});return{zIndex:oae({selected:b.selected,zIndex:b.zIndex,sourceNode:ce,targetNode:Ce,elevateOnSelect:J.elevateEdgesOnSelect,zIndexMode:J.zIndexMode}),...Ee||dS}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Xt),D=v.useMemo(()=>b.markerStart?`url('#${K1(b.markerStart,m)}')`:void 0,[b.markerStart,m]),ne=v.useMemo(()=>b.markerEnd?`url('#${K1(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||L===null||O===null||j===null||S===null)return null;const ee=J=>{var ge;const{addSelectedEdges:ce,unselectNodesAndEdges:Ce,multiSelectionActive:Ee}=U.getState();R&&(U.setState({nodesSelectionActive:!1}),b.selected&&Ee?(Ce({nodes:[],edges:[b]}),(ge=I.current)==null||ge.blur()):ce([e])),s&&s(J,b)},re=i?J=>{i(J,{...b})}:void 0,de=a?J=>{a(J,{...b})}:void 0,G=o?J=>{o(J,{...b})}:void 0,W=l?J=>{l(J,{...b})}:void 0,oe=u?J=>{u(J,{...b})}:void 0,he=J=>{var ce;if(!E&&J3.includes(J.key)&&R){const{unselectNodesAndEdges:Ce,addSelectedEdges:Ee}=U.getState();J.key==="Escape"?((ce=I.current)==null||ce.blur(),Ce({edges:[b]})):Ee([e])}};return c.jsx("svg",{style:{zIndex:C},children:c.jsxs("g",{className:xn(["react-flow__edge",`react-flow__edge-${N}`,b.className,w,{selected:b.selected,animated:b.animated,inactive:!R&&!s,updating:M,selectable:R}]),onClick:ee,onDoubleClick:re,onContextMenu:de,onMouseEnter:G,onMouseMove:W,onMouseLeave:oe,onKeyDown:A?he:void 0,tabIndex:A?0:void 0,role:b.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":A?`${DD}-${m}`:void 0,ref:I,...b.domAttributes,children:[!Y&&c.jsx(T,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:R,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:D,markerEnd:ne,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),k&&c.jsx(jle,{edge:b,isReconnectable:k,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V,setUpdateHover:B,setReconnecting:P})]})})}var Fle=v.memo(Ble);const Ule=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function lP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:y}){const{edgesFocusable:w,edgesReconnectable:g,elementsSelectable:E,onError:b}=ft(Ule,Xt),_=Tle(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(Cle,{defaultColor:e,rfId:n}),_.map(N=>c.jsx(Fle,{id:N,edgesFocusable:w,edgesReconnectable:g,elementsSelectable:E,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:y},N))]})}lP.displayName="EdgeRenderer";const $le=v.memo(lP),Hle=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function zle({children:e}){const t=ft(Hle);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Vle(e){const t=Zx(),n=v.useRef(!1);v.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Kle=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Yle(e){const t=ft(Kle),n=Qt();return v.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Wle(e){return e.connection.inProgress?{...e.connection,to:Zl(e.connection.to,e.transform)}:{...e.connection}}function qle(e){return Wle}function Gle(e){const t=qle();return ft(t,Xt)}const Xle=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Qle({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=ft(Xle,Xt);return!(i&&s&&l)?null:c.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:xn(["react-flow__connection",nD(o)]),children:c.jsx(cP,{style:t,type:n,CustomComponent:r,isValid:o})})})}const cP=({style:e,type:t=Ci.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Gle();if(!s)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:h,connectionStatus:nD(r),toNode:d,toHandle:f,pointer:p});let m="";const y={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ci.Bezier:[m]=pD(y);break;case Ci.SimpleBezier:[m]=XD(y);break;case Ci.Step:[m]=V1({...y,borderRadius:0});break;case Ci.SmoothStep:[m]=V1(y);break;default:[m]=gD(y)}return c.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};cP.displayName="ConnectionLine";const Zle={};function pS(e=Zle){v.useRef(e),Qt(),v.useEffect(()=>{},[e])}function Jle(){Qt(),v.useRef(!1),v.useEffect(()=>{},[])}function uP({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:y,connectionLineComponent:w,connectionLineContainerStyle:g,selectionKeyCode:E,selectionOnDrag:b,selectionMode:_,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:k,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:M,translateExtent:B,minZoom:Y,maxZoom:P,preventScrolling:U,defaultMarkerColor:C,zoomOnScroll:L,zoomOnPinch:O,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:H,zoomOnDoubleClick:V,panOnDrag:D,autoPanOnSelection:ne,onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:de,onPaneMouseLeave:G,onPaneScroll:W,onPaneContextMenu:oe,paneClickDistance:he,nodeClickDistance:J,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:ge,reconnectRadius:Le,onReconnect:ve,onReconnectStart:Ue,onReconnectEnd:Ie,noDragClassName:ae,noWheelClassName:wt,noPanClassName:we,disableKeyboardA11y:vt,nodeExtent:ct,rfId:K,viewport:X,onViewportChange:le}){return pS(e),pS(t),Jle(),Vle(n),Yle(X),c.jsx(ple,{onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:de,onPaneMouseLeave:G,onPaneContextMenu:oe,onPaneScroll:W,paneClickDistance:he,deleteKeyCode:k,selectionKeyCode:E,selectionOnDrag:b,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:I,zoomOnScroll:L,zoomOnPinch:O,zoomOnDoubleClick:V,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:H,panOnDrag:D,autoPanOnSelection:ne,defaultViewport:M,translateExtent:B,minZoom:Y,maxZoom:P,onSelectionContextMenu:f,preventScrolling:U,noDragClassName:ae,noWheelClassName:wt,noPanClassName:we,disableKeyboardA11y:vt,onViewportChange:le,isControlledViewport:!!X,children:c.jsxs(zle,{children:[c.jsx($le,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:ve,onReconnectStart:Ue,onReconnectEnd:Ie,onlyRenderVisibleElements:R,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:ge,reconnectRadius:Le,defaultMarkerColor:C,noPanClassName:we,disableKeyboardA11y:vt,rfId:K}),c.jsx(Qle,{style:y,type:m,component:w,containerStyle:g}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(_le,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:J,onlyRenderVisibleElements:R,noPanClassName:we,noDragClassName:ae,disableKeyboardA11y:vt,nodeExtent:ct,rfId:K}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}uP.displayName="GraphView";const ece=v.memo(uP),tce=oD(),mS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,y=new Map,w=new Map,g=r??t??[],E=n??e??[],b=d??[0,0],_=f??Gu;ED(y,w,g);const{nodesInitialized:N}=Y1(E,p,m,{nodeOrigin:b,nodeExtent:_,zIndexMode:h});let T=[0,0,1];if(a&&s&&i){const A=Dd(p,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:k,y:R,zoom:I}=Kx(A,s,i,l,u,(o==null?void 0:o.padding)??.1);T=[k,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:T,nodes:E,nodesInitialized:N,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:w,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Gu,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:kl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...tD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:tce,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:eD,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nce=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>boe((p,m)=>{async function y(){const{nodeLookup:w,panZoom:g,fitViewOptions:E,fitViewResolver:b,width:_,height:N,minZoom:T,maxZoom:A}=m();g&&(await eae({nodes:w,width:_,height:N,panZoom:g,minZoom:T,maxZoom:A},E),b==null||b.resolve(!0),p({fitViewResolver:null}))}return{...mS({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:g,parentLookup:E,nodeOrigin:b,elevateNodesOnSelect:_,fitViewQueued:N,zIndexMode:T,nodesSelectionActive:A}=m(),{nodesInitialized:k,hasSelectedNodes:R}=Y1(w,g,E,{nodeOrigin:b,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:T}),I=A&&R;N&&k?(y(),p({nodes:w,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:k,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:g,edgeLookup:E}=m();ED(g,E,w),p({edges:w})},setDefaultNodesAndEdges:(w,g)=>{if(w){const{setNodes:E}=m();E(w),p({hasDefaultNodes:!0})}if(g){const{setEdges:E}=m();E(g),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:g,nodeLookup:E,parentLookup:b,domNode:_,nodeOrigin:N,nodeExtent:T,debug:A,fitViewQueued:k,zIndexMode:R}=m(),{changes:I,updatedInternals:M}=_ae(w,E,b,_,N,T,R);M&&(Eae(E,b,{nodeOrigin:N,nodeExtent:T,zIndexMode:R}),k?(y(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(A&&console.log("React Flow: trigger node changes",I),g==null||g(I)))},updateNodePositions:(w,g=!1)=>{const E=[];let b=[];const{nodeLookup:_,triggerNodeChanges:N,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:k}=m();for(const[R,I]of w){const M=_.get(R),B=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(I!=null&&I.position)),Y={id:R,type:"position",position:B?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:g};if(M&&T.inProgress&&T.fromNode.id===M.id){const P=Qa(M,T.fromHandle,De.Left,!0);A({...T,from:P})}B&&M.parentId&&E.push({id:R,parentId:M.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),b.push(Y)}if(E.length>0){const{parentLookup:R,nodeOrigin:I}=m(),M=Qx(E,_,R,I);b.push(...M)}for(const R of k.values())b=R(b);N(b)},triggerNodeChanges:w=>{const{onNodesChange:g,setNodes:E,nodes:b,hasDefaultNodes:_,debug:N}=m();if(w!=null&&w.length){if(_){const T=BD(w,b);E(T)}N&&console.log("React Flow: trigger node changes",w),g==null||g(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:g,setEdges:E,edges:b,hasDefaultEdges:_,debug:N}=m();if(w!=null&&w.length){if(_){const T=FD(w,b);E(T)}N&&console.log("React Flow: trigger edge changes",w),g==null||g(w)}},addSelectedNodes:w=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:N}=m();if(g){const T=w.map(A=>ya(A,!0));_(T);return}_(Ko(b,new Set([...w]),!0)),N(Ko(E))},addSelectedEdges:w=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:N}=m();if(g){const T=w.map(A=>ya(A,!0));N(T);return}N(Ko(E,new Set([...w]))),_(Ko(b,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:g}={})=>{const{edges:E,nodes:b,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:T}=m(),A=w||b,k=g||E,R=[];for(const M of A){if(!M.selected)continue;const B=_.get(M.id);B&&(B.selected=!1),R.push(ya(M.id,!1))}const I=[];for(const M of k)M.selected&&I.push(ya(M.id,!1));N(R),T(I)},setMinZoom:w=>{const{panZoom:g,maxZoom:E}=m();g==null||g.setScaleExtent([w,E]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:g,minZoom:E}=m();g==null||g.setScaleExtent([E,w]),p({maxZoom:w})},setTranslateExtent:w=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:g,triggerNodeChanges:E,triggerEdgeChanges:b,elementsSelectable:_}=m();if(!_)return;const N=g.reduce((A,k)=>k.selected?[...A,ya(k.id,!1)]:A,[]),T=w.reduce((A,k)=>k.selected?[...A,ya(k.id,!1)]:A,[]);E(N),b(T)},setNodeExtent:w=>{const{nodes:g,nodeLookup:E,parentLookup:b,nodeOrigin:_,elevateNodesOnSelect:N,nodeExtent:T,zIndexMode:A}=m();w[0][0]===T[0][0]&&w[0][1]===T[0][1]&&w[1][0]===T[1][0]&&w[1][1]===T[1][1]||(Y1(g,E,b,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:A}),p({nodeExtent:w}))},panBy:w=>{const{transform:g,width:E,height:b,panZoom:_,translateExtent:N}=m();return Tae({delta:w,panZoom:_,transform:g,translateExtent:N,width:E,height:b})},setCenter:async(w,g,E)=>{const{width:b,height:_,maxZoom:N,panZoom:T}=m();if(!T)return!1;const A=typeof(E==null?void 0:E.zoom)<"u"?E.zoom:N;return await T.setViewport({x:b/2-w*A,y:_/2-g*A,zoom:A},{duration:E==null?void 0:E.duration,ease:E==null?void 0:E.ease,interpolate:E==null?void 0:E.interpolate}),!0},cancelConnection:()=>{p({connection:{...tD}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...mS()})}},Object.is);function dP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=v.useState(()=>nce({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return c.jsx(Eoe,{value:m,children:c.jsx(zoe,{children:p})})}function rce({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return v.useContext(Vm)?c.jsx(c.Fragment,{children:e}):c.jsx(dP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const sce={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ice({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:g,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:N,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:k,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:M,onDelete:B,onSelectionChange:Y,onSelectionDragStart:P,onSelectionDrag:U,onSelectionDragStop:C,onSelectionContextMenu:L,onSelectionStart:O,onSelectionEnd:j,onBeforeDelete:S,connectionMode:H,connectionLineType:V=Ci.Bezier,connectionLineStyle:D,connectionLineComponent:ne,connectionLineContainerStyle:ee,deleteKeyCode:re="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:G=!1,selectionMode:W=Xu.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:he=Ju()?"Meta":"Control",zoomActivationKeyCode:J=Ju()?"Meta":"Control",snapToGrid:ce,snapGrid:Ce,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:ge,nodesDraggable:Le,autoPanOnNodeFocus:ve,nodesConnectable:Ue,nodesFocusable:Ie,nodeOrigin:ae=PD,edgesFocusable:wt,edgesReconnectable:we,elementsSelectable:vt=!0,defaultViewport:ct=Ooe,minZoom:K=.5,maxZoom:X=2,translateExtent:le=Gu,preventScrolling:Ne=!0,nodeExtent:Re,defaultMarkerColor:ut="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:ot=!0,panOnScroll:Zt=!1,panOnScrollSpeed:Ct=.5,panOnScrollMode:Ge=Da.Free,zoomOnDoubleClick:Et=!0,panOnDrag:Ht=!0,onPaneClick:Nn,onPaneMouseEnter:Fe,onPaneMouseMove:rt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:ue,paneClickDistance:Oe=1,nodeClickDistance:Qe=0,children:cn,onReconnect:an,onReconnectStart:ie,onReconnectEnd:_e,onEdgeContextMenu:ye,onEdgeDoubleClick:Pe,onEdgeMouseEnter:$e,onEdgeMouseMove:qe,onEdgeMouseLeave:gt,reconnectRadius:It=10,onNodesChange:Rt,onEdgesChange:gn,noDragClassName:yn="nodrag",noWheelClassName:zt="nowheel",noPanClassName:kn="nopan",fitView:er,fitViewOptions:_r,connectOnClick:Dn,attributionPosition:Hn,proOptions:tr,defaultEdgeOptions:Tr,elevateNodesOnSelect:Vt=!0,elevateEdgesOnSelect:Sn=!1,disableKeyboardA11y:Pn=!1,autoPanOnConnect:nr,autoPanOnNodeDrag:zn,autoPanOnSelection:An=!0,autoPanSpeed:st,connectionRadius:Cn,isValidConnection:Bt,onError:Jt,style:In,id:jn,nodeDragThreshold:wn,connectionDragThreshold:rr,viewport:Ot,onViewportChange:Z,width:ke,height:Me,colorMode:He="light",debug:Lt,onScroll:yt,ariaLabelConfig:Kt,zIndexMode:kt="basic",...fr},St){const ra=jn||"1",Jl=Poe(He),ec=v.useCallback(Bd=>{Bd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),yt==null||yt(Bd)},[yt]);return c.jsx("div",{"data-testid":"rf__wrapper",...fr,onScroll:ec,style:{...In,...sce},ref:St,className:xn(["react-flow",s,Jl]),id:jn,role:"application",children:c.jsxs(rce,{nodes:e,edges:t,width:ke,height:Me,fitView:er,fitViewOptions:_r,minZoom:K,maxZoom:X,nodeOrigin:ae,nodeExtent:Re,zIndexMode:kt,children:[c.jsx(Doe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:g,nodesDraggable:Le,autoPanOnNodeFocus:ve,nodesConnectable:Ue,nodesFocusable:Ie,edgesFocusable:wt,edgesReconnectable:we,elementsSelectable:vt,elevateNodesOnSelect:Vt,elevateEdgesOnSelect:Sn,minZoom:K,maxZoom:X,nodeExtent:Re,onNodesChange:Rt,onEdgesChange:gn,snapToGrid:ce,snapGrid:Ce,connectionMode:H,translateExtent:le,connectOnClick:Dn,defaultEdgeOptions:Tr,fitView:er,fitViewOptions:_r,onNodesDelete:I,onEdgesDelete:M,onDelete:B,onNodeDragStart:A,onNodeDrag:k,onNodeDragStop:R,onSelectionDrag:U,onSelectionDragStart:P,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:kn,nodeOrigin:ae,rfId:ra,autoPanOnConnect:nr,autoPanOnNodeDrag:zn,autoPanSpeed:st,onError:Jt,connectionRadius:Cn,isValidConnection:Bt,selectNodesOnDrag:ge,nodeDragThreshold:wn,connectionDragThreshold:rr,onBeforeDelete:S,debug:Lt,ariaLabelConfig:Kt,zIndexMode:kt}),c.jsx(ece,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:N,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:a,connectionLineType:V,connectionLineStyle:D,connectionLineComponent:ne,connectionLineContainerStyle:ee,selectionKeyCode:de,selectionOnDrag:G,selectionMode:W,deleteKeyCode:re,multiSelectionKeyCode:he,panActivationKeyCode:oe,zoomActivationKeyCode:J,onlyRenderVisibleElements:Ee,defaultViewport:ct,translateExtent:le,minZoom:K,maxZoom:X,preventScrolling:Ne,zoomOnScroll:We,zoomOnPinch:ot,zoomOnDoubleClick:Et,panOnScroll:Zt,panOnScrollSpeed:Ct,panOnScrollMode:Ge,panOnDrag:Ht,autoPanOnSelection:An,onPaneClick:Nn,onPaneMouseEnter:Fe,onPaneMouseMove:rt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:ue,paneClickDistance:Oe,nodeClickDistance:Qe,onSelectionContextMenu:L,onSelectionStart:O,onSelectionEnd:j,onReconnect:an,onReconnectStart:ie,onReconnectEnd:_e,onEdgeContextMenu:ye,onEdgeDoubleClick:Pe,onEdgeMouseEnter:$e,onEdgeMouseMove:qe,onEdgeMouseLeave:gt,reconnectRadius:It,defaultMarkerColor:ut,noDragClassName:yn,noWheelClassName:zt,noPanClassName:kn,rfId:ra,disableKeyboardA11y:Pn,nodeExtent:Re,viewport:Ot,onViewportChange:Z}),c.jsx(Roe,{onSelectionChange:Y}),cn,c.jsx(koe,{proOptions:tr,position:Hn}),c.jsx(Noe,{rfId:ra,disableKeyboardA11y:Pn})]})})}var ace=$D(ice);function oce(e){const[t,n]=v.useState(e),r=v.useCallback(s=>n(i=>BD(s,i)),[]);return[t,n,r]}function lce(e){const[t,n]=v.useState(e),r=v.useCallback(s=>n(i=>FD(s,i)),[]);return[t,n,r]}function cce({dimensions:e,lineWidth:t,variant:n,className:r}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xn(["react-flow__background-pattern",n,r])})}function uce({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:xn(["react-flow__background-pattern","dots",t])})}var Ki;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ki||(Ki={}));const dce={[Ki.Dots]:1,[Ki.Lines]:1,[Ki.Cross]:6},fce=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function fP({id:e,variant:t=Ki.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:d}){const f=v.useRef(null),{transform:h,patternId:p}=ft(fce,Xt),m=r||dce[t],y=t===Ki.Dots,w=t===Ki.Cross,g=Array.isArray(n)?n:[n,n],E=[g[0]*h[2]||1,g[1]*h[2]||1],b=m*h[2],_=Array.isArray(i)?i:[i,i],N=w?[b,b]:E,T=[_[0]*h[2]||1+N[0]/2,_[1]*h[2]||1+N[1]/2],A=`${p}${e||""}`;return c.jsxs("svg",{className:xn(["react-flow__background",u]),style:{...l,...Ym,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[c.jsx("pattern",{id:A,x:h[0]%E[0],y:h[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:y?c.jsx(uce,{radius:b/2,className:d}):c.jsx(cce,{dimensions:N,lineWidth:s,variant:t,className:d})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}fP.displayName="Background";const hce=v.memo(fP);function pce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function mce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function gce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function yce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function bce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Kf({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:xn(["react-flow__controls-button",t]),...n,children:e})}const Ece=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function hP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Qt(),{isInteractive:y,minZoomReached:w,maxZoomReached:g,ariaLabelConfig:E}=ft(Ece,Xt),{zoomIn:b,zoomOut:_,fitView:N}=Zx(),T=()=>{b(),i==null||i()},A=()=>{_(),a==null||a()},k=()=>{N(s),o==null||o()},R=()=>{m.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),l==null||l(!y)},I=h==="horizontal"?"horizontal":"vertical";return c.jsxs(Km,{className:xn(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??E["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(Kf,{onClick:T,className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:g,children:c.jsx(pce,{})}),c.jsx(Kf,{onClick:A,className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:w,children:c.jsx(mce,{})})]}),n&&c.jsx(Kf,{className:"react-flow__controls-fitview",onClick:k,title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:c.jsx(gce,{})}),r&&c.jsx(Kf,{className:"react-flow__controls-interactive",onClick:R,title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:y?c.jsx(bce,{}):c.jsx(yce,{})}),d]})}hP.displayName="Controls";const xce=v.memo(hP);function wce({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:y}=i||{},w=a||m||y;return c.jsx("rect",{className:xn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:o,strokeWidth:l},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const vce=v.memo(wce),_ce=e=>e.nodes.map(t=>t.id),M0=e=>e instanceof Function?e:()=>e;function Tce({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=vce,onClick:a}){const o=ft(_ce,Xt),l=M0(t),u=M0(e),d=M0(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:o.map(h=>c.jsx(kce,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Nce({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:d,y:f,width:h,height:p}=ft(m=>{const y=m.nodeLookup.get(e);if(!y)return{node:void 0,x:0,y:0,width:0,height:0};const w=y.internals.userNode,{x:g,y:E}=y.internals.positionAbsolute,{width:b,height:_}=hi(w);return{node:w,x:g,y:E,width:b,height:_}},Xt);return!u||u.hidden||!lD(u)?null:c.jsx(o,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:s,strokeColor:n(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const kce=v.memo(Nce);var Sce=v.memo(Tce);const Ace=200,Cce=150,Ice=e=>!e.hidden,Rce=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?aD(Dd(e.nodeLookup,{filter:Ice}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Oce="react-flow__minimap-desc";function pP({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:y=!1,zoomable:w=!1,ariaLabel:g,inversePan:E,zoomStep:b=1,offsetScale:_=5}){const N=Qt(),T=v.useRef(null),{boundingRect:A,viewBB:k,rfId:R,panZoom:I,translateExtent:M,flowWidth:B,flowHeight:Y,ariaLabelConfig:P}=ft(Rce,Xt),U=(e==null?void 0:e.width)??Ace,C=(e==null?void 0:e.height)??Cce,L=A.width/U,O=A.height/C,j=Math.max(L,O),S=j*U,H=j*C,V=_*j,D=A.x-(S-A.width)/2-V,ne=A.y-(H-A.height)/2-V,ee=S+V*2,re=H+V*2,de=`${Oce}-${R}`,G=v.useRef(0),W=v.useRef();G.current=j,v.useEffect(()=>{if(T.current&&I)return W.current=Lae({domNode:T.current,panZoom:I,getTransform:()=>N.getState().transform,getViewScale:()=>G.current}),()=>{var ce;(ce=W.current)==null||ce.destroy()}},[I]),v.useEffect(()=>{var ce;(ce=W.current)==null||ce.update({translateExtent:M,width:B,height:Y,inversePan:E,pannable:y,zoomStep:b,zoomable:w})},[y,w,E,b,M,B,Y]);const oe=p?ce=>{var ge;const[Ce,Ee]=((ge=W.current)==null?void 0:ge.pointer(ce))||[0,0];p(ce,{x:Ce,y:Ee})}:void 0,he=m?v.useCallback((ce,Ce)=>{const Ee=N.getState().nodeLookup.get(Ce).internals.userNode;m(ce,Ee)},[]):void 0,J=g??P["minimap.ariaLabel"];return c.jsx(Km,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*j:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:xn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:U,height:C,viewBox:`${D} ${ne} ${ee} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:T,onClick:oe,children:[J&&c.jsx("title",{id:de,children:J}),c.jsx(Sce,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${D-V},${ne-V}h${ee+V*2}v${re+V*2}h${-ee-V*2}z - M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}pP.displayName="MiniMap";const Lce=v.memo(pP),Mce=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Dce={[Il.Line]:"right",[Il.Handle]:"bottom-right"};function Pce({nodeId:e,position:t,variant:n=Il.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:y,onResize:w,onResizeEnd:g}){const E=KD(),b=typeof e=="string"?e:E,_=Qt(),N=v.useRef(null),T=n===Il.Handle,A=ft(v.useCallback(Mce(T&&p),[T,p]),Xt),k=v.useRef(null),R=t??Dce[n];v.useEffect(()=>{if(!(!N.current||!b))return k.current||(k.current=Yae({domNode:N.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:M,transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U,domNode:C}=_.getState();return{nodeLookup:M,transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U,paneDomNode:C}},onChange:(M,B)=>{const{triggerNodeChanges:Y,nodeLookup:P,parentLookup:U,nodeOrigin:C}=_.getState(),L=[],O={x:M.x,y:M.y},j=P.get(b);if(j&&j.expandParent&&j.parentId){const S=j.origin??C,H=M.width??j.measured.width??0,V=M.height??j.measured.height??0,D={id:j.id,parentId:j.parentId,rect:{width:H,height:V,...cD({x:M.x??j.position.x,y:M.y??j.position.y},{width:H,height:V},j.parentId,P,S)}},ne=Qx([D],P,U,C);L.push(...ne),O.x=M.x?Math.max(S[0]*H,M.x):void 0,O.y=M.y?Math.max(S[1]*V,M.y):void 0}if(O.x!==void 0&&O.y!==void 0){const S={id:b,type:"position",position:{...O}};L.push(S)}if(M.width!==void 0&&M.height!==void 0){const H={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};L.push(H)}for(const S of B){const H={...S,type:"position"};L.push(H)}Y(L)},onEnd:({width:M,height:B})=>{const Y={id:b,type:"dimensions",resizing:!1,dimensions:{width:M,height:B}};_.getState().triggerNodeChanges([Y])}})),k.current.update({controlPosition:R,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:y,onResize:w,onResizeEnd:g,shouldResize:m}),()=>{var M;(M=k.current)==null||M.destroy()}},[R,o,l,u,d,f,y,w,g,m]);const I=R.split("-");return c.jsx("div",{className:xn(["react-flow__resize-control","nodrag",...I,n,r]),ref:N,style:{...s,scale:A,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:i})}v.memo(Pce);const jce=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:NF},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:sF},{type:"loop",label:"循环",desc:"节点循环执行",Icon:AE}];let G1=0;function D0(){return G1+=1,`node_${G1}`}function P0(e,t,n){const r=Xi();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function Bce({data:e,selected:t}){const n=e.agent;return c.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[c.jsx(Ol,{type:"target",position:De.Left,className:"wfb-handle"}),c.jsx("div",{className:"wfb-node-icon",children:c.jsx(Ha,{className:"icon"})}),c.jsxs("div",{className:"wfb-node-body",children:[c.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),c.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),c.jsx(Ol,{type:"source",position:De.Right,className:"wfb-handle"})]})}const Fce={agentNode:Bce},gS={type:"smoothstep",markerEnd:{type:Qu.ArrowClosed,width:16,height:16}};function Uce({onBack:e,onCreate:t}){const n=v.useRef(null),[r,s]=v.useState(""),[i,a]=v.useState(""),[o,l]=v.useState("sequential"),u=v.useMemo(()=>{G1=0;const C=D0();return P0(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=oce([u]),[p,m,y]=lce([]),[w,g]=v.useState(u.id),E=d.find(C=>C.id===w)??null,b=r.trim()||"workflow_agent",_=v.useMemo(()=>d3({name:b,subAgents:d.map(C=>C.data.agent)}),[b,d]),N=nl(b)??(_.has(b)?"名称须与 Agent 节点名称保持唯一":null),T=E?nl(E.data.agent.name)??(_.has(E.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,A=d.length>0&&N===null&&d.every(C=>nl(C.data.agent.name)===null&&!_.has(C.data.agent.name)),k=v.useCallback(C=>m(L=>UD({...C,...gS},L)),[m]),R=v.useCallback(()=>{const C=D0(),L=d.length*28,O=P0(C,{x:80+L,y:120+L});f(j=>j.concat(O)),g(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},M=v.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),B=v.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const O=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),j=D0(),S=P0(j,O);f(H=>H.concat(S)),g(j)},[f]),Y=v.useCallback(C=>{w&&f(L=>L.map(O=>O.id===w?{...O,data:{...O.data,agent:{...O.data.agent,...C}}}:O))},[w,f]),P=v.useCallback(()=>{w&&(f(C=>C.filter(L=>L.id!==w)),m(C=>C.filter(L=>L.source!==w&&L.target!==w)),g(null))},[w,f,m]),U=v.useCallback(()=>{if(!A)return;const C=d.map(O=>O.data.agent),L={...Xi(),name:b,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:o,nodes:d.map(O=>({id:O.id,agent:O.data.agent})),edges:p.map(O=>({from:O.source,to:O.target}))}};t(L)},[A,d,p,b,i,o,t]);return c.jsx("div",{className:"wfb",children:c.jsxs("div",{className:"wfb-grid",children:[c.jsxs("aside",{className:"wfb-palette",children:[c.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"名称"}),c.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),N&&c.jsx("span",{className:"wfb-field-error",children:N})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"描述"}),c.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),c.jsx("div",{className:"wfb-section-label",children:"执行方式"}),c.jsx("div",{className:"wfb-types",children:jce.map(({type:C,label:L,desc:O,Icon:j})=>c.jsxs("button",{type:"button",className:`wfb-type ${o===C?"wfb-type--active":""}`,onClick:()=>l(C),children:[c.jsx(j,{className:"icon"}),c.jsxs("span",{className:"wfb-type-text",children:[c.jsx("span",{className:"wfb-type-name",children:L}),c.jsx("span",{className:"wfb-type-desc",children:O})]})]},C))}),c.jsx("div",{className:"wfb-section-label",children:"节点"}),c.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[c.jsx(xF,{className:"icon wfb-grip"}),c.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:c.jsx(Ha,{className:"icon"})}),c.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),c.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[c.jsx(ms,{className:"icon"}),"添加节点"]}),c.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),c.jsxs("div",{className:"wfb-canvas",children:[c.jsxs("button",{className:"wfb-create",onClick:U,disabled:!A,type:"button",children:[c.jsx(za,{className:"icon"}),"创建工作流"]}),c.jsxs(ace,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:y,onConnect:k,onInit:C=>n.current=C,nodeTypes:Fce,defaultEdgeOptions:gS,onDrop:B,onDragOver:M,onNodeClick:(C,L)=>g(L.id),onPaneClick:()=>g(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[c.jsx(hce,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),c.jsx(xce,{showInteractive:!1}),c.jsx(Lce,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),c.jsx("aside",{className:"wfb-inspector",children:E?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"wfb-inspector-head",children:[c.jsx("div",{className:"wfb-section-label",children:"节点配置"}),c.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:P,title:"删除节点",children:c.jsx(Fl,{className:"icon"})})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"名称"}),c.jsx("input",{className:`wfb-input ${T?"wfb-input--error":""}`,value:E.data.agent.name,onChange:C=>Y({name:C.target.value}),placeholder:"agent_name"}),T?c.jsx("span",{className:"wfb-field-error",children:T}):c.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"描述"}),c.jsx("input",{className:"wfb-input",value:E.data.agent.description,onChange:C=>Y({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),c.jsx("textarea",{className:"wfb-input wfb-textarea",value:E.data.agent.instruction,onChange:C=>Y({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),c.jsx("input",{className:"wfb-input",value:E.data.agent.tools.join(", "),onChange:C=>Y({tools:C.target.value.split(",").map(L=>L.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),c.jsxs("div",{className:"wfb-inspector-meta",children:[c.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),c.jsx("code",{className:"wfb-meta-val",children:E.id})]})]}):c.jsxs("div",{className:"wfb-inspector-empty",children:[c.jsx(Ha,{className:"wfb-empty-icon"}),c.jsx("p",{children:"选择一个节点以编辑其配置"}),c.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function $ce(e){return c.jsx(dP,{children:c.jsx(Uce,{...e})})}const Hce="/web/skill-creator";class ew extends Error{constructor(n,r){super(n);cw(this,"status");this.name="SkillCreatorApiError",this.status=r}}function ao(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function Wt(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function mP(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function jd(e,t){return fetch(Ms(`${Hce}${e}`),{...t,headers:fm({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function tw(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=ao(await e.json(),"错误响应");return Wt(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function nw(e,t){if(!e.ok)throw new ew(await tw(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function zce(e){if(e==="queued")return"queued";if(e==="running")return"running";if(e==="succeeded")return"succeeded";if(e==="failed")return"failed";throw new Error(`未知的 Skill 生成状态:${String(e)}`)}function Vce(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Kce(e){return Array.isArray(e)?e.map((t,n)=>{const r=ao(t,`文件 ${n+1}`),s=Wt(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=mP(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function Yce(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=Array.isArray(t.errors)?t.errors.map(String):[],r=Array.isArray(t.warnings)?t.warnings.map(String):[];return{valid:typeof t.valid=="boolean"?t.valid:n.length===0,errors:n,warnings:r}}function Wce(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=ao(t,`活动 ${n+1}`),s=Wt(r,"id"),i=Wt(r,"kind"),a=Wt(r,"status");if(!s||!i||!["status","thinking","tool","message"].includes(i))throw new Error(`活动 ${n+1} 格式错误`);if(a!=="running"&&a!=="done")throw new Error(`活动 ${n+1} 状态错误`);if(i==="tool"){const l=Wt(r,"name");if(!l)throw new Error(`活动 ${n+1} 缺少工具名称`);return{id:s,kind:i,name:l,args:r.input,response:r.output,status:a}}const o=Wt(r,"text");if(!o)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:o,status:a}})}function qce(e,t){const n=ao(e,`候选方案 ${t+1}`),r=Wt(n,"id","candidate_id","candidateId"),s=Wt(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:Wt(n,"modelLabel","model_label")??s,status:zce(n.status),stage:Vce(n.stage),name:Wt(n,"name","skill_name","skillName"),description:Wt(n,"description"),skillMd:Wt(n,"skillMd","skill_md"),files:Kce(n.files),activities:Wce(n.activities),validation:Yce(n.validation),durationMs:mP(n,"elapsedMs","elapsed_ms"),error:Wt(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:Wt(n,"skill_id","skillId"),version:Wt(n,"version")}}function X1(e,t=""){const n=ao(e,"Skill 创建任务"),r=Wt(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(qce):[],i=Wt(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:Wt(n,"prompt")??t,status:i,candidates:s}}async function Gce(e,t){const n=await jd("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new ew(await tw(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=X1(await n.json(),e);return t==null||t(u),u}if(!r.includes("application/x-ndjson")||!n.body)throw new Error("创建 Skill 任务失败:服务端返回了非流式响应");const s=n.body.getReader(),i=new TextDecoder;let a="",o;const l=u=>{if(!u.trim())return;const d=ao(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(Wt(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");o=X1(d.job,e),t==null||t(o)};for(;;){const{done:u,value:d}=await s.read();a+=i.decode(d,{stream:!u});const f=a.split(` -`);if(a=f.pop()??"",f.forEach(l),u)break}if(l(a),!o)throw new Error("创建 Skill 任务失败:服务端未返回任务");return o}async function Xce(e){const t=await jd(`/jobs/${encodeURIComponent(e)}`);return X1(await nw(t,"读取 Skill 任务失败"))}async function Qce(e){const t=await jd(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await nw(t,"清理 Skill 任务失败")}async function Zce(e,t){var o;const n=await jd(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await tw(n,"下载 Skill 失败"));const s=((o=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:o[1])??"skill.zip",i=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=i,a.download=s,a.click(),URL.revokeObjectURL(i)}async function Jce(e,t,n){const r=await jd(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=ao(await nw(r,"添加到 AgentKit 失败"),"发布结果"),i=Wt(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:Wt(s,"name"),version:Wt(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:Wt(s,"message")}}const eue=()=>{};function tue(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error("不支持的 Skill 对话活动")}function nue({activities:e}){const t=v.useMemo(()=>e.filter(n=>n.kind!=="status").map(tue),[e]);return t.length===0?null:c.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:c.jsx(mx,{blocks:t,onAction:eue})})}const yS={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},bS=12e4;function rue({status:e}){return e==="succeeded"?c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):c.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function sue(){return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),c.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function iue(){return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function aue({candidate:e}){var l,u;const[t,n]=v.useState("SKILL.md"),r=e.files.find(d=>d.path.endsWith("SKILL.md")),s=e.skillMd&&!r?[{path:"SKILL.md",size:new Blob([e.skillMd]).size},...e.files]:e.files,i=s.find(d=>d.path===t)??s[0],a=(l=e.skillMd)==null?void 0:l.slice(0,bS),o=(((u=e.skillMd)==null?void 0:u.length)??0)>bS;return s.length===0?null:c.jsxs("div",{className:"skill-files",children:[c.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>c.jsx("button",{type:"button",role:"tab","aria-selected":(i==null?void 0:i.path)===d.path,className:(i==null?void 0:i.path)===d.path?"is-active":"",onClick:()=>n(d.path),children:d.path},d.path))}),e.skillMd&&(i!=null&&i.path.endsWith("SKILL.md"))?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"skill-files__content",children:c.jsx("code",{children:a})}),o?c.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):c.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function oue({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:o,onPublish:l}){const[u,d]=v.useState("conversation"),[f,h]=v.useState(!1),[p,m]=v.useState(!1),[y,w]=v.useState(""),[g,E]=v.useState(""),[b,_]=v.useState(""),[N,T]=v.useState(""),A=v.useRef(null),k=v.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",M=n.validation;return c.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[c.jsxs("header",{className:"skill-candidate__header",children:[c.jsx("h2",{children:n.model}),r?c.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?c.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[c.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[c.jsx("span",{className:"skill-candidate__status-icon",children:c.jsx(rue,{status:n.status})}),R?c.jsx(Yl,{duration:2.2,spread:16,children:yS[n.stage]}):c.jsx("span",{children:yS[n.stage]}),n.durationMs!==void 0&&I?c.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),c.jsx(nue,{activities:n.activities}),n.error?c.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?c.jsx("div",{className:"skill-candidate__view-actions",children:c.jsxs("button",{ref:A,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var B;return(B=k.current)==null?void 0:B.focus()})},children:[c.jsx(sue,{}),"查看 Skill"]})}):null]}):c.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[c.jsx("div",{className:"skill-candidate__preview-nav",children:c.jsxs("button",{ref:k,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var B;return(B=A.current)==null?void 0:B.focus()})},children:[c.jsx(iue,{}),"返回对话"]})}),c.jsxs("div",{className:"skill-candidate__result",children:[c.jsxs("div",{className:"skill-candidate__summary",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Skill"}),c.jsx("strong",{children:n.name??"未命名 Skill"})]}),c.jsxs("div",{children:[c.jsx("span",{children:"文件"}),c.jsx("strong",{children:n.files.length})]}),c.jsxs("div",{children:[c.jsx("span",{children:"校验"}),c.jsx("strong",{className:(M==null?void 0:M.valid)===!1?"is-invalid":"is-valid",children:(M==null?void 0:M.valid)===!1?"未通过":"已通过"})]})]}),n.description?c.jsx("p",{className:"skill-candidate__description",children:n.description}):null,M&&(M.errors.length>0||M.warnings.length>0)?c.jsxs("details",{className:"skill-validation",children:[c.jsx("summary",{children:"查看校验详情"}),[...M.errors,...M.warnings].map((B,Y)=>c.jsx("div",{children:B},`${B}-${Y}`))]}):null,c.jsx(aue,{candidate:n}),c.jsxs("div",{className:"skill-candidate__actions",children:[c.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:o,children:r?"已采用此方案":"采用此方案"}),c.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Zce(t,n.id).catch(B=>{w(B instanceof Error?B.message:String(B))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),c.jsx("button",{type:"button",className:"skill-action",disabled:!r||s||i||n.published,title:r?void 0:"请先采用此方案",onClick:()=>h(B=>!B),children:n.published?"已添加到 AgentKit":s?"正在添加…":"添加到 AgentKit"})]}),y?c.jsx("div",{className:"skill-candidate__error",children:y}):null,f&&r&&!n.published?c.jsxs("form",{className:"skill-publish-form",onSubmit:B=>{B.preventDefault();const Y=g.split(",").map(P=>P.trim()).filter(Boolean);l({skillSpaceIds:Y,...b.trim()?{projectName:b.trim()}:{},...N.trim()?{skillId:N.trim()}:{}})},children:[c.jsxs("label",{children:[c.jsx("span",{children:"SkillSpace ID(可选)"}),c.jsx("input",{value:g,onChange:B=>E(B.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),c.jsxs("div",{className:"skill-publish-form__optional",children:[c.jsxs("label",{children:[c.jsx("span",{children:"项目名称(可选)"}),c.jsx("input",{value:b,onChange:B=>_(B.target.value)})]}),c.jsxs("label",{children:[c.jsx("span",{children:"已有 Skill ID(可选)"}),c.jsx("input",{value:N,onChange:B=>T(B.target.value)})]})]}),c.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?c.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const ES=new Set(["completed"]),Yf=1100,lue=3e4;function cue(e,t){return{id:`pending-${t}`,model:e,modelLabel:e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}}function uue({initialJob:e}){const[t,n]=v.useState(e),[r,s]=v.useState(""),[i,a]=v.useState(!1),[o,l]=v.useState(),[u,d]=v.useState(),[f,h]=v.useState(()=>new Set),[p,m]=v.useState({});v.useEffect(()=>{n(e),s(""),a(!1)},[e]),v.useEffect(()=>{if(ES.has(e.status)||e.id.startsWith("pending-"))return;let g=!1,E;const b=Date.now()+lue,_=async()=>{try{const N=await Xce(e.id);g||(n({...N,prompt:N.prompt||e.prompt}),s(""),ES.has(N.status)||(E=window.setTimeout(_,Yf)))}catch(N){if(!g){const T=N instanceof ew?N:void 0;if((T==null?void 0:T.status)===404&&Date.now(){g=!0,E!==void 0&&window.clearTimeout(E)}},[e.id,e.status]);const y=gx.map((g,E)=>t.candidates.find(b=>b.model===g)??t.candidates[E]??cue(g,E));async function w(g,E){d(g.id),m(b=>({...b,[g.id]:""}));try{await Jce(t.id,g.id,E),h(b=>new Set(b).add(g.id))}catch(b){m(_=>({..._,[g.id]:b instanceof Error?b.message:String(b)}))}finally{d(void 0)}}return c.jsxs("section",{className:"skill-workspace",children:[c.jsx("header",{className:"skill-workspace__intro",children:c.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?c.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,c.jsx("div",{className:"skill-workspace__grid",children:y.map((g,E)=>{const _=f.has(g.id)||g.published?{...g,published:!0}:g;return c.jsx(oue,{label:`方案 ${E===0?"A":"B"}`,jobId:t.id,candidate:_,selected:o===g.id,publishing:u===g.id,publishDisabled:u!==void 0&&u!==g.id,publishError:p[g.id],onSelect:()=>l(g.id),onPublish:N=>void w(g,N)},`${g.model}-${g.id}`)})})]})}const j0="/web/sandbox/sessions",due=33e4,fue=6e5,hue=15e3;function B0(e){const t=fm(e);return t.set("Accept","application/json"),t}async function F0(e,t){let n={};try{n=await e.json()}catch{return new Error(`${t}(HTTP ${e.status})`)}const r=n.detail,s=r&&typeof r=="object"&&"message"in r?r.message:r??n.message;return new Error(typeof s=="string"&&s?s:t)}async function pue(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],o=new Map;function l(){t==null||t(a.map(h=>({...h})))}function u(h){i+=h;const p=a[a.length-1];(p==null?void 0:p.kind)==="text"?p.text+=h:a.push({kind:"text",text:h}),l()}function d(h){if(typeof h.id!="string"||h.kind!=="thinking"&&h.kind!=="tool"||h.status!=="running"&&h.status!=="done")return;const p=h.status==="done";let m;if(h.kind==="thinking"){if(typeof h.text!="string"||!h.text)return;m={kind:"thinking",text:h.text,done:p}}else{if(typeof h.name!="string"||!h.name)return;m={kind:"tool",name:h.name,args:h.args,response:h.response,done:p}}const y=o.get(h.id);y===void 0?(o.set(h.id,a.length),a.push(m)):a[y]=m,l()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let y;try{y=JSON.parse(m.join(` -`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof y.message=="string"&&y.message?y.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(y),p==="delta"&&typeof y.text=="string"&&u(y.text),p==="done"&&!i&&typeof y.text=="string"&&u(y.text)}for(;;){const{done:h,value:p}=await n.read();s+=r.decode(p,{stream:!h});const m=s.split(/\r?\n\r?\n/);if(s=m.pop()??"",m.forEach(f),h)break}if(s.trim()&&f(s),a.length===0)throw new Error("沙箱未返回有效回复,请重试。");return{text:i,blocks:a}}const U0={async startSession(e={}){const t=await fetch(Ms(j0),{method:"POST",headers:B0({"Content-Type":"application/json"}),signal:Ds(e.signal,due)});if(!t.ok)throw await F0(t,"无法启动 AgentKit 沙箱,请稍后重试。");const n=await t.json();if(!n.sessionId||n.status!=="ready")throw new Error("AgentKit 沙箱返回了无效的会话信息。");return{id:n.sessionId,toolName:"codex",createdAt:new Date().toISOString()}},async sendMessage(e,t={}){if(!e.sessionId||!e.text.trim())throw new Error("临时会话缺少有效的消息内容。");const n=await fetch(Ms(`${j0}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:B0({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:Ds(t.signal,fue)});if(!n.ok)throw await F0(n,"沙箱对话失败,请稍后重试。");return pue(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Ms(`${j0}/${encodeURIComponent(e)}`),{method:"DELETE",headers:B0(),signal:Ds(t.signal,hue)});if(!n.ok&&n.status!==404)throw await F0(n,"无法清理 AgentKit 沙箱会话。")}},mue=1e4;async function gP(e){const t=await fetch(Ms(e),{headers:fm({Accept:"application/json"}),signal:Ds(void 0,mue)});if(!t.ok)throw new Error(`读取会话模式能力失败(HTTP ${t.status})`);const n=await t.json();if(typeof n.enabled!="boolean")throw new Error("会话模式能力响应格式错误");return{enabled:n.enabled,reason:typeof n.reason=="string"?n.reason:void 0}}async function gue(){return gP("/web/sandbox/capabilities")}async function yue(){return gP("/web/skill-creator/capabilities")}function bue(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M12 3.5c.35 3.05 1.62 5.32 4.9 6.1-3.28.78-4.55 3.05-4.9 6.1-.35-3.05-1.62-5.32-4.9-6.1 3.28-.78 4.55-3.05 4.9-6.1Z"}),c.jsx("path",{d:"M18.5 14.5c.18 1.55.84 2.7 2.5 3.1-1.66.4-2.32 1.55-2.5 3.1-.18-1.55-.84-2.7-2.5-3.1 1.66-.4 2.32-1.55 2.5-3.1Z"}),c.jsx("path",{d:"M5.3 14.2c.14 1.15.62 2 1.85 2.3-1.23.3-1.71 1.15-1.85 2.3-.14-1.15-.62-2-1.85-2.3 1.23-.3 1.71-1.15 1.85-2.3Z"})]})}function Eue({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=v.useRef(null),a=v.useRef(null);if(v.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],y=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),y.focus()):!h.shiftKey&&document.activeElement===y&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const o=t==="loading",l=o?"正在初始化沙箱":t==="error"?"启动失败":"启用临时会话";return $a.createPortal(c.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!o&&r()},children:c.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[c.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[c.jsx("span",{className:"sandbox-dialog-orbit"}),c.jsx("span",{className:"sandbox-dialog-icon",children:o?c.jsx("span",{className:"sandbox-spinner"}):c.jsx(bue,{})})]}),c.jsxs("div",{className:"sandbox-dialog-copy",children:[c.jsx("h2",{id:"sandbox-dialog-title",children:l}),t==="error"?c.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):o?c.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建临时 Session,通常需要一点时间。"}):c.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex Agent 开启临时会话,您的会话将不会被持久化保存。"})]}),c.jsxs("footer",{className:"sandbox-dialog-actions",children:[c.jsx("button",{ref:a,type:"button",onClick:r,children:o?"取消启动":"取消"}),!o&&c.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function xue({onExit:e}){return c.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[c.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),c.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为临时会话,退出后对话内容消失"}),c.jsx("button",{type:"button",onClick:e,children:"退出临时会话"})]})}const xS=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function $0(e){let t=0;for(let n=0;n>>0;return xS[t%xS.length]}function wue(e){const t=new Map;e.forEach(u=>t.set(u.span_id,u));const n=new Map,r=[];for(const u of e)u.parent_span_id!=null&&t.has(u.parent_span_id)?(n.get(u.parent_span_id)??n.set(u.parent_span_id,[]).get(u.parent_span_id)).push(u):r.push(u);const s=(u,d)=>u.start_time-d.start_time,i=(u,d)=>({span:u,depth:d,children:(n.get(u.span_id)??[]).sort(s).map(f=>i(f,d+1))}),a=r.sort(s).map(u=>i(u,0)),o=e.length?Math.min(...e.map(u=>u.start_time)):0,l=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:o,total:l-o||1}}function vue(e,t){const n=[],r=s=>{n.push(s),t.has(s.span.span_id)||s.children.forEach(r)};return e.forEach(r),n}function wS(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const _ue=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function vS(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:_ue(t),value:r,long:r.length>80||r.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function Tue({appName:e,sessionId:t,onClose:n}){const[r,s]=v.useState(null),[i,a]=v.useState(""),[o,l]=v.useState(new Set),[u,d]=v.useState(null);v.useEffect(()=>{s(null),a(""),KI(e,t).then(E=>{s(E),d(E.length?E.reduce((b,_)=>b.start_time<=_.start_time?b:_).span_id:null)}).catch(E=>a(String(E)))},[e,t]);const{rootNodes:f,min:h,total:p}=v.useMemo(()=>wue(r??[]),[r]),m=v.useMemo(()=>vue(f,o),[f,o]),y=(r==null?void 0:r.find(E=>E.span_id===u))??null,w=p/1e6,g=E=>l(b=>{const _=new Set(b);return _.has(E)?_.delete(E):_.add(E),_});return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"drawer-scrim",onClick:n}),c.jsxs("aside",{className:"drawer drawer--trace",children:[c.jsxs("header",{className:"drawer-head",children:[c.jsxs("div",{children:[c.jsx("div",{className:"drawer-title",children:"调用链路观测"}),c.jsx("div",{className:"drawer-sub",children:r?`${r.length} 个调用 · ${w.toFixed(1)} ms`:"加载中"})]}),c.jsx("button",{className:"drawer-close",onClick:n,"aria-label":"关闭",children:c.jsx(Xr,{className:"icon"})})]}),r==null&&!i&&c.jsxs("div",{className:"drawer-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载调用链路…"]}),i&&c.jsx("div",{className:"error",children:i}),r&&r.length===0&&c.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),m.length>0&&c.jsxs("div",{className:"trace-split",children:[c.jsx("div",{className:"trace-tree scroll",children:m.map(E=>{const b=E.span,_=(b.start_time-h)/p*100,N=Math.max((b.end_time-b.start_time)/p*100,.6),T=E.children.length>0;return c.jsxs("button",{className:`trace-row ${u===b.span_id?"active":""}`,onClick:()=>d(b.span_id),children:[c.jsxs("span",{className:"trace-label",style:{paddingLeft:E.depth*14},children:[c.jsx("span",{className:`trace-caret ${T?"":"hidden"} ${o.has(b.span_id)?"":"open"}`,onClick:A=>{A.stopPropagation(),T&&g(b.span_id)},children:c.jsx(Xn,{className:"chev"})}),c.jsx("span",{className:"trace-dot",style:{background:$0(b.name)}}),c.jsx("span",{className:"trace-name",title:b.name,children:b.name})]}),c.jsx("span",{className:"trace-dur",children:wS(b.end_time-b.start_time)}),c.jsx("span",{className:"trace-track",children:c.jsx("span",{className:"trace-bar",style:{left:`${_}%`,width:`${N}%`,background:$0(b.name)}})})]},b.span_id)})}),c.jsx("div",{className:"trace-detail scroll",children:y?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"td-title",children:y.name}),c.jsxs("div",{className:"td-dur",children:[c.jsx("span",{className:"td-dot",style:{background:$0(y.name)}}),wS(y.end_time-y.start_time)]}),c.jsx("div",{className:"td-section",children:"属性"}),c.jsx("div",{className:"td-props",children:vS(y).filter(E=>!E.long).map(E=>c.jsxs("div",{className:"td-prop",children:[c.jsx("span",{className:"td-key",children:E.key}),c.jsx("span",{className:"td-val",children:E.value})]},E.key))}),vS(y).filter(E=>E.long).map(E=>c.jsxs("div",{className:"td-block",children:[c.jsx("div",{className:"td-section",children:E.key}),c.jsx("pre",{className:"td-pre",children:E.value})]},E.key))]}):c.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}function Nue(e){return e.toLowerCase()==="github"?c.jsx(EF,{className:"icon"}):c.jsx(SF,{className:"icon"})}function kue({branding:e,onUsername:t}){const[n,r]=v.useState(null),[s,i]=v.useState(""),[a,o]=v.useState(0),[l,u]=v.useState("");v.useEffect(()=>{let h=!0;return r(null),i(""),GF().then(p=>{h&&r(p)}).catch(p=>{h&&i(p instanceof Error?p.message:String(p))}),()=>{h=!1}},[a]);const d=WF.test(l),f=()=>{d&&t(l)};return c.jsxs("div",{className:"login",children:[c.jsx("header",{className:"login-top",children:c.jsxs("span",{className:"login-brand",children:[c.jsx("img",{className:"login-brand-logo",src:e.logoUrl||ux,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),c.jsx("main",{className:"login-main",children:c.jsxs("div",{className:"login-card",children:[c.jsx(Yl,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?c.jsxs("div",{className:"login-provider-error",role:"alert",children:[c.jsx("p",{children:s}),c.jsx("button",{type:"button",onClick:()=>o(h=>h+1),children:"重试"})]}):n===null?null:n.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"login-sub",children:"登录以继续使用"}),c.jsx("div",{className:"login-providers",children:n.map(h=>c.jsxs("button",{className:"login-btn",onClick:()=>XF(h.loginUrl),children:[Nue(h.id),c.jsxs("span",{children:["使用 ",h.label," 登录"]})]},h.id))})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),c.jsxs("form",{className:"login-name",onSubmit:h=>{h.preventDefault(),f()},children:[c.jsx("input",{className:"login-name-input",value:l,onChange:h=>u(h.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16,autoFocus:!0}),c.jsx("button",{type:"submit",className:"login-name-go",disabled:!d,"aria-label":"进入",children:c.jsx(xI,{className:"icon"})})]}),c.jsx("p",{className:"login-hint","aria-live":"polite",children:l&&!d?"只能包含大小写字母和数字,最多 16 位。":""})]}),c.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),c.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",c.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),c.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function Sue({node:e,ctx:t}){const n=e.variant??"default";return c.jsx("button",{type:"button",className:`a2ui-button a2ui-button--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,onClick:()=>t.dispatchAction(e.action,e),children:t.render(e.child)})}io("Button",Sue);function Aue({node:e,ctx:t}){return c.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}io("Card",Aue);const Cue={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},Iue={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function yP(e){return Cue[e]??"flex-start"}function bP(e){return Iue[e]??"stretch"}function Rue({node:e,ctx:t}){const n=e.children??[];return c.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:yP(e.justify),alignItems:bP(e.align)},children:n.map(r=>t.render(r))})}io("Column",Rue);function Oue({node:e}){const t=e.axis==="vertical";return c.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}io("Divider",Oue);const Lue={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function Mue({node:e}){const t=e.name??"";return c.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:Lue[t]??"•"})}io("Icon",Mue);function Due({node:e,ctx:t}){const n=e.children??[];return c.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:yP(e.justify),alignItems:bP(e.align??"center")},children:n.map(r=>t.render(r))})}io("Row",Due);const Pue=new Set(["h1","h2","h3","h4","h5"]);function jue({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=Pue.has(n)?n:"p";return c.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}io("Text",jue);const Bue="创建 Agent",Fue={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流"},vo={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},Uue=new Set,$ue=[];function Vs(){return{skills:[]}}function Hue(e,t){var r;const n=oR(e==null?void 0:e.events);if(n!=="新会话")return n;for(const s of t){if(s.role!=="user")continue;const i=(r=s.blocks.find(a=>a.kind==="text"))==null?void 0:r.text.trim();if(i)return i}return"新会话"}function EP(e,t){if(e.name===t)return e;for(const n of e.children){const r=EP(n,t);if(r)return r}}function xP(e){const t=[];for(const n of e.children)n.mentionable&&(t.push({name:n.name,description:n.description,type:n.type,path:n.path}),t.push(...xP(n)));return t}function _S(){const e=typeof localStorage<"u"?localStorage.getItem(vo.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function zue({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),c.jsx("path",{d:"M12 8.2l1.05 2.75 2.75 1.05-2.75 1.05L12 15.8l-1.05-2.75L8.2 12l2.75-1.05z",fill:"currentColor",stroke:"none"})]})}function Vue(){return c.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[c.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),c.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),c.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function wP(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Kue(e){if(!e)return"";const t=[];return e.ts&&t.push(wP(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function Yue(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const Wue="send_a2ui_json_to_client";function que(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"?t.files.length>0:t.kind==="tool"?!(t.name===Wue&&t.done):t.kind==="a2ui"?rM(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function Gue(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function Xue(e){return new Promise((t,n)=>{let r="";try{r=new URL(e,window.location.href).protocol}catch{}if(r!=="http:"&&r!=="https:"){n(new Error("授权链接不是 http/https 地址,已阻止打开。"));return}const s=window.open(e,"veadk_oauth","width=520,height=720");if(!s){n(new Error("弹窗被拦截,请允许弹窗后重试。"));return}let i=!1;const a=()=>{clearInterval(u),window.removeEventListener("message",l)},o=d=>{if(!i){i=!0,a();try{s.close()}catch{}t(d)}},l=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&o(f.url)};window.addEventListener("message",l);const u=setInterval(()=>{if(!i){if(s.closed){a();const d=window.prompt("授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:");d&&d.trim()?(i=!0,t(d.trim())):n(new Error("授权已取消。"));return}try{const d=s.location.href;d&&d!=="about:blank"&&new URL(d).origin===window.location.origin&&/[?&](code|state|error)=/.test(d)&&o(d)}catch{}}},500)})}function Que(e,t){const n=JSON.parse(JSON.stringify(e??{})),r=n.exchangedAuthCredential??n.exchanged_auth_credential??{},s=r.oauth2??{};return s.authResponseUri=t,s.auth_response_uri=t,r.oauth2=s,n.exchangedAuthCredential=r,n}function TS({text:e}){const[t,n]=v.useState(!1);return c.jsx("button",{className:"icon-btn",title:t?"已复制":"复制",disabled:!e,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?c.jsx(Bs,{className:"icon"}):c.jsx(TE,{className:"icon"})})}function Zue(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function Jue({tasks:e,onCancel:t}){const[n,r]=v.useState(!1),[s,i]=v.useState(null),a=e.filter(f=>f.status==="running").length,o=e[0],l=a>0?"running":(o==null?void 0:o.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(o==null?void 0:o.status)==="success"?"最近部署已完成":(o==null?void 0:o.status)==="error"?"最近部署失败":(o==null?void 0:o.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return c.jsxs("div",{className:"global-deploy-center",children:[c.jsxs("button",{type:"button",className:`global-deploy-task is-${l}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[l==="running"?c.jsx(bt,{className:"global-deploy-task-icon spin"}):l==="success"?c.jsx(cF,{className:"global-deploy-task-icon"}):l==="error"?c.jsx(TI,{className:"global-deploy-task-icon"}):l==="cancelled"?c.jsx(uF,{className:"global-deploy-task-icon"}):c.jsx(kF,{className:"global-deploy-task-icon"}),c.jsx("span",{className:"global-deploy-task-detail",children:u}),c.jsx(op,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),c.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[c.jsxs("header",{className:"global-deploy-popover-head",children:[c.jsx("span",{children:"部署任务"}),c.jsx("span",{children:e.length})]}),c.jsx("div",{className:"global-deploy-list",children:e.length===0?c.jsx("div",{className:"global-deploy-empty",children:"暂无部署任务"}):e.map(f=>{const h=`${f.label}${f.status==="running"&&typeof f.pct=="number"?` ${Math.round(f.pct)}%`:""}`;return c.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[c.jsxs("div",{className:"global-deploy-item-head",children:[c.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),c.jsx("span",{className:"global-deploy-status",children:h})]}),c.jsxs("dl",{className:"global-deploy-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Runtime 名称"}),c.jsx("dd",{children:f.runtimeName})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"部署地域"}),c.jsx("dd",{children:Zue(f.region)})]}),f.runtimeId&&c.jsxs("div",{children:[c.jsx("dt",{children:"Runtime ID"}),c.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?c.jsx(Ip,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?c.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:c.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),c.jsx("div",{className:"global-deploy-item-actions",children:c.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const NS=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],kS=()=>NS[Math.floor(Math.random()*NS.length)];function H0(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function ede(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function tde(e){var n;if(e.type)return e.type;const t=(n=e.name.split(".").pop())==null?void 0:n.toLowerCase();return t==="md"||t==="markdown"?"text/markdown":t==="txt"?"text/plain":"application/octet-stream"}function nde(){const[e,t]=v.useState([]),[n,r]=v.useState(""),[s,i]=v.useState([]),[a,o]=v.useState(""),l=v.useRef(null),[u,d]=v.useState(!1),[f,h]=v.useState([]),[p,m]=v.useState(null),[y,w]=v.useState([]),[g,E]=v.useState(!1),[b,_]=v.useState(!1),[N,T]=v.useState("confirm"),[A,k]=v.useState(""),R=v.useRef(null),I=v.useRef(null),[M,B]=v.useState({}),Y=a?M[a]??[]:f,P=p?y:Y,U=p?"灵光一现":Hue(s.find(q=>q.id===a),P),C=(q,te)=>B(xe=>({...xe,[q]:typeof te=="function"?te(xe[q]??[]):te})),[L,O]=v.useState(""),[j,S]=v.useState("agent"),[H,V]=v.useState({}),[D,ne]=v.useState(null),[ee,re]=v.useState(!1),de=v.useRef(0),[G,W]=v.useState([]),[oe,he]=v.useState(Vs),[J,ce]=v.useState(null),[Ce,Ee]=v.useState(!1),ge=v.useRef(new Set),[Le,ve]=v.useState(()=>new Set),Ue=v.useRef(new Map),Ie=(q,te)=>ve(xe=>{const je=new Set(xe);return te?je.add(q):je.delete(q),je}),ae=v.useRef(""),[wt,we]=v.useState(""),[vt,ct]=v.useState(!1),[K,X]=v.useState(kS),[le,Ne]=v.useState(null),[Re,ut]=v.useState(null),[We,ot]=v.useState(""),[Zt,Ct]=v.useState(),[Ge,Et]=v.useState(null),[Ht,Nn]=v.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[Fe,rt]=v.useState("cloud"),[tt,mt]=v.useState(Du),[ue,Oe]=v.useState("chat"),[Qe,cn]=v.useState(!1),[an,ie]=v.useState(!1),[_e,ye]=v.useState(!1),[Pe,$e]=v.useState({}),[qe,gt]=v.useState({}),[It,Rt]=v.useState({}),yn=Le.has(a)||u,zt=p?g:yn,kn=Pe[a]??"",er=qe[a]??Uue,_r=It[a]??$ue,Dn=J==null?void 0:J.graph,Hn=oe.targetAgent&&Dn?EP(Dn,oe.targetAgent.name):Dn,tr=(Hn==null?void 0:Hn.skills)??(oe.targetAgent?[]:(J==null?void 0:J.skills)??[]),Tr=Dn?xP(Dn):[];function Vt(q){H0(q);for(const te of q)te.status==="uploading"?ge.current.add(te.id):te.uri&&uh(n,te.uri).catch(xe=>we(String(xe)))}function Sn(){de.current+=1;const q=D;ne(null),re(!1),q&&!q.id.startsWith("pending-")&&Qce(q.id).catch(te=>{we(te instanceof Error?te.message:String(te))})}async function Pn(q){try{await r1(n,We,q),await n1(n,We,q),i(te=>te.filter(xe=>xe.id!==q)),B(te=>{const{[q]:xe,...je}=te;return je})}catch(te){we(String(te))}}function nr(q){const te=G.find(Ke=>Ke.id===q);if(!te)return;const xe=G.filter(Ke=>Ke.id!==q);H0([te]),te.status==="uploading"&&ge.current.add(q),W(xe),xe.length===0&&!L.trim()&&!!a&&P.length===0?(ae.current="",o(""),Pn(a)):te.uri&&uh(n,te.uri).catch(Ke=>we(String(Ke)))}const zn=(q,te)=>{var Ye,Ve,Ze,Se,pt;const xe=te.author&&te.author!=="user"?te.author:void 0;xe&&($e(_t=>({..._t,[q]:xe})),gt(_t=>({..._t,[q]:new Set(_t[q]??[]).add(xe)})),Rt(_t=>{var Mt;return(Mt=_t[q])!=null&&Mt.length?_t:{..._t,[q]:[xe]}}));const je=((Ye=te.actions)==null?void 0:Ye.transferToAgent)??((Ve=te.actions)==null?void 0:Ve.transfer_to_agent);je&&Rt(_t=>{const Mt=_t[q]??[];return Mt[Mt.length-1]===je?_t:{..._t,[q]:[...Mt,je]}}),(((Ze=te.actions)==null?void 0:Ze.endOfAgent)??((Se=te.actions)==null?void 0:Se.end_of_agent)??((pt=te.actions)==null?void 0:pt.escalate))&&Rt(_t=>{const Mt=_t[q]??[];return Mt.length<=1?_t:{..._t,[q]:Mt.slice(0,-1)}})},[An,st]=v.useState(_S),[Cn,Bt]=v.useState([]),Jt=v.useCallback(q=>{Bt(te=>{const xe=te.findIndex(Ke=>Ke.id===q.id);if(xe===-1)return[q,...te];const je=[...te];return je[xe]={...je[xe],...q},je})},[]),In=v.useCallback(async q=>{try{await XI(q.id),Bt(te=>te.map(xe=>xe.id===q.id?{...xe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:xe))}catch(te){const xe=te instanceof Error?te.message:String(te);Bt(je=>je.map(Ke=>Ke.id===q.id?{...Ke,message:`取消失败:${xe}`}:Ke))}},[]),[jn,wn]=v.useState(!0),[rr,Ot]=v.useState(!1),[Z,ke]=v.useState(!1),[Me,He]=v.useState(!1),[Lt,yt]=v.useState(null),[Kt,kt]=v.useState(!1),[fr,St]=v.useState(!1),ra=v.useRef(null),[Jl,ec]=v.useState(()=>{const q=Zs();return Kl(q),q}),[Bd,Fd]=v.useState(!1),qm=v.useRef(!1),Ud=v.useRef(!1);function $d(q){console.log("create agent draft:",q),st(null),oo()}function rw(q,te){console.log("Agent added, navigating to:",q,te),ec(Zs()),st(null),r(q)}const{ref:vP,onScroll:_P}=sM(P),Gm=v.useCallback(()=>{ut(null),ZF().then(q=>{ot(q.userId),Ct(q.info),ie(!!q.local),Ne(q.status)}).catch(q=>{ut(q instanceof Error?q.message:String(q))})},[]);v.useEffect(()=>{Gm()},[Gm]),v.useEffect(()=>{an&&We&&H_(We)},[an,We]),v.useEffect(()=>{if(le!=="authenticated"||!We){V({});return}let q=!1;return Promise.allSettled([gue(),yue()]).then(([te,xe])=>{q||V({temporaryEnabled:te.status==="fulfilled"&&te.value.enabled,skillCreateEnabled:xe.status==="fulfilled"&&xe.value.enabled})}),()=>{q=!0}},[le,We]),v.useEffect(()=>{if(le!=="authenticated"||!We){Et(null);return}let q=!1;return Et(null),eR().then(te=>{q||Et(te)}).catch(te=>{console.warn("[app] /web/access failed; using ordinary-user access:",te),q||Et(JI)}),()=>{q=!0}},[le,We]),v.useEffect(()=>{ZI().then(q=>{Nn(q.features),rt(q.agentsSource),mt(q.branding),Oe(q.defaultView),cn(!0)})},[]),v.useEffect(()=>{!Ge||!Qe||Ud.current||(Ud.current=!0,ue==="addAgent"&&Ge.capabilities.createAgents&&(st(null),Ot(!1),kt(!1),St(!1),ke(!1),He(!0)))},[Ge,ue,Qe]),v.useEffect(()=>{Ge&&(Ge.capabilities.createAgents||(st(null),yt(null),ke(!1),He(!1),Bt([])),Ge.capabilities.manageAgents||St(!1))},[Ge]),v.useEffect(()=>{document.title=tt.title;let q=document.querySelector('link[rel~="icon"]');q||(q=document.createElement("link"),q.rel="icon",document.head.appendChild(q)),q.removeAttribute("type"),q.href=tt.logoUrl||ux},[tt]),v.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(q=>q.ok?q.json():null).then(q=>{q&&wn(!!q.credentials)}).catch(q=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",q)})},[]);function TP(q){H_(q),qm.current=!0,Ud.current=!1,Et(null),st(null),yt(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!1),oo(),ot(q),Ct({name:q}),ie(!0),Ne("authenticated")}function NP(){Ud.current=!1,Et(null),an?(qF(),ot(""),Ct(void 0),Ne("unauthenticated")):QF()}v.useEffect(()=>{le!=="unauthenticated"&&$I().then(q=>{if(t(q),Fe==="cloud"){r("");return}const te=localStorage.getItem(vo.app),xe=Jl.flatMap(Ye=>Ye.apps.map(Ve=>Ka(Ye.id,Ve))),je=te&&(q.includes(te)||xe.includes(te)),Ke=["web_search_agent","web_demo"].find(Ye=>q.includes(Ye))??q.find(Ye=>!/^\d/.test(Ye))??q[0];r(je?te:Ke||"")}).catch(q=>we(String(q)))},[le,Fe]),v.useEffect(()=>{n&&localStorage.setItem(vo.app,n)},[n]),v.useEffect(()=>{let q=!1;if(ce(null),he(Vs()),!n){Ee(!1);return}return Ee(!0),hd(n).then(te=>{q||ce(te)}).catch(()=>{q||ce(null)}).finally(()=>{q||Ee(!1)}),()=>{q=!0}},[n]),v.useEffect(()=>{Ge&&localStorage.setItem(vo.view,Ge.capabilities.createAgents?An??"chat":"chat")},[Ge,An]),v.useEffect(()=>{localStorage.setItem(vo.session,a),ae.current=a},[a]),v.useEffect(()=>()=>Ue.current.forEach(q=>q.abort()),[]),v.useEffect(()=>()=>{var q,te;(q=R.current)==null||q.abort(),(te=I.current)==null||te.abort()},[]),v.useEffect(()=>{!n||!We||(async()=>{const q=await Hd(n);if(!qm.current){qm.current=!0;const te=localStorage.getItem(vo.session)||"";if(_S()===null&&te&&q.some(xe=>xe.id===te)){zd(te);return}}oo()})()},[n,We]),v.useEffect(()=>{const q=ra.current;q&&q.app===n&&(ra.current=null,zd(q.sid))},[n]);function kP(q,te){kt(!1),q===n?zd(te):(ra.current={app:q,sid:te},r(q))}async function Hd(q){try{const te=await OE(q,We),xe=await Promise.all(te.map(je=>{var Ke;return(Ke=je.events)!=null&&Ke.length?Promise.resolve(je):dp(q,We,je.id)}));return i(xe),xe}catch(te){return we(String(te)),[]}}function SP(){p||(we(""),k(""),T("confirm"),_(!0))}function AP(){var q;(q=R.current)==null||q.abort(),R.current=null,_(!1),T("confirm"),k(""),!p&&j==="temporary"&&S("agent")}async function CP(){var te;(te=R.current)==null||te.abort();const q=new AbortController;R.current=q,T("loading"),k("");try{const xe=await U0.startSession({signal:q.signal});if(R.current!==q)return;ae.current="",o(""),h([]),O(""),he(Vs()),S("temporary"),Sn(),re(!1),Vt(G),W([]),w([]),m(xe),st(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!1),_(!1),T("confirm")}catch(xe){if((xe==null?void 0:xe.name)==="AbortError"||R.current!==q)return;k(xe instanceof Error?xe.message:String(xe)),T("error")}finally{R.current===q&&(R.current=null)}}function sa(){var te;(te=I.current)==null||te.abort(),I.current=null,E(!1),w([]),O(""),we(""),S("agent");const q=p;m(null),q&&U0.closeSession(q.id).catch(xe=>we(String(xe)))}async function IP(q){var Ke;const te=p;if(!te||g||!q.trim())return;we("");const xe=new AbortController;(Ke=I.current)==null||Ke.abort(),I.current=xe;const je=[{role:"user",blocks:[{kind:"text",text:q}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Ye=>[...Ye,...je]),E(!0);try{const Ye=await U0.sendMessage({sessionId:te.id,text:q},{signal:xe.signal,onBlocks:Ve=>{I.current===xe&&w(Ze=>{const Se=Ze.slice(),pt=Se[Se.length-1];return(pt==null?void 0:pt.role)==="assistant"&&(Se[Se.length-1]={...pt,blocks:Ve}),Se})}});if(I.current!==xe)return;w(Ve=>{const Ze=Ve.slice(),Se=Ze[Ze.length-1];return(Se==null?void 0:Se.role)==="assistant"&&(Ze[Ze.length-1]={...Se,blocks:Ye.blocks,meta:{ts:Date.now()/1e3}}),Ze})}catch(Ye){if((Ye==null?void 0:Ye.name)==="AbortError"||I.current!==xe)return;w(Ve=>Ve.slice(0,-2)),O(q),we(`临时会话发送失败:${Ye instanceof Error?Ye.message:String(Ye)}`)}finally{I.current===xe&&(I.current=null,E(!1))}}function oo(){sa(),we(""),X(kS()),S("agent"),Sn(),re(!1);const q=a&&Y.length===0&&G.length>0?a:"";ae.current="",o(""),d(!1),h([]),he(Vs()),Vt(G),W([]),q&&Pn(q)}async function RP(q){var te;try{(te=Ue.current.get(q))==null||te.abort(),await r1(n,We,q),await n1(n,We,q),B(xe=>{const{[q]:je,...Ke}=xe;return Ke}),q===a&&oo(),await Hd(n)}catch(xe){we(String(xe))}}async function zd(q){if(p&&sa(),q!==a&&(ae.current=q,we(""),d(!1),h([]),S("agent"),Sn(),he(Vs()),o(q),M[q]===void 0)){ye(!0);try{const te=await dp(n,We,q);C(q,fU(te.events??[]))}catch(te){we(String(te))}finally{ye(!1)}}}async function sw(q=!0){if(a)return a;l.current||(l.current=up(n,We));const te=l.current;try{const xe=await te;q&&o(xe);const je=Date.now()/1e3,Ke={id:xe,lastUpdateTime:je,events:[]};return i(Ye=>[Ke,...Ye.filter(Ve=>Ve.id!==xe)]),xe}finally{l.current===te&&(l.current=null)}}async function OP(q){we("");let te;try{te=await sw()}catch(je){we(String(je));return}const xe=Array.from(q).map(je=>({file:je,attachment:{id:ede(),mimeType:tde(je),name:je.name,sizeBytes:je.size,status:"uploading"}}));W(je=>[...je,...xe.map(Ke=>Ke.attachment)]),await Promise.all(xe.map(async({file:je,attachment:Ke})=>{try{const Ye=await HI(n,We,te,je);if(ge.current.delete(Ke.id)){Ye.uri&&await uh(n,Ye.uri);return}W(Ve=>Ve.map(Ze=>Ze.id===Ke.id?Ye:Ze))}catch(Ye){if(ge.current.delete(Ke.id))return;const Ve=Ye instanceof Error?Ye.message:String(Ye);W(Ze=>Ze.map(Se=>Se.id===Ke.id?{...Se,status:"error",error:Ve}:Se)),we(Ve)}}))}async function iw(q,te=[],xe=Vs()){if(!q.trim()&&te.length===0||yn||!n||!We)return;we("");const je=[];(xe.skills.length>0||xe.targetAgent)&&je.push({kind:"invocation",value:xe}),te.length&&je.push({kind:"attachment",files:te.map(Se=>({id:Se.id,mimeType:Se.mimeType,data:Se.data,uri:Se.uri,name:Se.name,sizeBytes:Se.sizeBytes}))}),q.trim()&&je.push({kind:"text",text:q});const Ke=[{role:"user",blocks:je,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Ye=!a;Ye&&(h(Ke),d(!0));let Ve;try{Ve=await sw(!Ye)}catch(Se){Ye&&(h([]),d(!1),O(q),he(xe)),we(String(Se));return}C(Ve,Se=>Ye?Ke:[...Se,...Ke]),Ye&&(ae.current=Ve,o(Ve),h([]),d(!1));const Ze=new AbortController;Ue.current.set(Ve,Ze),Ie(Ve,!0),ae.current=Ve,$e(Se=>({...Se,[Ve]:""})),gt(Se=>({...Se,[Ve]:new Set})),Rt(Se=>({...Se,[Ve]:[]}));try{let Se=Qs(),pt=0,_t=Date.now()/1e3;for await(const Mt of Mu({appName:n,userId:We,sessionId:Ve,text:q,attachments:te,invocation:xe,signal:Ze.signal})){if(Ze.signal.aborted)break;const pi=Mt.error??Mt.errorMessage??Mt.error_message;if(typeof pi=="string"&&pi){ae.current===Ve&&we(pi);break}zn(Ve,Mt),Se=ml(Se,Mt);const lo=Mt.usageMetadata??Mt.usage_metadata;lo!=null&&lo.totalTokenCount&&(pt=lo.totalTokenCount),Mt.timestamp&&(_t=Mt.timestamp);const Jm=Se.blocks,aa={tokens:pt||void 0,ts:_t};C(Ve,oa=>{const mi=oa.slice(),Yd=mi[mi.length-1];return(Yd==null?void 0:Yd.role)==="assistant"&&(mi[mi.length-1]={...Yd,blocks:Jm,meta:aa}),mi})}Hd(n)}catch(Se){(Se==null?void 0:Se.name)!=="AbortError"&&!Ze.signal.aborted&&ae.current===Ve&&we(String(Se))}finally{Ue.current.get(Ve)===Ze&&Ue.current.delete(Ve),Ie(Ve,!1),$e(Se=>({...Se,[Ve]:""})),Rt(Se=>({...Se,[Ve]:[]}))}}function LP(q,te){var Ke,Ye;const xe=((Ke=q==null?void 0:q.event)==null?void 0:Ke.name)??te.id,je=((Ye=q==null?void 0:q.event)==null?void 0:Ye.context)??{};iw(`[ui-action] ${xe}: ${JSON.stringify(je)}`)}async function MP(q){if(!q.authUri)throw new Error("事件中没有授权地址。");if(!n||!We||!a)throw new Error("会话尚未就绪。");const te=a,xe=await Xue(q.authUri),je=Que(q.authConfig,xe),Ke=Se=>Se.map(pt=>pt.kind==="auth"&&!pt.done?{...pt,done:!0}:pt);C(te,Se=>{const pt=Se.slice(),_t=pt[pt.length-1];return(_t==null?void 0:_t.role)==="assistant"&&(pt[pt.length-1]={..._t,blocks:Ke(_t.blocks)}),pt});const Ye=P[P.length-1],Ve=Ke(Ye&&Ye.role==="assistant"?Ye.blocks:[]),Ze=new AbortController;Ue.current.set(te,Ze),Ie(te,!0);try{let Se=Qs(),pt=0,_t=Date.now()/1e3;for await(const Mt of Mu({appName:n,userId:We,sessionId:a,text:"",functionResponses:[{id:q.callId,name:"adk_request_credential",response:je}],signal:Ze.signal})){if(Ze.signal.aborted)break;zn(te,Mt),Se=ml(Se,Mt);const pi=Mt.usageMetadata??Mt.usage_metadata;pi!=null&&pi.totalTokenCount&&(pt=pi.totalTokenCount),Mt.timestamp&&(_t=Mt.timestamp);const lo=[...Ve,...Se.blocks];C(te,Jm=>{var mi;const aa=Jm.slice(),oa=aa[aa.length-1];return(oa==null?void 0:oa.role)==="assistant"&&(aa[aa.length-1]={...oa,blocks:lo,meta:{tokens:pt||((mi=oa.meta)==null?void 0:mi.tokens),ts:_t}}),aa})}Hd(n)}catch(Se){(Se==null?void 0:Se.name)!=="AbortError"&&!Ze.signal.aborted&&ae.current===te&&we(String(Se))}finally{Ue.current.get(te)===Ze&&Ue.current.delete(te),Ie(te,!1),$e(Se=>({...Se,[te]:""})),Rt(Se=>({...Se,[te]:[]}))}}if(Re)return c.jsxs("div",{className:"boot boot-error",children:[c.jsx("p",{children:Re}),c.jsx("button",{type:"button",onClick:Gm,children:"重试"})]});if(le===null)return c.jsx("div",{className:"boot"});if(le==="unauthenticated")return c.jsx(kue,{branding:tt,onUsername:TP});if(!Ge)return c.jsx("div",{className:"boot"});const ia=Ge.capabilities.createAgents,aw=Ge.capabilities.manageAgents,ws=ia?An:null,Xm=ia&&Me,Qm=ia&&Z,ow=aw&&fr,lw=YL(e,Jl),Vd=q=>{var te;return((te=lw.find(xe=>xe.id===q))==null?void 0:te.label)??q},tc=Jl.find(q=>q.runtimeId&&q.apps.some(te=>Ka(q.id,te)===n)),Kd=tc&&tc.runtimeId?{runtimeId:tc.runtimeId,name:tc.name,region:tc.region??"cn-beijing"}:void 0,Zm=q=>{ec(Zs()),ae.current="",o(""),r(q)},DP=async q=>{const te=await cx(q.runtimeId,q.name,q.region);Zm(te)};return c.jsxs("div",{className:"layout",children:[c.jsx(jZ,{branding:tt,access:Ge,agentsSource:Fe,localApps:e,currentAgentId:n,currentAgentLabel:n?Vd(n):"",currentRuntime:Kd,onSelectAgent:Zm,features:Ht,sessions:s,currentSessionId:a,streamingSids:Le,onNewChat:()=>{st(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!1),oo()},onSearch:()=>{p&&sa(),st(null),Ot(!1),ke(!1),He(!1),St(!1),kt(!0),we("")},onQuickCreate:()=>{if(!ia){we("当前账号没有添加 Agent 的权限。");return}p&&sa(),ae.current="",o(""),Ot(!1),ke(!1),kt(!1),St(!1),st(null),yt(null),He(!0),we("")},onSkillCenter:()=>{p&&sa(),st(null),ke(!1),He(!1),kt(!1),St(!1),Ot(!0),we("")},onAddAgent:()=>{if(!ia){we("当前账号没有添加 Agent 的权限。");return}p&&sa(),ae.current="",st(null),Ot(!1),kt(!1),St(!1),o(""),He(!1),ke(!0),we("")},onManageAgents:()=>{if(!aw){we("当前账号没有管理 Agent 的权限。");return}p&&sa(),ae.current="",o(""),st(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!0),we("")},onPickSession:q=>{st(null),Ot(!1),ke(!1),He(!1),kt(!1),St(!1),we(""),zd(q)},onDeleteSession:RP,userInfo:Zt,onLogout:NP}),(()=>{const q=c.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&c.jsx(xue,{onExit:oo}),c.jsx(xJ,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Vd(n):"Agent",value:L,onChange:O,onSubmit:()=>{if(!p&&j==="skill-create"){const Ke=L.trim();if(!Ke||ee)return;const Ye={id:`pending-${Date.now()}`,prompt:Ke,status:"provisioning",candidates:gx.map((Ze,Se)=>({id:`pending-${Se}`,model:Ze,modelLabel:Ze,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};re(!0);const Ve=++de.current;we(""),ne(Ye),O(""),Gce(Ke,Ze=>{de.current===Ve&&ne(Ze)}).then(Ze=>{de.current===Ve&&ne(Ze)}).catch(Ze=>{de.current===Ve&&(ne(null),O(Ke),we(Ze instanceof Error?Ze.message:String(Ze)))}).finally(()=>{de.current===Ve&&re(!1)});return}const te=L;if(O(""),p){IP(te);return}const xe=G,je=oe;W([]),he(Vs()),iw(te,xe,je),H0(xe)},disabled:p?!1:!We||j==="temporary"||j==="agent"&&!n,busy:p?g:j==="skill-create"?ee:yn,showMeta:P.length>0&&!p,attachments:p?[]:G,skills:p?[]:tr,agents:p?[]:Tr,invocation:p?Vs():oe,capabilitiesLoading:!p&&Ce,allowAttachments:!p,onInvocationChange:he,onAddFiles:OP,onRemoveAttachment:nr,newChatMode:p?"agent":j,newChatLayout:!p&&P.length===0&&D===null,showModeSelector:!p&&P.length===0&&D===null&&ia,temporaryEnabled:H.temporaryEnabled,skillCreateEnabled:H.skillCreateEnabled,onModeChange:te=>{if(!(te==="temporary"&&!H.temporaryEnabled||te==="skill-create"&&!H.skillCreateEnabled)){if(te==="temporary"){S(te),SP();return}if(S(te),we(""),te==="skill-create"){he(Vs());const xe=a&&Y.length===0&&G.length>0?a:"";Vt(G),W([]),xe&&(ae.current="",o(""),Pn(xe))}}}})]});return c.jsxs("section",{className:"main-shell",children:[c.jsx(BZ,{apps:lw.map(te=>te.id),appName:n,onAppChange:Zm,agentLabel:Vd,title:Xm?"添加 Agent":Qm?"添加 AgentKit 智能体":rr?void 0:Kt?"搜索":ow?"管理 Agent":ws?void 0:U,crumbs:rr?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:Kt||Qm||Xm||!ws?void 0:ws==="menu"?[{label:Bue,onClick:()=>{st(null),yt(null),He(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Fd(!0)},{label:Fue[ws]}],rightContent:c.jsx(Jue,{tasks:ia?Cn:[],onCancel:In})}),c.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[wt&&c.jsx("div",{className:"error",children:wt}),_e&&c.jsxs("div",{className:"session-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载会话…"]}),ow?c.jsx(zZ,{currentRuntimeId:Kd==null?void 0:Kd.runtimeId,onConnect:DP}):Xm?c.jsx(fM,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:zue,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{He(!1),yt(null),st("menu")}}]}):Kt?c.jsx(pZ,{userId:We,appId:n,agentInfo:J,capabilitiesLoading:Ce,agentLabel:Vd,onOpenSession:kP}):Qm?c.jsx(HZ,{onAdded:te=>{ec(Zs()),ke(!1),r(te)},onCancel:()=>ke(!1)}):rr?c.jsx(nZ,{}):ws!==null&&!jn?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,height:"100%",padding:24,textAlign:"center",color:"var(--text-secondary, #6b7280)"},children:[c.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),c.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",c.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",c.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):ws==="menu"?c.jsx(Xee,{onSelect:te=>{yt(null),st(te)},onImport:te=>{yt(te),st("custom")}}):ws==="intelligent"?c.jsx(_te,{userId:We,onBack:()=>st("menu"),onCreate:$d,onAgentAdded:rw,onDeploymentTaskChange:Jt}):ws==="custom"?c.jsx(une,{initialDraft:Lt??void 0,onBack:()=>st("menu"),onCreate:$d,onAgentAdded:rw,features:Ht,onDeploymentTaskChange:Jt}):ws==="template"?c.jsx(hne,{onBack:()=>st("menu"),onCreate:$d}):ws==="workflow"?c.jsx($ce,{onBack:()=>st("menu"),onCreate:$d}):P.length===0&&D?c.jsx(uue,{initialJob:D}):P.length===0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"welcome",children:[c.jsx(Yl,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":j==="skill-create"?"想创建一个什么 Skill?":K}),q]}),!p&&j==="agent"?c.jsx(FN,{appName:n,activeAgent:kn,seenAgents:er,execPath:_r}):null]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"transcript",ref:vP,onScroll:_P,children:P.map((te,xe)=>{var Ye;const je=xe===P.length-1;if(te.role==="user"){const Ve=te.blocks.map(pt=>pt.kind==="text"?pt.text:"").join(""),Ze=te.blocks.flatMap(pt=>pt.kind==="attachment"?pt.files:[]),Se=te.blocks.find(pt=>pt.kind==="invocation");return c.jsxs(Gt.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Se==null?void 0:Se.kind)==="invocation"&&c.jsx(fx,{value:Se.value}),Ze.length>0&&c.jsx(px,{appName:n,items:Ze}),Ve&&c.jsx("div",{className:"bubble",children:c.jsx(_d,{text:Ve})}),c.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ye=te.meta)==null?void 0:Ye.ts)&&c.jsx("span",{className:"meta-text",children:wP(te.meta.ts)}),c.jsx(TS,{text:Ve})]})]},xe)}const Ke=te.blocks.length===0;return c.jsx(Gt.div,{className:"turn turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:Ke?je&&zt?c.jsx(dM,{}):null:c.jsxs(c.Fragment,{children:[c.jsx(mx,{appName:n,blocks:te.blocks,onAction:LP,onAuth:MP}),!(je&&zt)&&!que(te)&&c.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(je&&zt)&&!Gue(te)&&c.jsxs("div",{className:"turn-meta",children:[c.jsxs("div",{className:"turn-actions",children:[!p&&c.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>ct(!0),children:c.jsx(Vue,{})}),c.jsx(TS,{text:Yue(te)})]}),te.meta&&c.jsx("span",{className:"meta-text",children:Kue(te.meta)})]})]})},xe)})}),!p&&c.jsx(FN,{appName:n,activeAgent:kn,seenAgents:er,execPath:_r}),q]})]})]})})(),vt&&a&&c.jsx(Tue,{appName:n,sessionId:a,onClose:()=>ct(!1)}),c.jsx(Eue,{open:b,state:N,error:A,onCancel:AP,onConfirm:()=>void CP()}),Bd&&c.jsx("div",{className:"confirm-scrim",onClick:()=>Fd(!1),children:c.jsxs("div",{className:"confirm-box",onClick:q=>q.stopPropagation(),children:[c.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),c.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),c.jsxs("div",{className:"confirm-actions",children:[c.jsx("button",{className:"confirm-btn",onClick:()=>Fd(!1),children:"取消"}),c.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{yt(null),st("menu"),Fd(!1)},children:"确定返回"})]})]})})]})}(()=>{if(!(window.opener&&window.opener!==window&&/[?&](code|state|error)=/.test(window.location.search)))return!1;try{window.opener.postMessage({veadkOAuth:!0,url:window.location.href},window.location.origin)}catch{}return window.close(),!0})()||z0.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(x5,{reducedMotion:"user",children:c.jsx(J9,{maskOpacity:.9,children:c.jsx(nde,{})})})}));export{v as A,bm as B,Or as C,ode as D,Qc as E,Va as F,XR as G,sde as R,Zn as V,et as a,gl as b,DT as c,lde as d,$E as e,kH as f,Bu as g,dt as h,zV as i,XV as j,AH as k,td as l,XK as m,RV as n,OV as o,sY as p,TK as q,NK as r,oO as s,c as t,Be as u,At as v,it as w,ade as x,$V as y,$a as z}; +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return v.useEffect(()=>{const l=(t==null?void 0:t.target)??ZN,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,g;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&dD(p))return!1;const y=eS(p.code,o);if(i.current.add(p[y]),JN(a,i.current,!1)){const E=((g=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:g[0])||p.target,b=(E==null?void 0:E.nodeName)==="BUTTON"||(E==null?void 0:E.nodeName)==="A";t.preventDefault!==!1&&(s.current||!b)&&p.preventDefault(),r(!0)}},f=p=>{const m=eS(p.code,o);JN(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[m]),p.key==="Meta"&&i.current.clear(),s.current=!1},h=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function JN(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function eS(e,t){return t.includes(e)?"code":"key"}const Foe=()=>{const e=Qt();return v.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Kx(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:o,y:l}=a.getBoundingClientRect(),u={x:t.x-o,y:t.y-l},d=n.snapGrid??s,f=n.snapToGrid??i;return Zl(u,r,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:i}=r.getBoundingClientRect(),a=Cl(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function jD(e,t){const n=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of t){const a=r.get(i.id);if(!a){n.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const o={...i};for(const l of a)Uoe(l,o);n.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Uoe(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function BD(e,t){return jD(e,t)}function FD(e,t){return jD(e,t)}function ya(e,t){return{id:e,type:"select",selected:t}}function Ko(e,t=new Set,n=!1){const r=[];for(const[s,i]of e){const a=t.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(n&&(i.selected=a),r.push(ya(i.id,a)))}return r}function tS({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=t.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&n.push({id:a.id,item:a,type:"replace"}),l===void 0&&n.push({item:a,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function nS(e){return{id:e.id,type:"remove"}}const $oe=oD();function UD(e,t,n={}){return hae(e,t,{...n,onError:n.onError??$oe})}const rS=e=>Zie(e),Hoe=e=>rD(e);function $D(e){return v.forwardRef(e)}const zoe=typeof window<"u"?v.useLayoutEffect:v.useEffect;function sS(e){const[t,n]=v.useState(BigInt(0)),[r]=v.useState(()=>Voe(()=>n(s=>s+BigInt(1))));return zoe(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function Voe(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const HD=v.createContext(null);function Koe({children:e}){const t=Qt(),n=v.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let y=l;for(const g of o)y=typeof g=="function"?g(y):g;let w=tS({items:y,lookup:h});for(const g of m.values())w=g(w);d&&u(y),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:E,setNodes:b}=t.getState();g&&b(E)})},[]),r=sS(n),s=v.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=l;for(const m of o)p=typeof m=="function"?m(p):m;d?u(p):f&&f(tS({items:p,lookup:h}))},[]),i=sS(s),a=v.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return c.jsx(HD.Provider,{value:a,children:e})}function Yoe(){const e=v.useContext(HD);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Woe=e=>!!e.panZoom;function Zx(){const e=Foe(),t=Qt(),n=Yoe(),r=ft(Woe),s=v.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},o=f=>{n.edgeQueue.push(f)},l=f=>{var g,E;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=rS(f)?f:h.get(f.id),y=m.parentId?cD(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:y,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((E=m.measured)==null?void 0:E.height)??m.height};return Al(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(y=>{if(y.id===f){const w=typeof h=="function"?h(y):h;return p.replace&&rS(w)?w:{...y,...w}}return y}))},d=(f,h,p={replace:!1})=>{o(m=>m.map(y=>{if(y.id===f){const w=typeof h=="function"?h(y):h;return p.replace&&Hoe(w)?w:{...y,...w}}return y}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=i(f))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:o,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,y,w]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:y,onEdgesDelete:w,triggerNodeChanges:g,triggerEdgeChanges:E,onDelete:b,onBeforeDelete:_}=t.getState(),{nodes:k,edges:T}=await rae({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),A=T.length>0,N=k.length>0;if(A){const R=T.map(nS);w==null||w(T),E(R)}if(N){const R=k.map(nS);y==null||y(k),g(R)}return(N||A)&&(b==null||b({nodes:k,edges:T})),{deletedNodes:k,deletedEdges:T}},getIntersectingNodes:(f,h=!0,p)=>{const m=LN(f),y=m?f:l(f),w=p!==void 0;return y?(p||t.getState().nodes).filter(g=>{const E=t.getState().nodeLookup.get(g.id);if(E&&!m&&(g.id===f.id||!E.internals.positionAbsolute))return!1;const b=Al(w?g:E),_=Zu(b,y);return h&&_>0||_>=b.width*b.height||_>=y.width*y.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const y=LN(f)?f:l(f);if(!y)return!1;const w=Zu(y,h);return p&&w>0||w>=h.width*h.height||w>=y.width*y.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Jie(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??aae();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return v.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const iS=e=>e.selected,qoe=typeof window<"u"?window:void 0;function Goe({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Qt(),{deleteElements:r}=Zx(),s=ed(e,{actInsideInputWithModifier:!1}),i=ed(t,{target:qoe});v.useEffect(()=>{if(s){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(iS),edges:a.filter(iS)}),n.setState({nodesSelectionActive:!1})}},[s]),v.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Xoe(e){const t=Qt();v.useEffect(()=>{const n=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Yx(e.current);(r.height===0||r.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",gs.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Km={position:"absolute",width:"100%",height:"100%",top:0,left:0},Qoe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Zoe({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Da.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:y,noPanClassName:w,onViewportChange:g,isControlledViewport:E,paneClickDistance:b,selectionOnDrag:_}){const k=Qt(),T=v.useRef(null),{userSelectionActive:A,lib:N,connectionInProgress:R}=ft(Qoe,Xt),I=ed(h),M=v.useRef();Xoe(T);const B=v.useCallback(Y=>{g==null||g({x:Y[0],y:Y[1],zoom:Y[2]}),E||k.setState({transform:Y})},[g,E]);return v.useEffect(()=>{if(T.current){M.current=zae({domNode:T.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:C=>k.setState(L=>L.paneDragging===C?L:{paneDragging:C}),onPanZoomStart:(C,L)=>{const{onViewportChangeStart:O,onMoveStart:j}=k.getState();j==null||j(C,L),O==null||O(L)},onPanZoom:(C,L)=>{const{onViewportChange:O,onMove:j}=k.getState();j==null||j(C,L),O==null||O(L)},onPanZoomEnd:(C,L)=>{const{onViewportChangeEnd:O,onMoveEnd:j}=k.getState();j==null||j(C,L),O==null||O(L)}});const{x:Y,y:P,zoom:U}=M.current.getViewport();return k.setState({panZoom:M.current,transform:[Y,P,U],domNode:T.current.closest(".react-flow")}),()=>{var C;(C=M.current)==null||C.destroy()}}},[]),v.useEffect(()=>{var Y;(Y=M.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:A,noWheelClassName:y,lib:N,onTransformChange:B,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:b})},[e,t,n,r,s,i,a,o,I,p,w,A,y,N,B,R,_,b]),c.jsx("div",{className:"react-flow__renderer",ref:T,style:Km,children:m})}const Joe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ele(){const{userSelectionActive:e,userSelectionRect:t}=ft(Joe,Xt);return e&&t?c.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const O0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},tle=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function nle({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xu.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:y}){const w=v.useRef(0),g=Qt(),{userSelectionActive:E,elementsSelectable:b,dragging:_,connectionInProgress:k,panBy:T,autoPanSpeed:A}=ft(tle,Xt),N=b&&(e||E),R=v.useRef(null),I=v.useRef(),M=v.useRef(new Set),B=v.useRef(new Set),Y=v.useRef(!1),P=v.useRef({x:0,y:0}),U=v.useRef(!1),C=G=>{if(Y.current||k){Y.current=!1;return}u==null||u(G),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},L=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}d==null||d(G)},O=f?G=>f(G):void 0,j=G=>{Y.current&&(G.stopPropagation(),Y.current=!1)},S=G=>{var Le,ve;const{domNode:W,transform:oe}=g.getState();if(I.current=W==null?void 0:W.getBoundingClientRect(),!I.current)return;const he=G.target===R.current;if(!he&&!!G.target.closest(".nokey")||!e||!(a&&he||t)||G.button!==0||!G.isPrimary)return;(ve=(Le=G.target)==null?void 0:Le.setPointerCapture)==null||ve.call(Le,G.pointerId),Y.current=!1;const{x:Ce,y:Ee}=cs(G.nativeEvent,I.current),ge=Zl({x:Ce,y:Ee},oe);g.setState({userSelectionRect:{width:0,height:0,startX:ge.x,startY:ge.y,x:Ce,y:Ee}}),he||(G.stopPropagation(),G.preventDefault())};function H(G,W){const{userSelectionRect:oe}=g.getState();if(!oe)return;const{transform:he,nodeLookup:J,edgeLookup:ce,connectionLookup:Ce,triggerNodeChanges:Ee,triggerEdgeChanges:ge,defaultEdgeOptions:Le}=g.getState(),ve={x:oe.startX,y:oe.startY},{x:Ue,y:Ie}=Cl(ve,he),ae={startX:ve.x,startY:ve.y,x:Gct.id)),B.current=new Set;const vt=(Le==null?void 0:Le.selectable)??!0;for(const ct of M.current){const K=Ce.get(ct);if(K)for(const{edgeId:X}of K.values()){const le=ce.get(X);le&&(le.selectable??vt)&&B.current.add(X)}}if(!MN(wt,M.current)){const ct=Ko(J,M.current,!0);Ee(ct)}if(!MN(we,B.current)){const ct=Ko(ce,B.current);ge(ct)}g.setState({userSelectionRect:ae,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!s||!I.current)return;const[G,W]=Vx(P.current,I.current,A);T({x:G,y:W}).then(oe=>{if(!Y.current||!oe){w.current=requestAnimationFrame(V);return}const{x:he,y:J}=P.current;H(he,J),w.current=requestAnimationFrame(V)})}const D=()=>{cancelAnimationFrame(w.current),w.current=0,U.current=!1};v.useEffect(()=>()=>D(),[]);const ne=G=>{const{userSelectionRect:W,transform:oe,resetSelectedElements:he}=g.getState();if(!I.current||!W)return;const{x:J,y:ce}=cs(G.nativeEvent,I.current);P.current={x:J,y:ce};const Ce=Cl({x:W.startX,y:W.startY},oe);if(!Y.current){const Ee=t?0:i;if(Math.hypot(J-Ce.x,ce-Ce.y)<=Ee)return;he(),o==null||o(G)}Y.current=!0,U.current||(V(),U.current=!0),H(J,ce)},ee=G=>{var W,oe;G.button===0&&((oe=(W=G.target)==null?void 0:W.releasePointerCapture)==null||oe.call(W,G.pointerId),!E&&G.target===R.current&&g.getState().userSelectionRect&&(C==null||C(G)),g.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(l==null||l(G),g.setState({nodesSelectionActive:M.current.size>0})),D())},re=G=>{var W,oe;(oe=(W=G.target)==null?void 0:W.releasePointerCapture)==null||oe.call(W,G.pointerId),D()},de=r===!0||Array.isArray(r)&&r.includes(0);return c.jsxs("div",{className:xn(["react-flow__pane",{draggable:de,dragging:_,selection:e}]),onClick:N?void 0:O0(C,R),onContextMenu:O0(L,R),onWheel:O0(O,R),onPointerEnter:N?void 0:h,onPointerMove:N?ne:p,onPointerUp:N?ee:void 0,onPointerCancel:N?re:void 0,onPointerDownCapture:N?S:void 0,onClickCapture:N?j:void 0,onPointerLeave:m,ref:R,style:Km,children:[y,c.jsx(ele,{})]})}function W1({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=t.getState(),u=o.get(e);if(!u){l==null||l("012",gs.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):s([e])}function zD({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Qt(),[l,u]=v.useState(!1),d=v.useRef();return v.useEffect(()=>{d.current=Cae({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{W1({id:f,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),v.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,r,t,i,e,s,a]),l}const rle=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function VD(){const e=Qt();return v.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=rle(a),p=s?i[0]:5,m=s?i[1]:5,y=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,g]of u){if(!h(g))continue;let E={x:g.internals.positionAbsolute.x+y,y:g.internals.positionAbsolute.y+w};s&&(E=Pd(E,i));const{position:b,positionAbsolute:_}=sD({nodeId:g.id,nextPosition:E,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:o});g.position=b,g.internals.positionAbsolute=_,f.set(g.id,g)}l(f)},[])}const Jx=v.createContext(null),sle=Jx.Provider;Jx.Consumer;const KD=()=>v.useContext(Jx),ile=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ale=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:d,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:i===Nl.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:d&&u}};function ole({type:e="source",position:t=De.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:d,onTouchStart:f,...h},p){var U,C;const m=a||null,y=e==="target",w=Qt(),g=KD(),{connectOnClick:E,noPanClassName:b,rfId:_}=ft(ile,Xt),{connectingFrom:k,connectingTo:T,clickConnecting:A,isPossibleEndHandle:N,connectionInProcess:R,clickConnectionInProcess:I,valid:M}=ft(ale(g,m,e),Xt);g||(C=(U=w.getState()).onError)==null||C.call(U,"010",gs.error010());const B=L=>{const{defaultEdgeOptions:O,onConnect:j,hasDefaultEdges:S}=w.getState(),H={...O,...L};if(S){const{edges:V,setEdges:D,onError:ne}=w.getState();D(UD(H,V,{onError:ne}))}j==null||j(H),o==null||o(H)},Y=L=>{if(!g)return;const O=fD(L.nativeEvent);if(s&&(O&&L.button===0||!O)){const j=w.getState();Y1.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:y,handleId:m,nodeId:g,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...S)=>{var H,V;return(V=(H=w.getState()).onConnectEnd)==null?void 0:V.call(H,...S)},updateConnection:j.updateConnection,onConnect:B,isValidConnection:n||((...S)=>{var H,V;return((V=(H=w.getState()).isValidConnection)==null?void 0:V.call(H,...S))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}O?d==null||d(L):f==null||f(L)},P=L=>{const{onClickConnectStart:O,onClickConnectEnd:j,connectionClickStartHandle:S,connectionMode:H,isValidConnection:V,lib:D,rfId:ne,nodeLookup:ee,connection:re}=w.getState();if(!g||!S&&!s)return;if(!S){O==null||O(L.nativeEvent,{nodeId:g,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const de=uD(L.target),G=n||V,{connection:W,isValid:oe}=Y1.isValid(L.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:H,fromNodeId:S.nodeId,fromHandleId:S.id||null,fromType:S.type,isValidConnection:G,flowId:ne,doc:de,lib:D,nodeLookup:ee});oe&&W&&B(W);const he=structuredClone(re);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,j==null||j(L,he),w.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${_}-${g}-${m}-${e}`,className:xn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!y,target:y,connectable:r,connectablestart:s,connectableend:i,clickconnecting:A,connectingfrom:k,connectingto:T,valid:M,connectionindicator:r&&(!R||N)&&(R||I?i:s)}]),onMouseDown:Y,onTouchStart:Y,onClick:E?P:void 0,ref:p,...h,children:l})}const Ol=v.memo($D(ole));function lle({data:e,isConnectable:t,sourcePosition:n=De.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Ol,{type:"source",position:n,isConnectable:t})]})}function cle({data:e,isConnectable:t,targetPosition:n=De.Top,sourcePosition:r=De.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Ol,{type:"source",position:r,isConnectable:t})]})}function ule(){return null}function dle({data:e,isConnectable:t,targetPosition:n=De.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Fp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},aS={input:lle,default:cle,output:dle,group:ule};function fle(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const hle=e=>{const{width:t,height:n,x:r,y:s}=Dd(e.nodeLookup,{filter:i=>!!i.selected});return{width:ls(t)?t:null,height:ls(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function ple({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Qt(),{width:s,height:i,transformString:a,userSelectionActive:o}=ft(hle,Xt),l=VD(),u=v.useRef(null);v.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!o&&s!==null&&i!==null;if(zD({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(y=>y.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Fp,p.key)&&(p.preventDefault(),l({direction:Fp[p.key],factor:p.shiftKey?4:1}))};return c.jsx("div",{className:xn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:c.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:s,height:i}})})}const oS=typeof window<"u"?window:void 0,mle=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function YD({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:y,zoomActivationKeyCode:w,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:N,autoPanOnSelection:R,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:Y,preventScrolling:P,onSelectionContextMenu:U,noWheelClassName:C,noPanClassName:L,disableKeyboardA11y:O,onViewportChange:j,isControlledViewport:S}){const{nodesSelectionActive:H,userSelectionActive:V}=ft(mle,Xt),D=ed(u,{target:oS}),ne=ed(y,{target:oS}),ee=ne||N,re=ne||_,de=d&&ee!==!0,G=D||V||de;return Goe({deleteKeyCode:l,multiSelectionKeyCode:m}),c.jsx(Zoe,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:re,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!D&&ee,defaultViewport:I,translateExtent:M,minZoom:B,maxZoom:Y,zoomActivationKeyCode:w,preventScrolling:P,noWheelClassName:C,noPanClassName:L,onViewportChange:j,isControlledViewport:S,paneClickDistance:o,selectionOnDrag:de,children:c.jsxs(nle,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ee,autoPanOnSelection:R,isSelecting:!!G,selectionMode:f,selectionKeyPressed:D,paneClickDistance:o,selectionOnDrag:de,children:[e,H&&c.jsx(ple,{onSelectionContextMenu:U,noPanClassName:L,disableKeyboardA11y:O})]})})}YD.displayName="FlowRenderer";const gle=v.memo(YD),yle=e=>t=>e?zx(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function ble(e){return ft(v.useCallback(yle(e),[e]),Xt)}const Ele=e=>e.updateNodeInternals;function xle(){const e=ft(Ele),[t]=v.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return v.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function wle({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Qt(),i=v.useRef(null),a=v.useRef(null),o=v.useRef(e.sourcePosition),l=v.useRef(e.targetPosition),u=v.useRef(t),d=n&&!!e.internals.handleBounds;return v.useEffect(()=>{i.current&&!e.hidden&&(!d||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[d,e.hidden]),v.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),v.useEffect(()=>{if(i.current){const f=u.current!==t,h=o.current!==e.sourcePosition,p=l.current!==e.targetPosition;(f||h||p)&&(u.current=t,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function vle({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:y,nodeTypes:w,nodeClickDistance:g,onError:E}){const{node:b,internals:_,isParent:k}=ft(G=>{const W=G.nodeLookup.get(e),oe=G.parentLookup.has(e);return{node:W,internals:W.internals,isParent:oe}},Xt);let T=b.type||"default",A=(w==null?void 0:w[T])||aS[T];A===void 0&&(E==null||E("003",gs.error003(T)),T="default",A=(w==null?void 0:w.default)||aS.default);const N=!!(b.draggable||o&&typeof b.draggable>"u"),R=!!(b.selectable||l&&typeof b.selectable>"u"),I=!!(b.connectable||u&&typeof b.connectable>"u"),M=!!(b.focusable||d&&typeof b.focusable>"u"),B=Qt(),Y=lD(b),P=wle({node:b,nodeType:T,hasDimensions:Y,resizeObserver:f}),U=zD({nodeRef:P,disabled:b.hidden||!N,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:g}),C=VD();if(b.hidden)return null;const L=hi(b),O=fle(b),j=R||N||t||n||r||s,S=n?G=>n(G,{..._.userNode}):void 0,H=r?G=>r(G,{..._.userNode}):void 0,V=s?G=>s(G,{..._.userNode}):void 0,D=i?G=>i(G,{..._.userNode}):void 0,ne=a?G=>a(G,{..._.userNode}):void 0,ee=G=>{const{selectNodesOnDrag:W,nodeDragThreshold:oe}=B.getState();R&&(!W||!N||oe>0)&&W1({id:e,store:B,nodeRef:P}),t&&t(G,{..._.userNode})},re=G=>{if(!(dD(G.nativeEvent)||m)){if(J3.includes(G.key)&&R){const W=G.key==="Escape";W1({id:e,store:B,unselect:W,nodeRef:P})}else if(N&&b.selected&&Object.prototype.hasOwnProperty.call(Fp,G.key)){G.preventDefault();const{ariaLabelConfig:W}=B.getState();B.setState({ariaLiveMessage:W["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:Fp[G.key],factor:G.shiftKey?4:1})}}},de=()=>{var Ce;if(m||!((Ce=P.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:G,width:W,height:oe,autoPanOnNodeFocus:he,setCenter:J}=B.getState();if(!he)return;zx(new Map([[e,b]]),{x:0,y:0,width:W,height:oe},G,!0).length>0||J(b.position.x+L.width/2,b.position.y+L.height/2,{zoom:G[2]})};return c.jsx("div",{className:xn(["react-flow__node",`react-flow__node-${T}`,{[p]:N},b.className,{selected:b.selected,selectable:R,parent:k,draggable:N,dragging:U}]),ref:P,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:Y?"visible":"hidden",...b.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:S,onMouseMove:H,onMouseLeave:V,onContextMenu:D,onClick:ee,onDoubleClick:ne,onKeyDown:M?re:void 0,tabIndex:M?0:void 0,onFocus:M?de:void 0,role:b.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${MD}-${y}`,"aria-label":b.ariaLabel,...b.domAttributes,children:c.jsx(sle,{value:e,children:c.jsx(A,{id:e,data:b.data,type:T,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:b.selected??!1,selectable:R,draggable:N,deletable:b.deletable??!0,isConnectable:I,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:U,dragHandle:b.dragHandle,zIndex:_.z,parentId:b.parentId,...L})})})}var _le=v.memo(vle);const Tle=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function WD(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=ft(Tle,Xt),a=ble(e.onlyRenderVisibleElements),o=xle();return c.jsx("div",{className:"react-flow__nodes",style:Km,children:a.map(l=>c.jsx(_le,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}WD.displayName="NodeRenderer";const kle=v.memo(WD);function Nle(e){return ft(v.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const i=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);i&&a&&uae({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Xt)}const Sle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Ale=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},lS={[Qu.Arrow]:Sle,[Qu.ArrowClosed]:Ale};function Cle(e){const t=Qt();return v.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(lS,e)?lS[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",gs.error009(e)),null)},[e])}const Ile=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=Cle(t);return l?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:c.jsx(l,{color:n,strokeWidth:a})}):null},qD=({defaultColor:e,rfId:t})=>{const n=ft(i=>i.edges),r=ft(i=>i.defaultEdgeOptions),s=v.useMemo(()=>bae(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:s.map(i=>c.jsx(Ile,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};qD.displayName="MarkerDefinitions";var Rle=v.memo(qD);function GD({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,...d}){const[f,h]=v.useState({x:1,y:0,width:0,height:0}),p=xn(["react-flow__edge-textwrapper",u]),m=v.useRef(null);return v.useEffect(()=>{if(m.current){const y=m.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&c.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),c.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),l]}):null}GD.displayName="EdgeText";const Ole=v.memo(GD);function Ym({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...d,d:e,fill:"none",className:xn(["react-flow__edge-path",d.className])}),u?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ls(t)&&ls(n)?c.jsx(Ole,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function cS({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===De.Left||e===De.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function XD({sourceX:e,sourceY:t,sourcePosition:n=De.Bottom,targetX:r,targetY:s,targetPosition:i=De.Top}){const[a,o]=cS({pos:n,x1:e,y1:t,x2:r,y2:s}),[l,u]=cS({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=hD({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${o} ${l},${u} ${r},${s}`,d,f,h,p]}function QD(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:g})=>{const[E,b,_]=XD({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),k=e.isInternal?void 0:t;return c.jsx(Ym,{id:k,path:E,labelX:b,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:g})})}const Lle=QD({isInternal:!1}),ZD=QD({isInternal:!0});Lle.displayName="SimpleBezierEdge";ZD.displayName="SimpleBezierEdgeInternal";function JD(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=De.Bottom,targetPosition:m=De.Top,markerEnd:y,markerStart:w,pathOptions:g,interactionWidth:E})=>{const[b,_,k]=z1({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),T=e.isInternal?void 0:t;return c.jsx(Ym,{id:T,path:b,labelX:_,labelY:k,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:w,interactionWidth:E})})}const eP=JD({isInternal:!1}),tP=JD({isInternal:!0});eP.displayName="SmoothStepEdge";tP.displayName="SmoothStepEdgeInternal";function nP(e){return v.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return c.jsx(eP,{...n,id:r,pathOptions:v.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Mle=nP({isInternal:!1}),rP=nP({isInternal:!0});Mle.displayName="StepEdge";rP.displayName="StepEdgeInternal";function sP(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})=>{const[w,g,E]=gD({sourceX:n,sourceY:r,targetX:s,targetY:i}),b=e.isInternal?void 0:t;return c.jsx(Ym,{id:b,path:w,labelX:g,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})})}const Dle=sP({isInternal:!1}),iP=sP({isInternal:!0});Dle.displayName="StraightEdge";iP.displayName="StraightEdgeInternal";function aP(e){return v.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=De.Bottom,targetPosition:o=De.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,pathOptions:g,interactionWidth:E})=>{const[b,_,k]=pD({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:g==null?void 0:g.curvature}),T=e.isInternal?void 0:t;return c.jsx(Ym,{id:T,path:b,labelX:_,labelY:k,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:w,interactionWidth:E})})}const Ple=aP({isInternal:!1}),oP=aP({isInternal:!0});Ple.displayName="BezierEdge";oP.displayName="BezierEdgeInternal";const uS={default:oP,straight:iP,step:rP,smoothstep:tP,simplebezier:ZD},dS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},jle=(e,t,n)=>n===De.Left?e-t:n===De.Right?e+t:e,Ble=(e,t,n)=>n===De.Top?e-t:n===De.Bottom?e+t:e,fS="react-flow__edgeupdater";function hS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return c.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:xn([fS,`${fS}-${o}`]),cx:jle(t,r,e),cy:Ble(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Fle({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Qt(),y=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:T,domNode:A,connectionMode:N,connectionRadius:R,lib:I,onConnectStart:M,cancelConnection:B,nodeLookup:Y,rfId:P,panBy:U,updateConnection:C}=m.getState(),L=k.type==="target",O=(H,V)=>{h(!1),f==null||f(H,n,k.type,V)},j=H=>u==null?void 0:u(n,H),S=(H,V)=>{h(!0),d==null||d(_,n,k.type),M==null||M(H,V)};Y1.onPointerDown(_.nativeEvent,{autoPanOnConnect:T,connectionMode:N,connectionRadius:R,domNode:A,handleId:k.id,nodeId:k.nodeId,nodeLookup:Y,isTarget:L,edgeUpdaterType:k.type,lib:I,flowId:P,cancelConnection:B,panBy:U,isValidConnection:(...H)=>{var V,D;return((D=(V=m.getState()).isValidConnection)==null?void 0:D.call(V,...H))??!0},onConnect:j,onConnectStart:S,onConnectEnd:(...H)=>{var V,D;return(D=(V=m.getState()).onConnectEnd)==null?void 0:D.call(V,...H)},onReconnectEnd:O,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>y(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=_=>y(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>p(!0),b=()=>p(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(hS,{position:o,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:E,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&c.jsx(hS,{position:l,centerX:i,centerY:a,radius:t,onMouseDown:g,onMouseEnter:E,onMouseOut:b,type:"target"})]})}function Ule({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:y,noPanClassName:w,onError:g,disableKeyboardA11y:E}){let b=ft(J=>J.edgeLookup.get(e));const _=ft(J=>J.defaultEdgeOptions);b=_?{..._,...b}:b;let k=b.type||"default",T=(y==null?void 0:y[k])||uS[k];T===void 0&&(g==null||g("011",gs.error011(k)),k="default",T=(y==null?void 0:y.default)||uS.default);const A=!!(b.focusable||t&&typeof b.focusable>"u"),N=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),R=!!(b.selectable||r&&typeof b.selectable>"u"),I=v.useRef(null),[M,B]=v.useState(!1),[Y,P]=v.useState(!1),U=Qt(),{zIndex:C,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V}=ft(v.useCallback(J=>{const ce=J.nodeLookup.get(b.source),Ce=J.nodeLookup.get(b.target);if(!ce||!Ce)return{zIndex:b.zIndex,...dS};const Ee=yae({id:e,sourceNode:ce,targetNode:Ce,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:J.connectionMode,onError:g});return{zIndex:cae({selected:b.selected,zIndex:b.zIndex,sourceNode:ce,targetNode:Ce,elevateOnSelect:J.elevateEdgesOnSelect,zIndexMode:J.zIndexMode}),...Ee||dS}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Xt),D=v.useMemo(()=>b.markerStart?`url('#${V1(b.markerStart,m)}')`:void 0,[b.markerStart,m]),ne=v.useMemo(()=>b.markerEnd?`url('#${V1(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||L===null||O===null||j===null||S===null)return null;const ee=J=>{var ge;const{addSelectedEdges:ce,unselectNodesAndEdges:Ce,multiSelectionActive:Ee}=U.getState();R&&(U.setState({nodesSelectionActive:!1}),b.selected&&Ee?(Ce({nodes:[],edges:[b]}),(ge=I.current)==null||ge.blur()):ce([e])),s&&s(J,b)},re=i?J=>{i(J,{...b})}:void 0,de=a?J=>{a(J,{...b})}:void 0,G=o?J=>{o(J,{...b})}:void 0,W=l?J=>{l(J,{...b})}:void 0,oe=u?J=>{u(J,{...b})}:void 0,he=J=>{var ce;if(!E&&J3.includes(J.key)&&R){const{unselectNodesAndEdges:Ce,addSelectedEdges:Ee}=U.getState();J.key==="Escape"?((ce=I.current)==null||ce.blur(),Ce({edges:[b]})):Ee([e])}};return c.jsx("svg",{style:{zIndex:C},children:c.jsxs("g",{className:xn(["react-flow__edge",`react-flow__edge-${k}`,b.className,w,{selected:b.selected,animated:b.animated,inactive:!R&&!s,updating:M,selectable:R}]),onClick:ee,onDoubleClick:re,onContextMenu:de,onMouseEnter:G,onMouseMove:W,onMouseLeave:oe,onKeyDown:A?he:void 0,tabIndex:A?0:void 0,role:b.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":A?`${DD}-${m}`:void 0,ref:I,...b.domAttributes,children:[!Y&&c.jsx(T,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:R,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:D,markerEnd:ne,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),N&&c.jsx(Fle,{edge:b,isReconnectable:N,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:L,sourceY:O,targetX:j,targetY:S,sourcePosition:H,targetPosition:V,setUpdateHover:B,setReconnecting:P})]})})}var $le=v.memo(Ule);const Hle=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function lP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:y}){const{edgesFocusable:w,edgesReconnectable:g,elementsSelectable:E,onError:b}=ft(Hle,Xt),_=Nle(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(Rle,{defaultColor:e,rfId:n}),_.map(k=>c.jsx($le,{id:k,edgesFocusable:w,edgesReconnectable:g,elementsSelectable:E,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:y},k))]})}lP.displayName="EdgeRenderer";const zle=v.memo(lP),Vle=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Kle({children:e}){const t=ft(Vle);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Yle(e){const t=Zx(),n=v.useRef(!1);v.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Wle=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function qle(e){const t=ft(Wle),n=Qt();return v.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Gle(e){return e.connection.inProgress?{...e.connection,to:Zl(e.connection.to,e.transform)}:{...e.connection}}function Xle(e){return Gle}function Qle(e){const t=Xle();return ft(t,Xt)}const Zle=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Jle({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=ft(Zle,Xt);return!(i&&s&&l)?null:c.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:xn(["react-flow__connection",nD(o)]),children:c.jsx(cP,{style:t,type:n,CustomComponent:r,isValid:o})})})}const cP=({style:e,type:t=Ci.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Qle();if(!s)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:h,connectionStatus:nD(r),toNode:d,toHandle:f,pointer:p});let m="";const y={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ci.Bezier:[m]=pD(y);break;case Ci.SimpleBezier:[m]=XD(y);break;case Ci.Step:[m]=z1({...y,borderRadius:0});break;case Ci.SmoothStep:[m]=z1(y);break;default:[m]=gD(y)}return c.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};cP.displayName="ConnectionLine";const ece={};function pS(e=ece){v.useRef(e),Qt(),v.useEffect(()=>{},[e])}function tce(){Qt(),v.useRef(!1),v.useEffect(()=>{},[])}function uP({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:y,connectionLineComponent:w,connectionLineContainerStyle:g,selectionKeyCode:E,selectionOnDrag:b,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:N,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:M,translateExtent:B,minZoom:Y,maxZoom:P,preventScrolling:U,defaultMarkerColor:C,zoomOnScroll:L,zoomOnPinch:O,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:H,zoomOnDoubleClick:V,panOnDrag:D,autoPanOnSelection:ne,onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:de,onPaneMouseLeave:G,onPaneScroll:W,onPaneContextMenu:oe,paneClickDistance:he,nodeClickDistance:J,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:ge,reconnectRadius:Le,onReconnect:ve,onReconnectStart:Ue,onReconnectEnd:Ie,noDragClassName:ae,noWheelClassName:wt,noPanClassName:we,disableKeyboardA11y:vt,nodeExtent:ct,rfId:K,viewport:X,onViewportChange:le}){return pS(e),pS(t),tce(),Yle(n),qle(X),c.jsx(gle,{onPaneClick:ee,onPaneMouseEnter:re,onPaneMouseMove:de,onPaneMouseLeave:G,onPaneContextMenu:oe,onPaneScroll:W,paneClickDistance:he,deleteKeyCode:N,selectionKeyCode:E,selectionOnDrag:b,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:I,zoomOnScroll:L,zoomOnPinch:O,zoomOnDoubleClick:V,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:H,panOnDrag:D,autoPanOnSelection:ne,defaultViewport:M,translateExtent:B,minZoom:Y,maxZoom:P,onSelectionContextMenu:f,preventScrolling:U,noDragClassName:ae,noWheelClassName:wt,noPanClassName:we,disableKeyboardA11y:vt,onViewportChange:le,isControlledViewport:!!X,children:c.jsxs(Kle,{children:[c.jsx(zle,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:ve,onReconnectStart:Ue,onReconnectEnd:Ie,onlyRenderVisibleElements:R,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:ge,reconnectRadius:Le,defaultMarkerColor:C,noPanClassName:we,disableKeyboardA11y:vt,rfId:K}),c.jsx(Jle,{style:y,type:m,component:w,containerStyle:g}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(kle,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:J,onlyRenderVisibleElements:R,noPanClassName:we,noDragClassName:ae,disableKeyboardA11y:vt,nodeExtent:ct,rfId:K}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}uP.displayName="GraphView";const nce=v.memo(uP),rce=oD(),mS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,y=new Map,w=new Map,g=r??t??[],E=n??e??[],b=d??[0,0],_=f??Gu;ED(y,w,g);const{nodesInitialized:k}=K1(E,p,m,{nodeOrigin:b,nodeExtent:_,zIndexMode:h});let T=[0,0,1];if(a&&s&&i){const A=Dd(p,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:N,y:R,zoom:I}=Kx(A,s,i,l,u,(o==null?void 0:o.padding)??.1);T=[N,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:T,nodes:E,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:w,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Gu,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Nl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...tD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:rce,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:eD,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},sce=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>xoe((p,m)=>{async function y(){const{nodeLookup:w,panZoom:g,fitViewOptions:E,fitViewResolver:b,width:_,height:k,minZoom:T,maxZoom:A}=m();g&&(await nae({nodes:w,width:_,height:k,panZoom:g,minZoom:T,maxZoom:A},E),b==null||b.resolve(!0),p({fitViewResolver:null}))}return{...mS({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:g,parentLookup:E,nodeOrigin:b,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:T,nodesSelectionActive:A}=m(),{nodesInitialized:N,hasSelectedNodes:R}=K1(w,g,E,{nodeOrigin:b,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:T}),I=A&&R;k&&N?(y(),p({nodes:w,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:N,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:g,edgeLookup:E}=m();ED(g,E,w),p({edges:w})},setDefaultNodesAndEdges:(w,g)=>{if(w){const{setNodes:E}=m();E(w),p({hasDefaultNodes:!0})}if(g){const{setEdges:E}=m();E(g),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:g,nodeLookup:E,parentLookup:b,domNode:_,nodeOrigin:k,nodeExtent:T,debug:A,fitViewQueued:N,zIndexMode:R}=m(),{changes:I,updatedInternals:M}=kae(w,E,b,_,k,T,R);M&&(wae(E,b,{nodeOrigin:k,nodeExtent:T,zIndexMode:R}),N?(y(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(A&&console.log("React Flow: trigger node changes",I),g==null||g(I)))},updateNodePositions:(w,g=!1)=>{const E=[];let b=[];const{nodeLookup:_,triggerNodeChanges:k,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:N}=m();for(const[R,I]of w){const M=_.get(R),B=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(I!=null&&I.position)),Y={id:R,type:"position",position:B?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:g};if(M&&T.inProgress&&T.fromNode.id===M.id){const P=Qa(M,T.fromHandle,De.Left,!0);A({...T,from:P})}B&&M.parentId&&E.push({id:R,parentId:M.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),b.push(Y)}if(E.length>0){const{parentLookup:R,nodeOrigin:I}=m(),M=Qx(E,_,R,I);b.push(...M)}for(const R of N.values())b=R(b);k(b)},triggerNodeChanges:w=>{const{onNodesChange:g,setNodes:E,nodes:b,hasDefaultNodes:_,debug:k}=m();if(w!=null&&w.length){if(_){const T=BD(w,b);E(T)}k&&console.log("React Flow: trigger node changes",w),g==null||g(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:g,setEdges:E,edges:b,hasDefaultEdges:_,debug:k}=m();if(w!=null&&w.length){if(_){const T=FD(w,b);E(T)}k&&console.log("React Flow: trigger edge changes",w),g==null||g(w)}},addSelectedNodes:w=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(g){const T=w.map(A=>ya(A,!0));_(T);return}_(Ko(b,new Set([...w]),!0)),k(Ko(E))},addSelectedEdges:w=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(g){const T=w.map(A=>ya(A,!0));k(T);return}k(Ko(E,new Set([...w]))),_(Ko(b,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:g}={})=>{const{edges:E,nodes:b,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:T}=m(),A=w||b,N=g||E,R=[];for(const M of A){if(!M.selected)continue;const B=_.get(M.id);B&&(B.selected=!1),R.push(ya(M.id,!1))}const I=[];for(const M of N)M.selected&&I.push(ya(M.id,!1));k(R),T(I)},setMinZoom:w=>{const{panZoom:g,maxZoom:E}=m();g==null||g.setScaleExtent([w,E]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:g,minZoom:E}=m();g==null||g.setScaleExtent([E,w]),p({maxZoom:w})},setTranslateExtent:w=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:g,triggerNodeChanges:E,triggerEdgeChanges:b,elementsSelectable:_}=m();if(!_)return;const k=g.reduce((A,N)=>N.selected?[...A,ya(N.id,!1)]:A,[]),T=w.reduce((A,N)=>N.selected?[...A,ya(N.id,!1)]:A,[]);E(k),b(T)},setNodeExtent:w=>{const{nodes:g,nodeLookup:E,parentLookup:b,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:T,zIndexMode:A}=m();w[0][0]===T[0][0]&&w[0][1]===T[0][1]&&w[1][0]===T[1][0]&&w[1][1]===T[1][1]||(K1(g,E,b,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:A}),p({nodeExtent:w}))},panBy:w=>{const{transform:g,width:E,height:b,panZoom:_,translateExtent:k}=m();return Nae({delta:w,panZoom:_,transform:g,translateExtent:k,width:E,height:b})},setCenter:async(w,g,E)=>{const{width:b,height:_,maxZoom:k,panZoom:T}=m();if(!T)return!1;const A=typeof(E==null?void 0:E.zoom)<"u"?E.zoom:k;return await T.setViewport({x:b/2-w*A,y:_/2-g*A,zoom:A},{duration:E==null?void 0:E.duration,ease:E==null?void 0:E.ease,interpolate:E==null?void 0:E.interpolate}),!0},cancelConnection:()=>{p({connection:{...tD}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...mS()})}},Object.is);function dP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=v.useState(()=>sce({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return c.jsx(woe,{value:m,children:c.jsx(Koe,{children:p})})}function ice({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return v.useContext(zm)?c.jsx(c.Fragment,{children:e}):c.jsx(dP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const ace={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function oce({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:g,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:N,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:M,onDelete:B,onSelectionChange:Y,onSelectionDragStart:P,onSelectionDrag:U,onSelectionDragStop:C,onSelectionContextMenu:L,onSelectionStart:O,onSelectionEnd:j,onBeforeDelete:S,connectionMode:H,connectionLineType:V=Ci.Bezier,connectionLineStyle:D,connectionLineComponent:ne,connectionLineContainerStyle:ee,deleteKeyCode:re="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:G=!1,selectionMode:W=Xu.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:he=Ju()?"Meta":"Control",zoomActivationKeyCode:J=Ju()?"Meta":"Control",snapToGrid:ce,snapGrid:Ce,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:ge,nodesDraggable:Le,autoPanOnNodeFocus:ve,nodesConnectable:Ue,nodesFocusable:Ie,nodeOrigin:ae=PD,edgesFocusable:wt,edgesReconnectable:we,elementsSelectable:vt=!0,defaultViewport:ct=Moe,minZoom:K=.5,maxZoom:X=2,translateExtent:le=Gu,preventScrolling:ke=!0,nodeExtent:Re,defaultMarkerColor:ut="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:ot=!0,panOnScroll:Zt=!1,panOnScrollSpeed:Ct=.5,panOnScrollMode:Ge=Da.Free,zoomOnDoubleClick:Et=!0,panOnDrag:Ht=!0,onPaneClick:kn,onPaneMouseEnter:Fe,onPaneMouseMove:rt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:ue,paneClickDistance:Oe=1,nodeClickDistance:Qe=0,children:cn,onReconnect:an,onReconnectStart:ie,onReconnectEnd:_e,onEdgeContextMenu:ye,onEdgeDoubleClick:Pe,onEdgeMouseEnter:$e,onEdgeMouseMove:qe,onEdgeMouseLeave:gt,reconnectRadius:It=10,onNodesChange:Rt,onEdgesChange:gn,noDragClassName:yn="nodrag",noWheelClassName:zt="nowheel",noPanClassName:Nn="nopan",fitView:Jn,fitViewOptions:_r,connectOnClick:Dn,attributionPosition:Hn,proOptions:er,defaultEdgeOptions:Tr,elevateNodesOnSelect:Vt=!0,elevateEdgesOnSelect:Sn=!1,disableKeyboardA11y:Pn=!1,autoPanOnConnect:tr,autoPanOnNodeDrag:zn,autoPanOnSelection:An=!0,autoPanSpeed:st,connectionRadius:Cn,isValidConnection:Bt,onError:Jt,style:In,id:jn,nodeDragThreshold:wn,connectionDragThreshold:nr,viewport:Ot,onViewportChange:Z,width:Ne,height:Me,colorMode:He="light",debug:Lt,onScroll:yt,ariaLabelConfig:Kt,zIndexMode:Nt="basic",...fr},St){const ra=jn||"1",Jl=Boe(He),ec=v.useCallback(Bd=>{Bd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),yt==null||yt(Bd)},[yt]);return c.jsx("div",{"data-testid":"rf__wrapper",...fr,onScroll:ec,style:{...In,...ace},ref:St,className:xn(["react-flow",s,Jl]),id:jn,role:"application",children:c.jsxs(ice,{nodes:e,edges:t,width:Ne,height:Me,fitView:Jn,fitViewOptions:_r,minZoom:K,maxZoom:X,nodeOrigin:ae,nodeExtent:Re,zIndexMode:Nt,children:[c.jsx(joe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:g,nodesDraggable:Le,autoPanOnNodeFocus:ve,nodesConnectable:Ue,nodesFocusable:Ie,edgesFocusable:wt,edgesReconnectable:we,elementsSelectable:vt,elevateNodesOnSelect:Vt,elevateEdgesOnSelect:Sn,minZoom:K,maxZoom:X,nodeExtent:Re,onNodesChange:Rt,onEdgesChange:gn,snapToGrid:ce,snapGrid:Ce,connectionMode:H,translateExtent:le,connectOnClick:Dn,defaultEdgeOptions:Tr,fitView:Jn,fitViewOptions:_r,onNodesDelete:I,onEdgesDelete:M,onDelete:B,onNodeDragStart:A,onNodeDrag:N,onNodeDragStop:R,onSelectionDrag:U,onSelectionDragStart:P,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:Nn,nodeOrigin:ae,rfId:ra,autoPanOnConnect:tr,autoPanOnNodeDrag:zn,autoPanSpeed:st,onError:Jt,connectionRadius:Cn,isValidConnection:Bt,selectNodesOnDrag:ge,nodeDragThreshold:wn,connectionDragThreshold:nr,onBeforeDelete:S,debug:Lt,ariaLabelConfig:Kt,zIndexMode:Nt}),c.jsx(nce,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:a,connectionLineType:V,connectionLineStyle:D,connectionLineComponent:ne,connectionLineContainerStyle:ee,selectionKeyCode:de,selectionOnDrag:G,selectionMode:W,deleteKeyCode:re,multiSelectionKeyCode:he,panActivationKeyCode:oe,zoomActivationKeyCode:J,onlyRenderVisibleElements:Ee,defaultViewport:ct,translateExtent:le,minZoom:K,maxZoom:X,preventScrolling:ke,zoomOnScroll:We,zoomOnPinch:ot,zoomOnDoubleClick:Et,panOnScroll:Zt,panOnScrollSpeed:Ct,panOnScrollMode:Ge,panOnDrag:Ht,autoPanOnSelection:An,onPaneClick:kn,onPaneMouseEnter:Fe,onPaneMouseMove:rt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:ue,paneClickDistance:Oe,nodeClickDistance:Qe,onSelectionContextMenu:L,onSelectionStart:O,onSelectionEnd:j,onReconnect:an,onReconnectStart:ie,onReconnectEnd:_e,onEdgeContextMenu:ye,onEdgeDoubleClick:Pe,onEdgeMouseEnter:$e,onEdgeMouseMove:qe,onEdgeMouseLeave:gt,reconnectRadius:It,defaultMarkerColor:ut,noDragClassName:yn,noWheelClassName:zt,noPanClassName:Nn,rfId:ra,disableKeyboardA11y:Pn,nodeExtent:Re,viewport:Ot,onViewportChange:Z}),c.jsx(Loe,{onSelectionChange:Y}),cn,c.jsx(Aoe,{proOptions:er,position:Hn}),c.jsx(Soe,{rfId:ra,disableKeyboardA11y:Pn})]})})}var lce=$D(oce);function cce(e){const[t,n]=v.useState(e),r=v.useCallback(s=>n(i=>BD(s,i)),[]);return[t,n,r]}function uce(e){const[t,n]=v.useState(e),r=v.useCallback(s=>n(i=>FD(s,i)),[]);return[t,n,r]}function dce({dimensions:e,lineWidth:t,variant:n,className:r}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xn(["react-flow__background-pattern",n,r])})}function fce({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:xn(["react-flow__background-pattern","dots",t])})}var Ki;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ki||(Ki={}));const hce={[Ki.Dots]:1,[Ki.Lines]:1,[Ki.Cross]:6},pce=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function fP({id:e,variant:t=Ki.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:d}){const f=v.useRef(null),{transform:h,patternId:p}=ft(pce,Xt),m=r||hce[t],y=t===Ki.Dots,w=t===Ki.Cross,g=Array.isArray(n)?n:[n,n],E=[g[0]*h[2]||1,g[1]*h[2]||1],b=m*h[2],_=Array.isArray(i)?i:[i,i],k=w?[b,b]:E,T=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],A=`${p}${e||""}`;return c.jsxs("svg",{className:xn(["react-flow__background",u]),style:{...l,...Km,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[c.jsx("pattern",{id:A,x:h[0]%E[0],y:h[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:y?c.jsx(fce,{radius:b/2,className:d}):c.jsx(dce,{dimensions:k,lineWidth:s,variant:t,className:d})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}fP.displayName="Background";const mce=v.memo(fP);function gce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function yce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function bce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Ece(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function xce(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Kf({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:xn(["react-flow__controls-button",t]),...n,children:e})}const wce=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function hP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Qt(),{isInteractive:y,minZoomReached:w,maxZoomReached:g,ariaLabelConfig:E}=ft(wce,Xt),{zoomIn:b,zoomOut:_,fitView:k}=Zx(),T=()=>{b(),i==null||i()},A=()=>{_(),a==null||a()},N=()=>{k(s),o==null||o()},R=()=>{m.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),l==null||l(!y)},I=h==="horizontal"?"horizontal":"vertical";return c.jsxs(Vm,{className:xn(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??E["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(Kf,{onClick:T,className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:g,children:c.jsx(gce,{})}),c.jsx(Kf,{onClick:A,className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:w,children:c.jsx(yce,{})})]}),n&&c.jsx(Kf,{className:"react-flow__controls-fitview",onClick:N,title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:c.jsx(bce,{})}),r&&c.jsx(Kf,{className:"react-flow__controls-interactive",onClick:R,title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:y?c.jsx(xce,{}):c.jsx(Ece,{})}),d]})}hP.displayName="Controls";const vce=v.memo(hP);function _ce({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:y}=i||{},w=a||m||y;return c.jsx("rect",{className:xn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:o,strokeWidth:l},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const Tce=v.memo(_ce),kce=e=>e.nodes.map(t=>t.id),L0=e=>e instanceof Function?e:()=>e;function Nce({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=Tce,onClick:a}){const o=ft(kce,Xt),l=L0(t),u=L0(e),d=L0(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:o.map(h=>c.jsx(Ace,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Sce({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:d,y:f,width:h,height:p}=ft(m=>{const y=m.nodeLookup.get(e);if(!y)return{node:void 0,x:0,y:0,width:0,height:0};const w=y.internals.userNode,{x:g,y:E}=y.internals.positionAbsolute,{width:b,height:_}=hi(w);return{node:w,x:g,y:E,width:b,height:_}},Xt);return!u||u.hidden||!lD(u)?null:c.jsx(o,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:s,strokeColor:n(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const Ace=v.memo(Sce);var Cce=v.memo(Nce);const Ice=200,Rce=150,Oce=e=>!e.hidden,Lce=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?aD(Dd(e.nodeLookup,{filter:Oce}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Mce="react-flow__minimap-desc";function pP({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:y=!1,zoomable:w=!1,ariaLabel:g,inversePan:E,zoomStep:b=1,offsetScale:_=5}){const k=Qt(),T=v.useRef(null),{boundingRect:A,viewBB:N,rfId:R,panZoom:I,translateExtent:M,flowWidth:B,flowHeight:Y,ariaLabelConfig:P}=ft(Lce,Xt),U=(e==null?void 0:e.width)??Ice,C=(e==null?void 0:e.height)??Rce,L=A.width/U,O=A.height/C,j=Math.max(L,O),S=j*U,H=j*C,V=_*j,D=A.x-(S-A.width)/2-V,ne=A.y-(H-A.height)/2-V,ee=S+V*2,re=H+V*2,de=`${Mce}-${R}`,G=v.useRef(0),W=v.useRef();G.current=j,v.useEffect(()=>{if(T.current&&I)return W.current=Dae({domNode:T.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>G.current}),()=>{var ce;(ce=W.current)==null||ce.destroy()}},[I]),v.useEffect(()=>{var ce;(ce=W.current)==null||ce.update({translateExtent:M,width:B,height:Y,inversePan:E,pannable:y,zoomStep:b,zoomable:w})},[y,w,E,b,M,B,Y]);const oe=p?ce=>{var ge;const[Ce,Ee]=((ge=W.current)==null?void 0:ge.pointer(ce))||[0,0];p(ce,{x:Ce,y:Ee})}:void 0,he=m?v.useCallback((ce,Ce)=>{const Ee=k.getState().nodeLookup.get(Ce).internals.userNode;m(ce,Ee)},[]):void 0,J=g??P["minimap.ariaLabel"];return c.jsx(Vm,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*j:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:xn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:U,height:C,viewBox:`${D} ${ne} ${ee} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:T,onClick:oe,children:[J&&c.jsx("title",{id:de,children:J}),c.jsx(Cce,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${D-V},${ne-V}h${ee+V*2}v${re+V*2}h${-ee-V*2}z + M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}pP.displayName="MiniMap";const Dce=v.memo(pP),Pce=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,jce={[Il.Line]:"right",[Il.Handle]:"bottom-right"};function Bce({nodeId:e,position:t,variant:n=Il.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:y,onResize:w,onResizeEnd:g}){const E=KD(),b=typeof e=="string"?e:E,_=Qt(),k=v.useRef(null),T=n===Il.Handle,A=ft(v.useCallback(Pce(T&&p),[T,p]),Xt),N=v.useRef(null),R=t??jce[n];v.useEffect(()=>{if(!(!k.current||!b))return N.current||(N.current=qae({domNode:k.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:M,transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U,domNode:C}=_.getState();return{nodeLookup:M,transform:B,snapGrid:Y,snapToGrid:P,nodeOrigin:U,paneDomNode:C}},onChange:(M,B)=>{const{triggerNodeChanges:Y,nodeLookup:P,parentLookup:U,nodeOrigin:C}=_.getState(),L=[],O={x:M.x,y:M.y},j=P.get(b);if(j&&j.expandParent&&j.parentId){const S=j.origin??C,H=M.width??j.measured.width??0,V=M.height??j.measured.height??0,D={id:j.id,parentId:j.parentId,rect:{width:H,height:V,...cD({x:M.x??j.position.x,y:M.y??j.position.y},{width:H,height:V},j.parentId,P,S)}},ne=Qx([D],P,U,C);L.push(...ne),O.x=M.x?Math.max(S[0]*H,M.x):void 0,O.y=M.y?Math.max(S[1]*V,M.y):void 0}if(O.x!==void 0&&O.y!==void 0){const S={id:b,type:"position",position:{...O}};L.push(S)}if(M.width!==void 0&&M.height!==void 0){const H={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};L.push(H)}for(const S of B){const H={...S,type:"position"};L.push(H)}Y(L)},onEnd:({width:M,height:B})=>{const Y={id:b,type:"dimensions",resizing:!1,dimensions:{width:M,height:B}};_.getState().triggerNodeChanges([Y])}})),N.current.update({controlPosition:R,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:y,onResize:w,onResizeEnd:g,shouldResize:m}),()=>{var M;(M=N.current)==null||M.destroy()}},[R,o,l,u,d,f,y,w,g,m]);const I=R.split("-");return c.jsx("div",{className:xn(["react-flow__resize-control","nodrag",...I,n,r]),ref:k,style:{...s,scale:A,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:i})}v.memo(Bce);const Fce=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:kF},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:sF},{type:"loop",label:"循环",desc:"节点循环执行",Icon:AE}];let q1=0;function M0(){return q1+=1,`node_${q1}`}function D0(e,t,n){const r=Xi();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function Uce({data:e,selected:t}){const n=e.agent;return c.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[c.jsx(Ol,{type:"target",position:De.Left,className:"wfb-handle"}),c.jsx("div",{className:"wfb-node-icon",children:c.jsx(Ha,{className:"icon"})}),c.jsxs("div",{className:"wfb-node-body",children:[c.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),c.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),c.jsx(Ol,{type:"source",position:De.Right,className:"wfb-handle"})]})}const $ce={agentNode:Uce},gS={type:"smoothstep",markerEnd:{type:Qu.ArrowClosed,width:16,height:16}};function Hce({onBack:e,onCreate:t}){const n=v.useRef(null),[r,s]=v.useState(""),[i,a]=v.useState(""),[o,l]=v.useState("sequential"),u=v.useMemo(()=>{q1=0;const C=M0();return D0(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=cce([u]),[p,m,y]=uce([]),[w,g]=v.useState(u.id),E=d.find(C=>C.id===w)??null,b=r.trim()||"workflow_agent",_=v.useMemo(()=>d3({name:b,subAgents:d.map(C=>C.data.agent)}),[b,d]),k=nl(b)??(_.has(b)?"名称须与 Agent 节点名称保持唯一":null),T=E?nl(E.data.agent.name)??(_.has(E.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,A=d.length>0&&k===null&&d.every(C=>nl(C.data.agent.name)===null&&!_.has(C.data.agent.name)),N=v.useCallback(C=>m(L=>UD({...C,...gS},L)),[m]),R=v.useCallback(()=>{const C=M0(),L=d.length*28,O=D0(C,{x:80+L,y:120+L});f(j=>j.concat(O)),g(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},M=v.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),B=v.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const O=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),j=M0(),S=D0(j,O);f(H=>H.concat(S)),g(j)},[f]),Y=v.useCallback(C=>{w&&f(L=>L.map(O=>O.id===w?{...O,data:{...O.data,agent:{...O.data.agent,...C}}}:O))},[w,f]),P=v.useCallback(()=>{w&&(f(C=>C.filter(L=>L.id!==w)),m(C=>C.filter(L=>L.source!==w&&L.target!==w)),g(null))},[w,f,m]),U=v.useCallback(()=>{if(!A)return;const C=d.map(O=>O.data.agent),L={...Xi(),name:b,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:o,nodes:d.map(O=>({id:O.id,agent:O.data.agent})),edges:p.map(O=>({from:O.source,to:O.target}))}};t(L)},[A,d,p,b,i,o,t]);return c.jsx("div",{className:"wfb",children:c.jsxs("div",{className:"wfb-grid",children:[c.jsxs("aside",{className:"wfb-palette",children:[c.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"名称"}),c.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),k&&c.jsx("span",{className:"wfb-field-error",children:k})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"描述"}),c.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),c.jsx("div",{className:"wfb-section-label",children:"执行方式"}),c.jsx("div",{className:"wfb-types",children:Fce.map(({type:C,label:L,desc:O,Icon:j})=>c.jsxs("button",{type:"button",className:`wfb-type ${o===C?"wfb-type--active":""}`,onClick:()=>l(C),children:[c.jsx(j,{className:"icon"}),c.jsxs("span",{className:"wfb-type-text",children:[c.jsx("span",{className:"wfb-type-name",children:L}),c.jsx("span",{className:"wfb-type-desc",children:O})]})]},C))}),c.jsx("div",{className:"wfb-section-label",children:"节点"}),c.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[c.jsx(xF,{className:"icon wfb-grip"}),c.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:c.jsx(Ha,{className:"icon"})}),c.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),c.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[c.jsx(ms,{className:"icon"}),"添加节点"]}),c.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),c.jsxs("div",{className:"wfb-canvas",children:[c.jsxs("button",{className:"wfb-create",onClick:U,disabled:!A,type:"button",children:[c.jsx(za,{className:"icon"}),"创建工作流"]}),c.jsxs(lce,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:y,onConnect:N,onInit:C=>n.current=C,nodeTypes:$ce,defaultEdgeOptions:gS,onDrop:B,onDragOver:M,onNodeClick:(C,L)=>g(L.id),onPaneClick:()=>g(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[c.jsx(mce,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),c.jsx(vce,{showInteractive:!1}),c.jsx(Dce,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),c.jsx("aside",{className:"wfb-inspector",children:E?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"wfb-inspector-head",children:[c.jsx("div",{className:"wfb-section-label",children:"节点配置"}),c.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:P,title:"删除节点",children:c.jsx(Fl,{className:"icon"})})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"名称"}),c.jsx("input",{className:`wfb-input ${T?"wfb-input--error":""}`,value:E.data.agent.name,onChange:C=>Y({name:C.target.value}),placeholder:"agent_name"}),T?c.jsx("span",{className:"wfb-field-error",children:T}):c.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"描述"}),c.jsx("input",{className:"wfb-input",value:E.data.agent.description,onChange:C=>Y({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),c.jsx("textarea",{className:"wfb-input wfb-textarea",value:E.data.agent.instruction,onChange:C=>Y({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),c.jsxs("label",{className:"wfb-field",children:[c.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),c.jsx("input",{className:"wfb-input",value:E.data.agent.tools.join(", "),onChange:C=>Y({tools:C.target.value.split(",").map(L=>L.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),c.jsxs("div",{className:"wfb-inspector-meta",children:[c.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),c.jsx("code",{className:"wfb-meta-val",children:E.id})]})]}):c.jsxs("div",{className:"wfb-inspector-empty",children:[c.jsx(Ha,{className:"wfb-empty-icon"}),c.jsx("p",{children:"选择一个节点以编辑其配置"}),c.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function zce(e){return c.jsx(dP,{children:c.jsx(Hce,{...e})})}const Vce="/web/skill-creator";class ew extends Error{constructor(n,r){super(n);cw(this,"status");this.name="SkillCreatorApiError",this.status=r}}function ao(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function Wt(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function mP(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function jd(e,t){return fetch(Ms(`${Vce}${e}`),{...t,headers:dm({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function tw(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=ao(await e.json(),"错误响应");return Wt(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function nw(e,t){if(!e.ok)throw new ew(await tw(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Kce(e){if(e==="queued")return"queued";if(e==="running")return"running";if(e==="succeeded")return"succeeded";if(e==="failed")return"failed";throw new Error(`未知的 Skill 生成状态:${String(e)}`)}function Yce(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Wce(e){return Array.isArray(e)?e.map((t,n)=>{const r=ao(t,`文件 ${n+1}`),s=Wt(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=mP(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function qce(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=Array.isArray(t.errors)?t.errors.map(String):[],r=Array.isArray(t.warnings)?t.warnings.map(String):[];return{valid:typeof t.valid=="boolean"?t.valid:n.length===0,errors:n,warnings:r}}function Gce(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=ao(t,`活动 ${n+1}`),s=Wt(r,"id"),i=Wt(r,"kind"),a=Wt(r,"status");if(!s||!i||!["status","thinking","tool","message"].includes(i))throw new Error(`活动 ${n+1} 格式错误`);if(a!=="running"&&a!=="done")throw new Error(`活动 ${n+1} 状态错误`);if(i==="tool"){const l=Wt(r,"name");if(!l)throw new Error(`活动 ${n+1} 缺少工具名称`);return{id:s,kind:i,name:l,args:r.input,response:r.output,status:a}}const o=Wt(r,"text");if(!o)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:o,status:a}})}function Xce(e,t){const n=ao(e,`候选方案 ${t+1}`),r=Wt(n,"id","candidate_id","candidateId"),s=Wt(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:Wt(n,"modelLabel","model_label")??s,status:Kce(n.status),stage:Yce(n.stage),name:Wt(n,"name","skill_name","skillName"),description:Wt(n,"description"),skillMd:Wt(n,"skillMd","skill_md"),files:Wce(n.files),activities:Gce(n.activities),validation:qce(n.validation),durationMs:mP(n,"elapsedMs","elapsed_ms"),error:Wt(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:Wt(n,"skill_id","skillId"),version:Wt(n,"version")}}function G1(e,t=""){const n=ao(e,"Skill 创建任务"),r=Wt(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(Xce):[],i=Wt(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:Wt(n,"prompt")??t,status:i,candidates:s}}async function Qce(e,t){const n=await jd("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new ew(await tw(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=G1(await n.json(),e);return t==null||t(u),u}if(!r.includes("application/x-ndjson")||!n.body)throw new Error("创建 Skill 任务失败:服务端返回了非流式响应");const s=n.body.getReader(),i=new TextDecoder;let a="",o;const l=u=>{if(!u.trim())return;const d=ao(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(Wt(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");o=G1(d.job,e),t==null||t(o)};for(;;){const{done:u,value:d}=await s.read();a+=i.decode(d,{stream:!u});const f=a.split(` +`);if(a=f.pop()??"",f.forEach(l),u)break}if(l(a),!o)throw new Error("创建 Skill 任务失败:服务端未返回任务");return o}async function Zce(e){const t=await jd(`/jobs/${encodeURIComponent(e)}`);return G1(await nw(t,"读取 Skill 任务失败"))}async function Jce(e){const t=await jd(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await nw(t,"清理 Skill 任务失败")}async function eue(e,t){var o;const n=await jd(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await tw(n,"下载 Skill 失败"));const s=((o=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:o[1])??"skill.zip",i=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=i,a.download=s,a.click(),URL.revokeObjectURL(i)}async function tue(e,t,n){const r=await jd(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=ao(await nw(r,"添加到 AgentKit 失败"),"发布结果"),i=Wt(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:Wt(s,"name"),version:Wt(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:Wt(s,"message")}}const nue=()=>{};function rue(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error("不支持的 Skill 对话活动")}function sue({activities:e}){const t=v.useMemo(()=>e.filter(n=>n.kind!=="status").map(rue),[e]);return t.length===0?null:c.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:c.jsx(mx,{blocks:t,onAction:nue})})}const yS={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},bS=12e4;function iue({status:e}){return e==="succeeded"?c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):c.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"7"}),c.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function aue(){return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),c.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function oue(){return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function lue({candidate:e}){var l,u;const[t,n]=v.useState("SKILL.md"),r=e.files.find(d=>d.path.endsWith("SKILL.md")),s=e.skillMd&&!r?[{path:"SKILL.md",size:new Blob([e.skillMd]).size},...e.files]:e.files,i=s.find(d=>d.path===t)??s[0],a=(l=e.skillMd)==null?void 0:l.slice(0,bS),o=(((u=e.skillMd)==null?void 0:u.length)??0)>bS;return s.length===0?null:c.jsxs("div",{className:"skill-files",children:[c.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>c.jsx("button",{type:"button",role:"tab","aria-selected":(i==null?void 0:i.path)===d.path,className:(i==null?void 0:i.path)===d.path?"is-active":"",onClick:()=>n(d.path),children:d.path},d.path))}),e.skillMd&&(i!=null&&i.path.endsWith("SKILL.md"))?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"skill-files__content",children:c.jsx("code",{children:a})}),o?c.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):c.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function cue({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:o,onPublish:l}){const[u,d]=v.useState("conversation"),[f,h]=v.useState(!1),[p,m]=v.useState(!1),[y,w]=v.useState(""),[g,E]=v.useState(""),[b,_]=v.useState(""),[k,T]=v.useState(""),A=v.useRef(null),N=v.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",M=n.validation;return c.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[c.jsxs("header",{className:"skill-candidate__header",children:[c.jsx("h2",{children:n.model}),r?c.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?c.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[c.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[c.jsx("span",{className:"skill-candidate__status-icon",children:c.jsx(iue,{status:n.status})}),R?c.jsx(Yl,{duration:2.2,spread:16,children:yS[n.stage]}):c.jsx("span",{children:yS[n.stage]}),n.durationMs!==void 0&&I?c.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),c.jsx(sue,{activities:n.activities}),n.error?c.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?c.jsx("div",{className:"skill-candidate__view-actions",children:c.jsxs("button",{ref:A,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var B;return(B=N.current)==null?void 0:B.focus()})},children:[c.jsx(aue,{}),"查看 Skill"]})}):null]}):c.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[c.jsx("div",{className:"skill-candidate__preview-nav",children:c.jsxs("button",{ref:N,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var B;return(B=A.current)==null?void 0:B.focus()})},children:[c.jsx(oue,{}),"返回对话"]})}),c.jsxs("div",{className:"skill-candidate__result",children:[c.jsxs("div",{className:"skill-candidate__summary",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Skill"}),c.jsx("strong",{children:n.name??"未命名 Skill"})]}),c.jsxs("div",{children:[c.jsx("span",{children:"文件"}),c.jsx("strong",{children:n.files.length})]}),c.jsxs("div",{children:[c.jsx("span",{children:"校验"}),c.jsx("strong",{className:(M==null?void 0:M.valid)===!1?"is-invalid":"is-valid",children:(M==null?void 0:M.valid)===!1?"未通过":"已通过"})]})]}),n.description?c.jsx("p",{className:"skill-candidate__description",children:n.description}):null,M&&(M.errors.length>0||M.warnings.length>0)?c.jsxs("details",{className:"skill-validation",children:[c.jsx("summary",{children:"查看校验详情"}),[...M.errors,...M.warnings].map((B,Y)=>c.jsx("div",{children:B},`${B}-${Y}`))]}):null,c.jsx(lue,{candidate:n}),c.jsxs("div",{className:"skill-candidate__actions",children:[c.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:o,children:r?"已采用此方案":"采用此方案"}),c.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),eue(t,n.id).catch(B=>{w(B instanceof Error?B.message:String(B))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),c.jsx("button",{type:"button",className:"skill-action",disabled:!r||s||i||n.published,title:r?void 0:"请先采用此方案",onClick:()=>h(B=>!B),children:n.published?"已添加到 AgentKit":s?"正在添加…":"添加到 AgentKit"})]}),y?c.jsx("div",{className:"skill-candidate__error",children:y}):null,f&&r&&!n.published?c.jsxs("form",{className:"skill-publish-form",onSubmit:B=>{B.preventDefault();const Y=g.split(",").map(P=>P.trim()).filter(Boolean);l({skillSpaceIds:Y,...b.trim()?{projectName:b.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[c.jsxs("label",{children:[c.jsx("span",{children:"SkillSpace ID(可选)"}),c.jsx("input",{value:g,onChange:B=>E(B.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),c.jsxs("div",{className:"skill-publish-form__optional",children:[c.jsxs("label",{children:[c.jsx("span",{children:"项目名称(可选)"}),c.jsx("input",{value:b,onChange:B=>_(B.target.value)})]}),c.jsxs("label",{children:[c.jsx("span",{children:"已有 Skill ID(可选)"}),c.jsx("input",{value:k,onChange:B=>T(B.target.value)})]})]}),c.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?c.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const ES=new Set(["completed"]),Yf=1100,uue=3e4;function due(e,t){return{id:`pending-${t}`,model:e,modelLabel:e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}}function fue({initialJob:e}){const[t,n]=v.useState(e),[r,s]=v.useState(""),[i,a]=v.useState(!1),[o,l]=v.useState(),[u,d]=v.useState(),[f,h]=v.useState(()=>new Set),[p,m]=v.useState({});v.useEffect(()=>{n(e),s(""),a(!1)},[e]),v.useEffect(()=>{if(ES.has(e.status)||e.id.startsWith("pending-"))return;let g=!1,E;const b=Date.now()+uue,_=async()=>{try{const k=await Zce(e.id);g||(n({...k,prompt:k.prompt||e.prompt}),s(""),ES.has(k.status)||(E=window.setTimeout(_,Yf)))}catch(k){if(!g){const T=k instanceof ew?k:void 0;if((T==null?void 0:T.status)===404&&Date.now(){g=!0,E!==void 0&&window.clearTimeout(E)}},[e.id,e.status]);const y=gx.map((g,E)=>t.candidates.find(b=>b.model===g)??t.candidates[E]??due(g,E));async function w(g,E){d(g.id),m(b=>({...b,[g.id]:""}));try{await tue(t.id,g.id,E),h(b=>new Set(b).add(g.id))}catch(b){m(_=>({..._,[g.id]:b instanceof Error?b.message:String(b)}))}finally{d(void 0)}}return c.jsxs("section",{className:"skill-workspace",children:[c.jsx("header",{className:"skill-workspace__intro",children:c.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?c.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,c.jsx("div",{className:"skill-workspace__grid",children:y.map((g,E)=>{const _=f.has(g.id)||g.published?{...g,published:!0}:g;return c.jsx(cue,{label:`方案 ${E===0?"A":"B"}`,jobId:t.id,candidate:_,selected:o===g.id,publishing:u===g.id,publishDisabled:u!==void 0&&u!==g.id,publishError:p[g.id],onSelect:()=>l(g.id),onPublish:k=>void w(g,k)},`${g.model}-${g.id}`)})})]})}const P0="/web/sandbox/sessions",hue=33e4,pue=6e5,mue=15e3;function j0(e){const t=dm(e);return t.set("Accept","application/json"),t}async function B0(e,t){let n={};try{n=await e.json()}catch{return new Error(`${t}(HTTP ${e.status})`)}const r=n.detail,s=r&&typeof r=="object"&&"message"in r?r.message:r??n.message;return new Error(typeof s=="string"&&s?s:t)}async function gue(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],o=new Map;function l(){t==null||t(a.map(h=>({...h})))}function u(h){i+=h;const p=a[a.length-1];(p==null?void 0:p.kind)==="text"?p.text+=h:a.push({kind:"text",text:h}),l()}function d(h){if(typeof h.id!="string"||h.kind!=="thinking"&&h.kind!=="tool"||h.status!=="running"&&h.status!=="done")return;const p=h.status==="done";let m;if(h.kind==="thinking"){if(typeof h.text!="string"||!h.text)return;m={kind:"thinking",text:h.text,done:p}}else{if(typeof h.name!="string"||!h.name)return;m={kind:"tool",name:h.name,args:h.args,response:h.response,done:p}}const y=o.get(h.id);y===void 0?(o.set(h.id,a.length),a.push(m)):a[y]=m,l()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let y;try{y=JSON.parse(m.join(` +`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof y.message=="string"&&y.message?y.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(y),p==="delta"&&typeof y.text=="string"&&u(y.text),p==="done"&&!i&&typeof y.text=="string"&&u(y.text)}for(;;){const{done:h,value:p}=await n.read();s+=r.decode(p,{stream:!h});const m=s.split(/\r?\n\r?\n/);if(s=m.pop()??"",m.forEach(f),h)break}if(s.trim()&&f(s),a.length===0)throw new Error("沙箱未返回有效回复,请重试。");return{text:i,blocks:a}}const F0={async startSession(e={}){const t=await fetch(Ms(P0),{method:"POST",headers:j0({"Content-Type":"application/json"}),signal:Ds(e.signal,hue)});if(!t.ok)throw await B0(t,"无法启动 AgentKit 沙箱,请稍后重试。");const n=await t.json();if(!n.sessionId||n.status!=="ready")throw new Error("AgentKit 沙箱返回了无效的会话信息。");return{id:n.sessionId,toolName:"codex",createdAt:new Date().toISOString()}},async sendMessage(e,t={}){if(!e.sessionId||!e.text.trim())throw new Error("临时会话缺少有效的消息内容。");const n=await fetch(Ms(`${P0}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:j0({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:Ds(t.signal,pue)});if(!n.ok)throw await B0(n,"沙箱对话失败,请稍后重试。");return gue(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Ms(`${P0}/${encodeURIComponent(e)}`),{method:"DELETE",headers:j0(),signal:Ds(t.signal,mue)});if(!n.ok&&n.status!==404)throw await B0(n,"无法清理 AgentKit 沙箱会话。")}},yue=1e4;async function gP(e){const t=await fetch(Ms(e),{headers:dm({Accept:"application/json"}),signal:Ds(void 0,yue)});if(!t.ok)throw new Error(`读取会话模式能力失败(HTTP ${t.status})`);const n=await t.json();if(typeof n.enabled!="boolean")throw new Error("会话模式能力响应格式错误");return{enabled:n.enabled,reason:typeof n.reason=="string"?n.reason:void 0}}async function bue(){return gP("/web/sandbox/capabilities")}async function Eue(){return gP("/web/skill-creator/capabilities")}function xue(e){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[c.jsx("path",{d:"M12 3.5c.35 3.05 1.62 5.32 4.9 6.1-3.28.78-4.55 3.05-4.9 6.1-.35-3.05-1.62-5.32-4.9-6.1 3.28-.78 4.55-3.05 4.9-6.1Z"}),c.jsx("path",{d:"M18.5 14.5c.18 1.55.84 2.7 2.5 3.1-1.66.4-2.32 1.55-2.5 3.1-.18-1.55-.84-2.7-2.5-3.1 1.66-.4 2.32-1.55 2.5-3.1Z"}),c.jsx("path",{d:"M5.3 14.2c.14 1.15.62 2 1.85 2.3-1.23.3-1.71 1.15-1.85 2.3-.14-1.15-.62-2-1.85-2.3 1.23-.3 1.71-1.15 1.85-2.3Z"})]})}function wue({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=v.useRef(null),a=v.useRef(null);if(v.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],y=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),y.focus()):!h.shiftKey&&document.activeElement===y&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const o=t==="loading",l=o?"正在初始化沙箱":t==="error"?"启动失败":"启用临时会话";return $a.createPortal(c.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!o&&r()},children:c.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[c.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[c.jsx("span",{className:"sandbox-dialog-orbit"}),c.jsx("span",{className:"sandbox-dialog-icon",children:o?c.jsx("span",{className:"sandbox-spinner"}):c.jsx(xue,{})})]}),c.jsxs("div",{className:"sandbox-dialog-copy",children:[c.jsx("h2",{id:"sandbox-dialog-title",children:l}),t==="error"?c.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):o?c.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建临时 Session,通常需要一点时间。"}):c.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex Agent 开启临时会话,您的会话将不会被持久化保存。"})]}),c.jsxs("footer",{className:"sandbox-dialog-actions",children:[c.jsx("button",{ref:a,type:"button",onClick:r,children:o?"取消启动":"取消"}),!o&&c.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function vue({onExit:e}){return c.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[c.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),c.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为临时会话,退出后对话内容消失"}),c.jsx("button",{type:"button",onClick:e,children:"退出临时会话"})]})}const xS=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function U0(e){let t=0;for(let n=0;n>>0;return xS[t%xS.length]}function _ue(e){const t=new Map;e.forEach(u=>t.set(u.span_id,u));const n=new Map,r=[];for(const u of e)u.parent_span_id!=null&&t.has(u.parent_span_id)?(n.get(u.parent_span_id)??n.set(u.parent_span_id,[]).get(u.parent_span_id)).push(u):r.push(u);const s=(u,d)=>u.start_time-d.start_time,i=(u,d)=>({span:u,depth:d,children:(n.get(u.span_id)??[]).sort(s).map(f=>i(f,d+1))}),a=r.sort(s).map(u=>i(u,0)),o=e.length?Math.min(...e.map(u=>u.start_time)):0,l=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:o,total:l-o||1}}function Tue(e,t){const n=[],r=s=>{n.push(s),t.has(s.span.span_id)||s.children.forEach(r)};return e.forEach(r),n}function wS(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const kue=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function vS(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:kue(t),value:r,long:r.length>80||r.includes(` +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function Nue({appName:e,sessionId:t,onClose:n}){const[r,s]=v.useState(null),[i,a]=v.useState(""),[o,l]=v.useState(new Set),[u,d]=v.useState(null);v.useEffect(()=>{s(null),a(""),KI(e,t).then(E=>{s(E),d(E.length?E.reduce((b,_)=>b.start_time<=_.start_time?b:_).span_id:null)}).catch(E=>a(String(E)))},[e,t]);const{rootNodes:f,min:h,total:p}=v.useMemo(()=>_ue(r??[]),[r]),m=v.useMemo(()=>Tue(f,o),[f,o]),y=(r==null?void 0:r.find(E=>E.span_id===u))??null,w=p/1e6,g=E=>l(b=>{const _=new Set(b);return _.has(E)?_.delete(E):_.add(E),_});return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"drawer-scrim",onClick:n}),c.jsxs("aside",{className:"drawer drawer--trace",children:[c.jsxs("header",{className:"drawer-head",children:[c.jsxs("div",{children:[c.jsx("div",{className:"drawer-title",children:"调用链路观测"}),c.jsx("div",{className:"drawer-sub",children:r?`${r.length} 个调用 · ${w.toFixed(1)} ms`:"加载中"})]}),c.jsx("button",{className:"drawer-close",onClick:n,"aria-label":"关闭",children:c.jsx(Xr,{className:"icon"})})]}),r==null&&!i&&c.jsxs("div",{className:"drawer-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载调用链路…"]}),i&&c.jsx("div",{className:"error",children:i}),r&&r.length===0&&c.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),m.length>0&&c.jsxs("div",{className:"trace-split",children:[c.jsx("div",{className:"trace-tree scroll",children:m.map(E=>{const b=E.span,_=(b.start_time-h)/p*100,k=Math.max((b.end_time-b.start_time)/p*100,.6),T=E.children.length>0;return c.jsxs("button",{className:`trace-row ${u===b.span_id?"active":""}`,onClick:()=>d(b.span_id),children:[c.jsxs("span",{className:"trace-label",style:{paddingLeft:E.depth*14},children:[c.jsx("span",{className:`trace-caret ${T?"":"hidden"} ${o.has(b.span_id)?"":"open"}`,onClick:A=>{A.stopPropagation(),T&&g(b.span_id)},children:c.jsx(lr,{className:"chev"})}),c.jsx("span",{className:"trace-dot",style:{background:U0(b.name)}}),c.jsx("span",{className:"trace-name",title:b.name,children:b.name})]}),c.jsx("span",{className:"trace-dur",children:wS(b.end_time-b.start_time)}),c.jsx("span",{className:"trace-track",children:c.jsx("span",{className:"trace-bar",style:{left:`${_}%`,width:`${k}%`,background:U0(b.name)}})})]},b.span_id)})}),c.jsx("div",{className:"trace-detail scroll",children:y?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"td-title",children:y.name}),c.jsxs("div",{className:"td-dur",children:[c.jsx("span",{className:"td-dot",style:{background:U0(y.name)}}),wS(y.end_time-y.start_time)]}),c.jsx("div",{className:"td-section",children:"属性"}),c.jsx("div",{className:"td-props",children:vS(y).filter(E=>!E.long).map(E=>c.jsxs("div",{className:"td-prop",children:[c.jsx("span",{className:"td-key",children:E.key}),c.jsx("span",{className:"td-val",children:E.value})]},E.key))}),vS(y).filter(E=>E.long).map(E=>c.jsxs("div",{className:"td-block",children:[c.jsx("div",{className:"td-section",children:E.key}),c.jsx("pre",{className:"td-pre",children:E.value})]},E.key))]}):c.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}function Sue(e){return e.toLowerCase()==="github"?c.jsx(EF,{className:"icon"}):c.jsx(SF,{className:"icon"})}function Aue({branding:e,onUsername:t}){const[n,r]=v.useState(null),[s,i]=v.useState(""),[a,o]=v.useState(0),[l,u]=v.useState("");v.useEffect(()=>{let h=!0;return r(null),i(""),GF().then(p=>{h&&r(p)}).catch(p=>{h&&i(p instanceof Error?p.message:String(p))}),()=>{h=!1}},[a]);const d=WF.test(l),f=()=>{d&&t(l)};return c.jsxs("div",{className:"login",children:[c.jsx("header",{className:"login-top",children:c.jsxs("span",{className:"login-brand",children:[c.jsx("img",{className:"login-brand-logo",src:e.logoUrl||ux,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),c.jsx("main",{className:"login-main",children:c.jsxs("div",{className:"login-card",children:[c.jsx(Yl,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?c.jsxs("div",{className:"login-provider-error",role:"alert",children:[c.jsx("p",{children:s}),c.jsx("button",{type:"button",onClick:()=>o(h=>h+1),children:"重试"})]}):n===null?null:n.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"login-sub",children:"登录以继续使用"}),c.jsx("div",{className:"login-providers",children:n.map(h=>c.jsxs("button",{className:"login-btn",onClick:()=>XF(h.loginUrl),children:[Sue(h.id),c.jsxs("span",{children:["使用 ",h.label," 登录"]})]},h.id))})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),c.jsxs("form",{className:"login-name",onSubmit:h=>{h.preventDefault(),f()},children:[c.jsx("input",{className:"login-name-input",value:l,onChange:h=>u(h.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16,autoFocus:!0}),c.jsx("button",{type:"submit",className:"login-name-go",disabled:!d,"aria-label":"进入",children:c.jsx(xI,{className:"icon"})})]}),c.jsx("p",{className:"login-hint","aria-live":"polite",children:l&&!d?"只能包含大小写字母和数字,最多 16 位。":""})]}),c.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),c.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",c.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),c.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function Cue({node:e,ctx:t}){const n=e.variant??"default";return c.jsx("button",{type:"button",className:`a2ui-button a2ui-button--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,onClick:()=>t.dispatchAction(e.action,e),children:t.render(e.child)})}io("Button",Cue);function Iue({node:e,ctx:t}){return c.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}io("Card",Iue);const Rue={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},Oue={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function yP(e){return Rue[e]??"flex-start"}function bP(e){return Oue[e]??"stretch"}function Lue({node:e,ctx:t}){const n=e.children??[];return c.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:yP(e.justify),alignItems:bP(e.align)},children:n.map(r=>t.render(r))})}io("Column",Lue);function Mue({node:e}){const t=e.axis==="vertical";return c.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}io("Divider",Mue);const Due={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function Pue({node:e}){const t=e.name??"";return c.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:Due[t]??"•"})}io("Icon",Pue);function jue({node:e,ctx:t}){const n=e.children??[];return c.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:yP(e.justify),alignItems:bP(e.align??"center")},children:n.map(r=>t.render(r))})}io("Row",jue);const Bue=new Set(["h1","h2","h3","h4","h5"]);function Fue({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=Bue.has(n)?n:"p";return c.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}io("Text",Fue);const Uue="创建 Agent",$ue={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流"},vo={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},Hue=new Set,zue=[];function Vs(){return{skills:[]}}function Vue(e,t){var r;const n=oR(e==null?void 0:e.events);if(n!=="新会话")return n;for(const s of t){if(s.role!=="user")continue;const i=(r=s.blocks.find(a=>a.kind==="text"))==null?void 0:r.text.trim();if(i)return i}return"新会话"}function EP(e,t){if(e.name===t)return e;for(const n of e.children){const r=EP(n,t);if(r)return r}}function xP(e){const t=[];for(const n of e.children)n.mentionable&&(t.push({name:n.name,description:n.description,type:n.type,path:n.path}),t.push(...xP(n)));return t}function _S(){const e=typeof localStorage<"u"?localStorage.getItem(vo.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function Kue({className:e}){return c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[c.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),c.jsx("path",{d:"M12 8.2l1.05 2.75 2.75 1.05-2.75 1.05L12 15.8l-1.05-2.75L8.2 12l2.75-1.05z",fill:"currentColor",stroke:"none"})]})}function Yue(){return c.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[c.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),c.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),c.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function wP(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Wue(e){if(!e)return"";const t=[];return e.ts&&t.push(wP(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function que(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const Gue="send_a2ui_json_to_client";function Xue(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"?t.files.length>0:t.kind==="tool"?!(t.name===Gue&&t.done):t.kind==="a2ui"?rM(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function Que(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function Zue(e){return new Promise((t,n)=>{let r="";try{r=new URL(e,window.location.href).protocol}catch{}if(r!=="http:"&&r!=="https:"){n(new Error("授权链接不是 http/https 地址,已阻止打开。"));return}const s=window.open(e,"veadk_oauth","width=520,height=720");if(!s){n(new Error("弹窗被拦截,请允许弹窗后重试。"));return}let i=!1;const a=()=>{clearInterval(u),window.removeEventListener("message",l)},o=d=>{if(!i){i=!0,a();try{s.close()}catch{}t(d)}},l=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&o(f.url)};window.addEventListener("message",l);const u=setInterval(()=>{if(!i){if(s.closed){a();const d=window.prompt("授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:");d&&d.trim()?(i=!0,t(d.trim())):n(new Error("授权已取消。"));return}try{const d=s.location.href;d&&d!=="about:blank"&&new URL(d).origin===window.location.origin&&/[?&](code|state|error)=/.test(d)&&o(d)}catch{}}},500)})}function Jue(e,t){const n=JSON.parse(JSON.stringify(e??{})),r=n.exchangedAuthCredential??n.exchanged_auth_credential??{},s=r.oauth2??{};return s.authResponseUri=t,s.auth_response_uri=t,r.oauth2=s,n.exchangedAuthCredential=r,n}function TS({text:e}){const[t,n]=v.useState(!1);return c.jsx("button",{className:"icon-btn",title:t?"已复制":"复制",disabled:!e,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?c.jsx(Bs,{className:"icon"}):c.jsx(_E,{className:"icon"})})}function ede(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function tde({tasks:e,onCancel:t}){const[n,r]=v.useState(!1),[s,i]=v.useState(null),a=e.filter(f=>f.status==="running").length,o=e[0],l=a>0?"running":(o==null?void 0:o.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(o==null?void 0:o.status)==="success"?"最近部署已完成":(o==null?void 0:o.status)==="error"?"最近部署失败":(o==null?void 0:o.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return c.jsxs("div",{className:"global-deploy-center",children:[c.jsxs("button",{type:"button",className:`global-deploy-task is-${l}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[l==="running"?c.jsx(bt,{className:"global-deploy-task-icon spin"}):l==="success"?c.jsx(cF,{className:"global-deploy-task-icon"}):l==="error"?c.jsx(TI,{className:"global-deploy-task-icon"}):l==="cancelled"?c.jsx(uF,{className:"global-deploy-task-icon"}):c.jsx(NF,{className:"global-deploy-task-icon"}),c.jsx("span",{className:"global-deploy-task-detail",children:u}),c.jsx(op,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),c.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[c.jsxs("header",{className:"global-deploy-popover-head",children:[c.jsx("span",{children:"部署任务"}),c.jsx("span",{children:e.length})]}),c.jsx("div",{className:"global-deploy-list",children:e.length===0?c.jsx("div",{className:"global-deploy-empty",children:"暂无部署任务"}):e.map(f=>{const h=`${f.label}${f.status==="running"&&typeof f.pct=="number"?` ${Math.round(f.pct)}%`:""}`;return c.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[c.jsxs("div",{className:"global-deploy-item-head",children:[c.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),c.jsx("span",{className:"global-deploy-status",children:h})]}),c.jsxs("dl",{className:"global-deploy-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Runtime 名称"}),c.jsx("dd",{children:f.runtimeName})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"部署地域"}),c.jsx("dd",{children:ede(f.region)})]}),f.runtimeId&&c.jsxs("div",{children:[c.jsx("dt",{children:"Runtime ID"}),c.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?c.jsx(Ip,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?c.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:c.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),c.jsx("div",{className:"global-deploy-item-actions",children:c.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const kS=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],NS=()=>kS[Math.floor(Math.random()*kS.length)];function $0(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function nde(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function rde(e){var n;if(e.type)return e.type;const t=(n=e.name.split(".").pop())==null?void 0:n.toLowerCase();return t==="md"||t==="markdown"?"text/markdown":t==="txt"?"text/plain":"application/octet-stream"}function sde(){const[e,t]=v.useState([]),[n,r]=v.useState(""),[s,i]=v.useState([]),[a,o]=v.useState(""),l=v.useRef(null),[u,d]=v.useState(!1),[f,h]=v.useState([]),[p,m]=v.useState(null),[y,w]=v.useState([]),[g,E]=v.useState(!1),[b,_]=v.useState(!1),[k,T]=v.useState("confirm"),[A,N]=v.useState(""),R=v.useRef(null),I=v.useRef(null),[M,B]=v.useState({}),Y=a?M[a]??[]:f,P=p?y:Y,U=p?"灵光一现":Vue(s.find(q=>q.id===a),P),C=(q,te)=>B(xe=>({...xe,[q]:typeof te=="function"?te(xe[q]??[]):te})),[L,O]=v.useState(""),[j,S]=v.useState("agent"),[H,V]=v.useState({}),[D,ne]=v.useState(null),[ee,re]=v.useState(!1),de=v.useRef(0),[G,W]=v.useState([]),[oe,he]=v.useState(Vs),[J,ce]=v.useState(null),[Ce,Ee]=v.useState(!1),ge=v.useRef(new Set),[Le,ve]=v.useState(()=>new Set),Ue=v.useRef(new Map),Ie=(q,te)=>ve(xe=>{const je=new Set(xe);return te?je.add(q):je.delete(q),je}),ae=v.useRef(""),[wt,we]=v.useState(""),[vt,ct]=v.useState(!1),[K,X]=v.useState(NS),[le,ke]=v.useState(null),[Re,ut]=v.useState(null),[We,ot]=v.useState(""),[Zt,Ct]=v.useState(),[Ge,Et]=v.useState(null),[Ht,kn]=v.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[Fe,rt]=v.useState("cloud"),[tt,mt]=v.useState(Du),[ue,Oe]=v.useState("chat"),[Qe,cn]=v.useState(!1),[an,ie]=v.useState(!1),[_e,ye]=v.useState(!1),[Pe,$e]=v.useState({}),[qe,gt]=v.useState({}),[It,Rt]=v.useState({}),yn=Le.has(a)||u,zt=p?g:yn,Nn=Pe[a]??"",Jn=qe[a]??Hue,_r=It[a]??zue,Dn=J==null?void 0:J.graph,Hn=oe.targetAgent&&Dn?EP(Dn,oe.targetAgent.name):Dn,er=(Hn==null?void 0:Hn.skills)??(oe.targetAgent?[]:(J==null?void 0:J.skills)??[]),Tr=Dn?xP(Dn):[];function Vt(q){$0(q);for(const te of q)te.status==="uploading"?ge.current.add(te.id):te.uri&&uh(n,te.uri).catch(xe=>we(String(xe)))}function Sn(){de.current+=1;const q=D;ne(null),re(!1),q&&!q.id.startsWith("pending-")&&Jce(q.id).catch(te=>{we(te instanceof Error?te.message:String(te))})}async function Pn(q){try{await n1(n,We,q),await t1(n,We,q),i(te=>te.filter(xe=>xe.id!==q)),B(te=>{const{[q]:xe,...je}=te;return je})}catch(te){we(String(te))}}function tr(q){const te=G.find(Ke=>Ke.id===q);if(!te)return;const xe=G.filter(Ke=>Ke.id!==q);$0([te]),te.status==="uploading"&&ge.current.add(q),W(xe),xe.length===0&&!L.trim()&&!!a&&P.length===0?(ae.current="",o(""),Pn(a)):te.uri&&uh(n,te.uri).catch(Ke=>we(String(Ke)))}const zn=(q,te)=>{var Ye,Ve,Ze,Se,pt;const xe=te.author&&te.author!=="user"?te.author:void 0;xe&&($e(_t=>({..._t,[q]:xe})),gt(_t=>({..._t,[q]:new Set(_t[q]??[]).add(xe)})),Rt(_t=>{var Mt;return(Mt=_t[q])!=null&&Mt.length?_t:{..._t,[q]:[xe]}}));const je=((Ye=te.actions)==null?void 0:Ye.transferToAgent)??((Ve=te.actions)==null?void 0:Ve.transfer_to_agent);je&&Rt(_t=>{const Mt=_t[q]??[];return Mt[Mt.length-1]===je?_t:{..._t,[q]:[...Mt,je]}}),(((Ze=te.actions)==null?void 0:Ze.endOfAgent)??((Se=te.actions)==null?void 0:Se.end_of_agent)??((pt=te.actions)==null?void 0:pt.escalate))&&Rt(_t=>{const Mt=_t[q]??[];return Mt.length<=1?_t:{..._t,[q]:Mt.slice(0,-1)}})},[An,st]=v.useState(_S),[Cn,Bt]=v.useState([]),Jt=v.useCallback(q=>{Bt(te=>{const xe=te.findIndex(Ke=>Ke.id===q.id);if(xe===-1)return[q,...te];const je=[...te];return je[xe]={...je[xe],...q},je})},[]),In=v.useCallback(async q=>{try{await XI(q.id),Bt(te=>te.map(xe=>xe.id===q.id?{...xe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:xe))}catch(te){const xe=te instanceof Error?te.message:String(te);Bt(je=>je.map(Ke=>Ke.id===q.id?{...Ke,message:`取消失败:${xe}`}:Ke))}},[]),[jn,wn]=v.useState(!0),[nr,Ot]=v.useState(!1),[Z,Ne]=v.useState(!1),[Me,He]=v.useState(!1),[Lt,yt]=v.useState(null),[Kt,Nt]=v.useState(!1),[fr,St]=v.useState(!1),ra=v.useRef(null),[Jl,ec]=v.useState(()=>{const q=Zs();return Kl(q),q}),[Bd,Fd]=v.useState(!1),Wm=v.useRef(!1),Ud=v.useRef(!1);function $d(q){console.log("create agent draft:",q),st(null),oo()}function rw(q,te){console.log("Agent added, navigating to:",q,te),ec(Zs()),st(null),r(q)}const{ref:vP,onScroll:_P}=sM(P),qm=v.useCallback(()=>{ut(null),ZF().then(q=>{ot(q.userId),Ct(q.info),ie(!!q.local),ke(q.status)}).catch(q=>{ut(q instanceof Error?q.message:String(q))})},[]);v.useEffect(()=>{qm()},[qm]),v.useEffect(()=>{an&&We&&H_(We)},[an,We]),v.useEffect(()=>{if(le!=="authenticated"||!We){V({});return}let q=!1;return Promise.allSettled([bue(),Eue()]).then(([te,xe])=>{q||V({temporaryEnabled:te.status==="fulfilled"&&te.value.enabled,skillCreateEnabled:xe.status==="fulfilled"&&xe.value.enabled})}),()=>{q=!0}},[le,We]),v.useEffect(()=>{if(le!=="authenticated"||!We){Et(null);return}let q=!1;return Et(null),eR().then(te=>{q||Et(te)}).catch(te=>{console.warn("[app] /web/access failed; using ordinary-user access:",te),q||Et(JI)}),()=>{q=!0}},[le,We]),v.useEffect(()=>{ZI().then(q=>{kn(q.features),rt(q.agentsSource),mt(q.branding),Oe(q.defaultView),cn(!0)})},[]),v.useEffect(()=>{!Ge||!Qe||Ud.current||(Ud.current=!0,ue==="addAgent"&&Ge.capabilities.createAgents&&(st(null),Ot(!1),Nt(!1),St(!1),Ne(!1),He(!0)))},[Ge,ue,Qe]),v.useEffect(()=>{Ge&&(Ge.capabilities.createAgents||(st(null),yt(null),Ne(!1),He(!1),Bt([])),Ge.capabilities.manageAgents||St(!1))},[Ge]),v.useEffect(()=>{document.title=tt.title;let q=document.querySelector('link[rel~="icon"]');q||(q=document.createElement("link"),q.rel="icon",document.head.appendChild(q)),q.removeAttribute("type"),q.href=tt.logoUrl||ux},[tt]),v.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(q=>q.ok?q.json():null).then(q=>{q&&wn(!!q.credentials)}).catch(q=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",q)})},[]);function TP(q){H_(q),Wm.current=!0,Ud.current=!1,Et(null),st(null),yt(null),Ot(!1),Ne(!1),He(!1),Nt(!1),St(!1),oo(),ot(q),Ct({name:q}),ie(!0),ke("authenticated")}function kP(){Ud.current=!1,Et(null),an?(qF(),ot(""),Ct(void 0),ke("unauthenticated")):QF()}v.useEffect(()=>{le!=="unauthenticated"&&$I().then(q=>{if(t(q),Fe==="cloud"){r("");return}const te=localStorage.getItem(vo.app),xe=Jl.flatMap(Ye=>Ye.apps.map(Ve=>Ka(Ye.id,Ve))),je=te&&(q.includes(te)||xe.includes(te)),Ke=["web_search_agent","web_demo"].find(Ye=>q.includes(Ye))??q.find(Ye=>!/^\d/.test(Ye))??q[0];r(je?te:Ke||"")}).catch(q=>we(String(q)))},[le,Fe]),v.useEffect(()=>{n&&localStorage.setItem(vo.app,n)},[n]),v.useEffect(()=>{let q=!1;if(ce(null),he(Vs()),!n){Ee(!1);return}return Ee(!0),hd(n).then(te=>{q||ce(te)}).catch(()=>{q||ce(null)}).finally(()=>{q||Ee(!1)}),()=>{q=!0}},[n]),v.useEffect(()=>{Ge&&localStorage.setItem(vo.view,Ge.capabilities.createAgents?An??"chat":"chat")},[Ge,An]),v.useEffect(()=>{localStorage.setItem(vo.session,a),ae.current=a},[a]),v.useEffect(()=>()=>Ue.current.forEach(q=>q.abort()),[]),v.useEffect(()=>()=>{var q,te;(q=R.current)==null||q.abort(),(te=I.current)==null||te.abort()},[]),v.useEffect(()=>{!n||!We||(async()=>{const q=await Hd(n);if(!Wm.current){Wm.current=!0;const te=localStorage.getItem(vo.session)||"";if(_S()===null&&te&&q.some(xe=>xe.id===te)){zd(te);return}}oo()})()},[n,We]),v.useEffect(()=>{const q=ra.current;q&&q.app===n&&(ra.current=null,zd(q.sid))},[n]);function NP(q,te){Nt(!1),q===n?zd(te):(ra.current={app:q,sid:te},r(q))}async function Hd(q){try{const te=await OE(q,We),xe=await Promise.all(te.map(je=>{var Ke;return(Ke=je.events)!=null&&Ke.length?Promise.resolve(je):dp(q,We,je.id)}));return i(xe),xe}catch(te){return we(String(te)),[]}}function SP(){p||(we(""),N(""),T("confirm"),_(!0))}function AP(){var q;(q=R.current)==null||q.abort(),R.current=null,_(!1),T("confirm"),N(""),!p&&j==="temporary"&&S("agent")}async function CP(){var te;(te=R.current)==null||te.abort();const q=new AbortController;R.current=q,T("loading"),N("");try{const xe=await F0.startSession({signal:q.signal});if(R.current!==q)return;ae.current="",o(""),h([]),O(""),he(Vs()),S("temporary"),Sn(),re(!1),Vt(G),W([]),w([]),m(xe),st(null),Ot(!1),Ne(!1),He(!1),Nt(!1),St(!1),_(!1),T("confirm")}catch(xe){if((xe==null?void 0:xe.name)==="AbortError"||R.current!==q)return;N(xe instanceof Error?xe.message:String(xe)),T("error")}finally{R.current===q&&(R.current=null)}}function sa(){var te;(te=I.current)==null||te.abort(),I.current=null,E(!1),w([]),O(""),we(""),S("agent");const q=p;m(null),q&&F0.closeSession(q.id).catch(xe=>we(String(xe)))}async function IP(q){var Ke;const te=p;if(!te||g||!q.trim())return;we("");const xe=new AbortController;(Ke=I.current)==null||Ke.abort(),I.current=xe;const je=[{role:"user",blocks:[{kind:"text",text:q}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Ye=>[...Ye,...je]),E(!0);try{const Ye=await F0.sendMessage({sessionId:te.id,text:q},{signal:xe.signal,onBlocks:Ve=>{I.current===xe&&w(Ze=>{const Se=Ze.slice(),pt=Se[Se.length-1];return(pt==null?void 0:pt.role)==="assistant"&&(Se[Se.length-1]={...pt,blocks:Ve}),Se})}});if(I.current!==xe)return;w(Ve=>{const Ze=Ve.slice(),Se=Ze[Ze.length-1];return(Se==null?void 0:Se.role)==="assistant"&&(Ze[Ze.length-1]={...Se,blocks:Ye.blocks,meta:{ts:Date.now()/1e3}}),Ze})}catch(Ye){if((Ye==null?void 0:Ye.name)==="AbortError"||I.current!==xe)return;w(Ve=>Ve.slice(0,-2)),O(q),we(`临时会话发送失败:${Ye instanceof Error?Ye.message:String(Ye)}`)}finally{I.current===xe&&(I.current=null,E(!1))}}function oo(){sa(),we(""),X(NS()),S("agent"),Sn(),re(!1);const q=a&&Y.length===0&&G.length>0?a:"";ae.current="",o(""),d(!1),h([]),he(Vs()),Vt(G),W([]),q&&Pn(q)}async function RP(q){var te;try{(te=Ue.current.get(q))==null||te.abort(),await n1(n,We,q),await t1(n,We,q),B(xe=>{const{[q]:je,...Ke}=xe;return Ke}),q===a&&oo(),await Hd(n)}catch(xe){we(String(xe))}}async function zd(q){if(p&&sa(),q!==a&&(ae.current=q,we(""),d(!1),h([]),S("agent"),Sn(),he(Vs()),o(q),M[q]===void 0)){ye(!0);try{const te=await dp(n,We,q);C(q,fU(te.events??[]))}catch(te){we(String(te))}finally{ye(!1)}}}async function sw(q=!0){if(a)return a;l.current||(l.current=up(n,We));const te=l.current;try{const xe=await te;q&&o(xe);const je=Date.now()/1e3,Ke={id:xe,lastUpdateTime:je,events:[]};return i(Ye=>[Ke,...Ye.filter(Ve=>Ve.id!==xe)]),xe}finally{l.current===te&&(l.current=null)}}async function OP(q){we("");let te;try{te=await sw()}catch(je){we(String(je));return}const xe=Array.from(q).map(je=>({file:je,attachment:{id:nde(),mimeType:rde(je),name:je.name,sizeBytes:je.size,status:"uploading"}}));W(je=>[...je,...xe.map(Ke=>Ke.attachment)]),await Promise.all(xe.map(async({file:je,attachment:Ke})=>{try{const Ye=await HI(n,We,te,je);if(ge.current.delete(Ke.id)){Ye.uri&&await uh(n,Ye.uri);return}W(Ve=>Ve.map(Ze=>Ze.id===Ke.id?Ye:Ze))}catch(Ye){if(ge.current.delete(Ke.id))return;const Ve=Ye instanceof Error?Ye.message:String(Ye);W(Ze=>Ze.map(Se=>Se.id===Ke.id?{...Se,status:"error",error:Ve}:Se)),we(Ve)}}))}async function iw(q,te=[],xe=Vs()){if(!q.trim()&&te.length===0||yn||!n||!We)return;we("");const je=[];(xe.skills.length>0||xe.targetAgent)&&je.push({kind:"invocation",value:xe}),te.length&&je.push({kind:"attachment",files:te.map(Se=>({id:Se.id,mimeType:Se.mimeType,data:Se.data,uri:Se.uri,name:Se.name,sizeBytes:Se.sizeBytes}))}),q.trim()&&je.push({kind:"text",text:q});const Ke=[{role:"user",blocks:je,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Ye=!a;Ye&&(h(Ke),d(!0));let Ve;try{Ve=await sw(!Ye)}catch(Se){Ye&&(h([]),d(!1),O(q),he(xe)),we(String(Se));return}C(Ve,Se=>Ye?Ke:[...Se,...Ke]),Ye&&(ae.current=Ve,o(Ve),h([]),d(!1));const Ze=new AbortController;Ue.current.set(Ve,Ze),Ie(Ve,!0),ae.current=Ve,$e(Se=>({...Se,[Ve]:""})),gt(Se=>({...Se,[Ve]:new Set})),Rt(Se=>({...Se,[Ve]:[]}));try{let Se=Qs(),pt=0,_t=Date.now()/1e3;for await(const Mt of Mu({appName:n,userId:We,sessionId:Ve,text:q,attachments:te,invocation:xe,signal:Ze.signal})){if(Ze.signal.aborted)break;const pi=Mt.error??Mt.errorMessage??Mt.error_message;if(typeof pi=="string"&&pi){ae.current===Ve&&we(pi);break}zn(Ve,Mt),Se=ml(Se,Mt);const lo=Mt.usageMetadata??Mt.usage_metadata;lo!=null&&lo.totalTokenCount&&(pt=lo.totalTokenCount),Mt.timestamp&&(_t=Mt.timestamp);const Zm=Se.blocks,aa={tokens:pt||void 0,ts:_t};C(Ve,oa=>{const mi=oa.slice(),Yd=mi[mi.length-1];return(Yd==null?void 0:Yd.role)==="assistant"&&(mi[mi.length-1]={...Yd,blocks:Zm,meta:aa}),mi})}Hd(n)}catch(Se){(Se==null?void 0:Se.name)!=="AbortError"&&!Ze.signal.aborted&&ae.current===Ve&&we(String(Se))}finally{Ue.current.get(Ve)===Ze&&Ue.current.delete(Ve),Ie(Ve,!1),$e(Se=>({...Se,[Ve]:""})),Rt(Se=>({...Se,[Ve]:[]}))}}function LP(q,te){var Ke,Ye;const xe=((Ke=q==null?void 0:q.event)==null?void 0:Ke.name)??te.id,je=((Ye=q==null?void 0:q.event)==null?void 0:Ye.context)??{};iw(`[ui-action] ${xe}: ${JSON.stringify(je)}`)}async function MP(q){if(!q.authUri)throw new Error("事件中没有授权地址。");if(!n||!We||!a)throw new Error("会话尚未就绪。");const te=a,xe=await Zue(q.authUri),je=Jue(q.authConfig,xe),Ke=Se=>Se.map(pt=>pt.kind==="auth"&&!pt.done?{...pt,done:!0}:pt);C(te,Se=>{const pt=Se.slice(),_t=pt[pt.length-1];return(_t==null?void 0:_t.role)==="assistant"&&(pt[pt.length-1]={..._t,blocks:Ke(_t.blocks)}),pt});const Ye=P[P.length-1],Ve=Ke(Ye&&Ye.role==="assistant"?Ye.blocks:[]),Ze=new AbortController;Ue.current.set(te,Ze),Ie(te,!0);try{let Se=Qs(),pt=0,_t=Date.now()/1e3;for await(const Mt of Mu({appName:n,userId:We,sessionId:a,text:"",functionResponses:[{id:q.callId,name:"adk_request_credential",response:je}],signal:Ze.signal})){if(Ze.signal.aborted)break;zn(te,Mt),Se=ml(Se,Mt);const pi=Mt.usageMetadata??Mt.usage_metadata;pi!=null&&pi.totalTokenCount&&(pt=pi.totalTokenCount),Mt.timestamp&&(_t=Mt.timestamp);const lo=[...Ve,...Se.blocks];C(te,Zm=>{var mi;const aa=Zm.slice(),oa=aa[aa.length-1];return(oa==null?void 0:oa.role)==="assistant"&&(aa[aa.length-1]={...oa,blocks:lo,meta:{tokens:pt||((mi=oa.meta)==null?void 0:mi.tokens),ts:_t}}),aa})}Hd(n)}catch(Se){(Se==null?void 0:Se.name)!=="AbortError"&&!Ze.signal.aborted&&ae.current===te&&we(String(Se))}finally{Ue.current.get(te)===Ze&&Ue.current.delete(te),Ie(te,!1),$e(Se=>({...Se,[te]:""})),Rt(Se=>({...Se,[te]:[]}))}}if(Re)return c.jsxs("div",{className:"boot boot-error",children:[c.jsx("p",{children:Re}),c.jsx("button",{type:"button",onClick:qm,children:"重试"})]});if(le===null)return c.jsx("div",{className:"boot"});if(le==="unauthenticated")return c.jsx(Aue,{branding:tt,onUsername:TP});if(!Ge)return c.jsx("div",{className:"boot"});const ia=Ge.capabilities.createAgents,aw=Ge.capabilities.manageAgents,ws=ia?An:null,Gm=ia&&Me,Xm=ia&&Z,ow=aw&&fr,lw=YL(e,Jl),Vd=q=>{var te;return((te=lw.find(xe=>xe.id===q))==null?void 0:te.label)??q},tc=Jl.find(q=>q.runtimeId&&q.apps.some(te=>Ka(q.id,te)===n)),Kd=tc&&tc.runtimeId?{runtimeId:tc.runtimeId,name:tc.name,region:tc.region??"cn-beijing"}:void 0,Qm=q=>{ec(Zs()),ae.current="",o(""),r(q)},DP=async q=>{const te=await cx(q.runtimeId,q.name,q.region);Qm(te)};return c.jsxs("div",{className:"layout",children:[c.jsx(jZ,{branding:tt,access:Ge,agentsSource:Fe,localApps:e,currentAgentId:n,currentAgentLabel:n?Vd(n):"",currentRuntime:Kd,onSelectAgent:Qm,features:Ht,sessions:s,currentSessionId:a,streamingSids:Le,onNewChat:()=>{st(null),Ot(!1),Ne(!1),He(!1),Nt(!1),St(!1),oo()},onSearch:()=>{p&&sa(),st(null),Ot(!1),Ne(!1),He(!1),St(!1),Nt(!0),we("")},onQuickCreate:()=>{if(!ia){we("当前账号没有添加 Agent 的权限。");return}p&&sa(),ae.current="",o(""),Ot(!1),Ne(!1),Nt(!1),St(!1),st(null),yt(null),He(!0),we("")},onSkillCenter:()=>{p&&sa(),st(null),Ne(!1),He(!1),Nt(!1),St(!1),Ot(!0),we("")},onAddAgent:()=>{if(!ia){we("当前账号没有添加 Agent 的权限。");return}p&&sa(),ae.current="",st(null),Ot(!1),Nt(!1),St(!1),o(""),He(!1),Ne(!0),we("")},onManageAgents:()=>{if(!aw){we("当前账号没有管理 Agent 的权限。");return}p&&sa(),ae.current="",o(""),st(null),Ot(!1),Ne(!1),He(!1),Nt(!1),St(!0),we("")},onPickSession:q=>{st(null),Ot(!1),Ne(!1),He(!1),Nt(!1),St(!1),we(""),zd(q)},onDeleteSession:RP,userInfo:Zt,onLogout:kP}),(()=>{const q=c.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&c.jsx(vue,{onExit:oo}),c.jsx(xJ,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Vd(n):"Agent",value:L,onChange:O,onSubmit:()=>{if(!p&&j==="skill-create"){const Ke=L.trim();if(!Ke||ee)return;const Ye={id:`pending-${Date.now()}`,prompt:Ke,status:"provisioning",candidates:gx.map((Ze,Se)=>({id:`pending-${Se}`,model:Ze,modelLabel:Ze,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};re(!0);const Ve=++de.current;we(""),ne(Ye),O(""),Qce(Ke,Ze=>{de.current===Ve&&ne(Ze)}).then(Ze=>{de.current===Ve&&ne(Ze)}).catch(Ze=>{de.current===Ve&&(ne(null),O(Ke),we(Ze instanceof Error?Ze.message:String(Ze)))}).finally(()=>{de.current===Ve&&re(!1)});return}const te=L;if(O(""),p){IP(te);return}const xe=G,je=oe;W([]),he(Vs()),iw(te,xe,je),$0(xe)},disabled:p?!1:!We||j==="temporary"||j==="agent"&&!n,busy:p?g:j==="skill-create"?ee:yn,showMeta:P.length>0&&!p,attachments:p?[]:G,skills:p?[]:er,agents:p?[]:Tr,invocation:p?Vs():oe,capabilitiesLoading:!p&&Ce,allowAttachments:!p,onInvocationChange:he,onAddFiles:OP,onRemoveAttachment:tr,newChatMode:p?"agent":j,newChatLayout:!p&&P.length===0&&D===null,showModeSelector:!p&&P.length===0&&D===null&&ia,temporaryEnabled:H.temporaryEnabled,skillCreateEnabled:H.skillCreateEnabled,onModeChange:te=>{if(!(te==="temporary"&&!H.temporaryEnabled||te==="skill-create"&&!H.skillCreateEnabled)){if(te==="temporary"){S(te),SP();return}if(S(te),we(""),te==="skill-create"){he(Vs());const xe=a&&Y.length===0&&G.length>0?a:"";Vt(G),W([]),xe&&(ae.current="",o(""),Pn(xe))}}}})]});return c.jsxs("section",{className:"main-shell",children:[c.jsx(BZ,{apps:lw.map(te=>te.id),appName:n,onAppChange:Qm,agentLabel:Vd,title:Gm?"添加 Agent":Xm?"添加 AgentKit 智能体":nr?void 0:Kt?"搜索":ow?"管理 Agent":ws?void 0:U,crumbs:nr?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:Kt||Xm||Gm||!ws?void 0:ws==="menu"?[{label:Uue,onClick:()=>{st(null),yt(null),He(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Fd(!0)},{label:$ue[ws]}],rightContent:c.jsx(tde,{tasks:ia?Cn:[],onCancel:In})}),c.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[wt&&c.jsx("div",{className:"error",children:wt}),_e&&c.jsxs("div",{className:"session-loading",children:[c.jsx(bt,{className:"icon spin"})," 加载会话…"]}),ow?c.jsx(zZ,{currentRuntimeId:Kd==null?void 0:Kd.runtimeId,onConnect:DP}):Gm?c.jsx(fM,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:Kue,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{He(!1),yt(null),st("menu")}}]}):Kt?c.jsx(pZ,{userId:We,appId:n,agentInfo:J,capabilitiesLoading:Ce,agentLabel:Vd,onOpenSession:NP}):Xm?c.jsx(HZ,{onAdded:te=>{ec(Zs()),Ne(!1),r(te)},onCancel:()=>Ne(!1)}):nr?c.jsx(nZ,{}):ws!==null&&!jn?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,height:"100%",padding:24,textAlign:"center",color:"var(--text-secondary, #6b7280)"},children:[c.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),c.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",c.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",c.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):ws==="menu"?c.jsx(Xee,{onSelect:te=>{yt(null),st(te)},onImport:te=>{yt(te),st("custom")}}):ws==="intelligent"?c.jsx(_te,{userId:We,onBack:()=>st("menu"),onCreate:$d,onAgentAdded:rw,onDeploymentTaskChange:Jt}):ws==="custom"?c.jsx(fne,{initialDraft:Lt??void 0,onBack:()=>st("menu"),onCreate:$d,onAgentAdded:rw,features:Ht,onDeploymentTaskChange:Jt}):ws==="template"?c.jsx(mne,{onBack:()=>st("menu"),onCreate:$d}):ws==="workflow"?c.jsx(zce,{onBack:()=>st("menu"),onCreate:$d}):P.length===0&&D?c.jsx(fue,{initialJob:D}):P.length===0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"welcome",children:[c.jsx(Yl,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":j==="skill-create"?"想创建一个什么 Skill?":K}),q]}),!p&&j==="agent"?c.jsx(Fk,{appName:n,activeAgent:Nn,seenAgents:Jn,execPath:_r}):null]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"transcript",ref:vP,onScroll:_P,children:P.map((te,xe)=>{var Ye;const je=xe===P.length-1;if(te.role==="user"){const Ve=te.blocks.map(pt=>pt.kind==="text"?pt.text:"").join(""),Ze=te.blocks.flatMap(pt=>pt.kind==="attachment"?pt.files:[]),Se=te.blocks.find(pt=>pt.kind==="invocation");return c.jsxs(Gt.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Se==null?void 0:Se.kind)==="invocation"&&c.jsx(fx,{value:Se.value}),Ze.length>0&&c.jsx(px,{appName:n,items:Ze}),Ve&&c.jsx("div",{className:"bubble",children:c.jsx(_d,{text:Ve})}),c.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ye=te.meta)==null?void 0:Ye.ts)&&c.jsx("span",{className:"meta-text",children:wP(te.meta.ts)}),c.jsx(TS,{text:Ve})]})]},xe)}const Ke=te.blocks.length===0;return c.jsx(Gt.div,{className:"turn turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:Ke?je&&zt?c.jsx(dM,{}):null:c.jsxs(c.Fragment,{children:[c.jsx(mx,{appName:n,blocks:te.blocks,onAction:LP,onAuth:MP}),!(je&&zt)&&!Xue(te)&&c.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(je&&zt)&&!Que(te)&&c.jsxs("div",{className:"turn-meta",children:[c.jsxs("div",{className:"turn-actions",children:[!p&&c.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>ct(!0),children:c.jsx(Yue,{})}),c.jsx(TS,{text:que(te)})]}),te.meta&&c.jsx("span",{className:"meta-text",children:Wue(te.meta)})]})]})},xe)})}),!p&&c.jsx(Fk,{appName:n,activeAgent:Nn,seenAgents:Jn,execPath:_r}),q]})]})]})})(),vt&&a&&c.jsx(Nue,{appName:n,sessionId:a,onClose:()=>ct(!1)}),c.jsx(wue,{open:b,state:k,error:A,onCancel:AP,onConfirm:()=>void CP()}),Bd&&c.jsx("div",{className:"confirm-scrim",onClick:()=>Fd(!1),children:c.jsxs("div",{className:"confirm-box",onClick:q=>q.stopPropagation(),children:[c.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),c.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),c.jsxs("div",{className:"confirm-actions",children:[c.jsx("button",{className:"confirm-btn",onClick:()=>Fd(!1),children:"取消"}),c.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{yt(null),st("menu"),Fd(!1)},children:"确定返回"})]})]})})]})}(()=>{if(!(window.opener&&window.opener!==window&&/[?&](code|state|error)=/.test(window.location.search)))return!1;try{window.opener.postMessage({veadkOAuth:!0,url:window.location.href},window.location.origin)}catch{}return window.close(),!0})()||H0.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(x5,{reducedMotion:"user",children:c.jsx(J9,{maskOpacity:.9,children:c.jsx(sde,{})})})}));export{v as A,ym as B,Or as C,cde as D,Qc as E,Va as F,XR as G,ade as R,Qn as V,et as a,gl as b,DT as c,ude as d,$E as e,NH as f,Bu as g,dt as h,zV as i,XV as j,AH as k,td as l,XK as m,RV as n,OV as o,sY as p,TK as q,kK as r,oO as s,c as t,Be as u,At as v,it as w,lde as x,$V as y,$a as z}; diff --git a/veadk/webui/index.html b/veadk/webui/index.html index b251972d..262e147f 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,8 +5,8 @@ VeADK Studio - - + +